主题整合周计划及明细

This commit is contained in:
paidaxing444 2020-08-26 11:00:18 +08:00
parent 2d8e96e661
commit 5d804c69f8
23 changed files with 1886 additions and 48 deletions

View File

@ -1,7 +1,7 @@
import request from '@/utils/request'
// 查询主题整合周计划列表
export function listWeekplan(query) {
export function listMonthplanitem(query) {
return request({
url: '/benyi/thememonthplanitem/list',
method: 'get',
@ -10,7 +10,7 @@ export function listWeekplan(query) {
}
// 查询主题整合周计划详细
export function getWeekplan(id) {
export function getMonthplanitem(id) {
return request({
url: '/benyi/thememonthplanitem/' + id,
method: 'get'
@ -18,7 +18,7 @@ export function getWeekplan(id) {
}
// 新增主题整合周计划
export function addWeekplan(data) {
export function addMonthplanitem(data) {
return request({
url: '/benyi/thememonthplanitem',
method: 'post',
@ -27,7 +27,7 @@ export function addWeekplan(data) {
}
// 修改主题整合周计划
export function updateWeekplan(data) {
export function updateMonthplanitem(data) {
return request({
url: '/benyi/thememonthplanitem',
method: 'put',
@ -36,7 +36,7 @@ export function updateWeekplan(data) {
}
// 删除主题整合周计划
export function delWeekplan(id) {
export function delMonthplanitem(id) {
return request({
url: '/benyi/thememonthplanitem/' + id,
method: 'delete'
@ -44,7 +44,7 @@ export function delWeekplan(id) {
}
// 导出主题整合周计划
export function exportWeekplan(query) {
export function exportMonthplanitem(query) {
return request({
url: '/benyi/thememonthplanitem/export',
method: 'get',

View File

@ -0,0 +1,53 @@
import request from '@/utils/request'
// 查询主题整合周计划(根据月计划明细)列表
export function listWeekplan(query) {
return request({
url: '/benyi/themeweekplan/list',
method: 'get',
params: query
})
}
// 查询主题整合周计划(根据月计划明细)详细
export function getWeekplan(id) {
return request({
url: '/benyi/themeweekplan/' + id,
method: 'get'
})
}
// 新增主题整合周计划(根据月计划明细)
export function addWeekplan(data) {
return request({
url: '/benyi/themeweekplan',
method: 'post',
data: data
})
}
// 修改主题整合周计划(根据月计划明细)
export function updateWeekplan(data) {
return request({
url: '/benyi/themeweekplan',
method: 'put',
data: data
})
}
// 删除主题整合周计划(根据月计划明细)
export function delWeekplan(id) {
return request({
url: '/benyi/themeweekplan/' + id,
method: 'delete'
})
}
// 导出主题整合周计划(根据月计划明细)
export function exportWeekplan(query) {
return request({
url: '/benyi/themeweekplan/export',
method: 'get',
params: query
})
}

View File

@ -0,0 +1,53 @@
import request from '@/utils/request'
// 查询主题整合周计划明细列表
export function listWeekplanitem(query) {
return request({
url: '/benyi/themeweekplanitem/list',
method: 'get',
params: query
})
}
// 查询主题整合周计划明细详细
export function getWeekplanitem(id) {
return request({
url: '/benyi/themeweekplanitem/' + id,
method: 'get'
})
}
// 新增主题整合周计划明细
export function addWeekplanitem(data) {
return request({
url: '/benyi/themeweekplanitem',
method: 'post',
data: data
})
}
// 修改主题整合周计划明细
export function updateWeekplanitem(data) {
return request({
url: '/benyi/themeweekplanitem',
method: 'put',
data: data
})
}
// 删除主题整合周计划明细
export function delWeekplanitem(id) {
return request({
url: '/benyi/themeweekplanitem/' + id,
method: 'delete'
})
}
// 导出主题整合周计划明细
export function exportWeekplanitem(query) {
return request({
url: '/benyi/themeweekplanitem/export',
method: 'get',
params: query
})
}

View File

@ -179,11 +179,11 @@
<script>
import {
listWeekplan,
getWeekplan,
delWeekplan,
addWeekplan,
updateWeekplan,
listMonthplanitem,
getMonthplanitem,
delMonthplanitem,
addMonthplanitem,
updateMonthplanitem,
} from "@/api/benyi/thememonthplanitem";
import { listMonthplan, getMonthplan } from "@/api/benyi/thememonthplan";
import { listActivityByThemeId } from "@/api/benyi/activity";
@ -337,7 +337,7 @@ export default {
/** 查询主题整合周计划列表 */
getList() {
this.loading = true;
listWeekplan(this.queryParams).then((response) => {
listMonthplanitem(this.queryParams).then((response) => {
this.weekplanList = response.rows;
this.total = response.total;
this.loading = false;
@ -392,7 +392,7 @@ export default {
handleUpdate(row) {
this.reset();
const id = row.id || this.ids;
getWeekplan(id).then((response) => {
getMonthplanitem(id).then((response) => {
this.form = response.data;
this.open = true;
this.title = "修改主题整合周计划明细";
@ -413,7 +413,7 @@ export default {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id != undefined) {
updateWeekplan(this.form).then((response) => {
updateMonthplanitem(this.form).then((response) => {
if (response.code === 200) {
this.msgSuccess("修改成功");
this.open = false;
@ -421,7 +421,7 @@ export default {
}
});
} else {
addWeekplan(this.form).then((response) => {
addMonthplanitem(this.form).then((response) => {
if (response.code === 200) {
this.msgSuccess("新增成功");
this.open = false;
@ -445,7 +445,7 @@ export default {
}
)
.then(function () {
return delWeekplan(ids);
return delMonthplanitem(ids);
})
.then(() => {
this.getList();

View File

@ -98,7 +98,7 @@
</router-link>
</template>
</el-table-column>
<el-table-column label="所属班级" align="center" prop="classid" :formatter="classFormat" />
<el-table-column label="班级名称" align="center" prop="classid" :formatter="classFormat" />
<el-table-column label="学年学期" align="center" prop="xnxq" :formatter="xnxqFormat" />
<el-table-column label="计划月份" align="center" prop="month" width="180">
<template slot-scope="scope">
@ -164,10 +164,11 @@
type="month"
value-format="yyyy-MM"
placeholder="选择计划月份"
:disabled="disable"
></el-date-picker>
</el-form-item>
<el-form-item label="学年学期" prop="xnxq">
<el-select v-model="form.xnxq" placeholder="请选择学年学期">
<el-select v-model="form.xnxq" placeholder="请选择学年学期" :disabled="disable">
<el-option
v-for="dict in xnxqOptions"
:key="dict.dictValue"
@ -198,7 +199,7 @@ import {
delMonthplan,
addMonthplan,
updateMonthplan,
checkMonthplan
checkMonthplan,
} from "@/api/benyi/thememonthplan";
import Editor from "@/components/Editor";
import { listClass } from "@/api/system/class";
@ -211,6 +212,7 @@ export default {
},
data() {
return {
disable: false,
//
loading: true,
//
@ -398,6 +400,7 @@ export default {
this.reset();
this.open = true;
this.title = "添加主题整合月计划";
this.disable = false;
},
/** 修改按钮操作 */
handleUpdate(row) {
@ -407,6 +410,7 @@ export default {
this.form = response.data;
this.open = true;
this.title = "修改主题整合月计划";
this.disable = true;
});
},
/** 提交按钮 */
@ -436,15 +440,11 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$confirm(
'是否确认删除主题整合月计划数据项?',
"警告",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
this.$confirm("是否确认删除主题整合月计划数据项?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(function () {
return delMonthplan(ids);
})
@ -457,15 +457,11 @@ export default {
/** 提交按钮操作 */
handleCheck(row) {
const id = row.id;
this.$confirm(
"是否确认提交主题整合月计划?提交后数据将不能维护",
"警告",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
this.$confirm("是否确认提交主题整合月计划?提交后数据将不能维护", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(function () {
return checkMonthplan(id);
})

View File

@ -71,8 +71,8 @@
<el-table v-loading="loading" :data="termplanList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" :selectable="isShow"/>
<el-table-column label="班级" align="center" prop="classid" :formatter="classFormat" />
<el-table-column label="名称" align="center" prop="name" :show-overflow-tooltip="true">
<el-table-column label="班级名称" align="center" prop="classid" :formatter="classFormat" />
<el-table-column label="计划名称" align="center" prop="name" :show-overflow-tooltip="true">
<template slot-scope="scope">
<router-link :to="'/benyi_course/themetermplan/data/' + scope.row.id" class="link-type">
<span>{{ scope.row.name }}</span>

View File

@ -0,0 +1,397 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
<el-form-item label="计划名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入计划名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="学年学期" prop="xnxq">
<el-select v-model="queryParams.xnxq" placeholder="请选择学年学期" clearable size="small">
<el-option
v-for="dict in xnxqOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item label="所属月份" prop="month">
<el-date-picker
clearable
size="small"
style="width: 200px"
v-model="queryParams.month"
type="month"
value-format="yyyy-MM"
placeholder="选择所属月份"
></el-date-picker>
</el-form-item>
<el-form-item label="所属周次" prop="zc">
<el-input-number
v-model="queryParams.zc"
placeholder="周次"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
<el-option
v-for="dict in statusOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['benyi:themeweekplan:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['benyi:themeweekplan:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['benyi:themeweekplan:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['benyi:themeweekplan:export']"
>导出</el-button>
</el-col>
</el-row>
<el-table v-loading="loading" :data="weekplanList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="编号" align="center" prop="id" /> -->
<el-table-column label="计划名称" align="center" prop="name" :show-overflow-tooltip="true" />
<el-table-column label="班级名称" align="center" prop="classid" :formatter="classFormat" />
<el-table-column label="所属月份" align="center" prop="month" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.month, '{y}-{m}') }}</span>
</template>
</el-table-column>
<el-table-column label="所属周次" align="center" prop="zc" />
<el-table-column label="学年学期" align="center" prop="xnxq" :formatter="xnxqFormat" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="状态" align="center" prop="status" :formatter="statusFormat" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['benyi:themeweekplan:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['benyi:themeweekplan:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改主题整合周计划根据月计划明细对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="学年学期" prop="xnxq">
<el-select v-model="form.xnxq" placeholder="请选择学年学期" :disabled="disable">
<el-option
v-for="dict in xnxqOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item label="所属月份" prop="month">
<el-date-picker
clearable
size="small"
style="width: 200px"
v-model="form.month"
type="month"
value-format="yyyy-MM"
placeholder="选择所属月份"
:disabled="disable"
></el-date-picker>
</el-form-item>
<el-form-item label="所属周次" prop="zc">
<el-input-number v-model="form.zc" placeholder="周次" :disabled="disable" />
</el-form-item>
<el-form-item label="备注" prop="remar">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listWeekplan,
getWeekplan,
delWeekplan,
addWeekplan,
updateWeekplan,
exportWeekplan,
} from "@/api/benyi/themeweekplan";
import { listClass } from "@/api/system/class";
export default {
name: "Weekplan",
data() {
return {
disable: false,
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
total: 0,
//
weekplanList: [],
//
title: "",
//
open: false,
//
xnxqOptions: [],
//
classOptions: [],
//
statusOptions: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
name: undefined,
schoolid: undefined,
classid: undefined,
month: undefined,
zc: undefined,
status: undefined,
spr: undefined,
sptime: undefined,
shyj: undefined,
createuserid: undefined,
xnxq: undefined,
},
//
form: {},
//
rules: {
xnxq: [
{ required: true, message: "学年学期不能为空", trigger: "blur" },
],
month: [{ required: true, message: "月份不能为空", trigger: "blur" }],
zc: [{ required: true, message: "周次不能为空", trigger: "blur" }],
},
};
},
created() {
this.getList();
this.getClassList();
this.getDicts("sys_xnxq").then((response) => {
this.xnxqOptions = response.data;
});
this.getDicts("sys_dm_planweekstatus").then((response) => {
this.statusOptions = response.data;
});
},
methods: {
//
getClassList() {
listClass(null).then((response) => {
this.classOptions = response.rows;
});
},
// --
statusFormat(row, column) {
return this.selectDictLabel(this.statusOptions, row.status);
},
// --
xnxqFormat(row, column) {
return this.selectDictLabel(this.xnxqOptions, row.xnxq);
},
//
classFormat(row, column) {
// return this.selectDictLabel(this.classOptions, row.classid);
var actions = [];
var datas = this.classOptions;
Object.keys(datas).map((key) => {
if (datas[key].bjbh == "" + row.classid) {
actions.push(datas[key].bjmc);
return false;
}
});
return actions.join("");
},
/** 查询主题整合周计划(根据月计划明细)列表 */
getList() {
this.loading = true;
listWeekplan(this.queryParams).then((response) => {
this.weekplanList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: undefined,
name: undefined,
schoolid: undefined,
classid: undefined,
month: undefined,
zc: undefined,
remark: undefined,
status: "0",
spr: undefined,
sptime: undefined,
shyj: undefined,
createuserid: undefined,
createTime: undefined,
xnxq: undefined,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id);
this.single = selection.length != 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加主题整合周计划";
this.disable = false;
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids;
getWeekplan(id).then((response) => {
this.form = response.data;
this.open = true;
this.title = "修改主题整合周计划";
this.disable = true;
});
},
/** 提交按钮 */
submitForm: function () {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id != undefined) {
updateWeekplan(this.form).then((response) => {
if (response.code === 200) {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
}
});
} else {
addWeekplan(this.form).then((response) => {
if (response.code === 200) {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
}
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$confirm("是否确认删除主题整合周计划数据项?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(function () {
return delWeekplan(ids);
})
.then(() => {
this.getList();
this.msgSuccess("删除成功");
})
.catch(function () {});
},
},
};
</script>

View File

@ -51,7 +51,7 @@ public class ByThemeMonthplanController extends BaseController {
@Autowired
private IByThemeTermplanitemService byThemeTermplanitemService;
@Autowired
private IByThemeMonthplanitemService byThemeWeekplanService;
private IByThemeMonthplanitemService byThemeonthplanitemService;
/**
* 查询主题整合月计划列表
@ -100,7 +100,7 @@ public class ByThemeMonthplanController extends BaseController {
ByThemeTermplan byThemeTermplan = new ByThemeTermplan();
byThemeTermplan.setSchoolid(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
byThemeTermplan.setClassid(classId);
byThemeTermplan.setStatus("1");
byThemeTermplan.setStatus("2");
byThemeTermplan.setXnxq(byThemeMonthplan.getXnxq());
List<ByThemeTermplan> list = byThemeTermplanService.selectByThemeTermplanList(byThemeTermplan);
String strThemeIds = "";
@ -112,7 +112,7 @@ public class ByThemeMonthplanController extends BaseController {
byThemeTermplanitem.setMonth(byThemeMonthplan.getMonth());
List<ByThemeTermplanitem> listItem = byThemeTermplanitemService.selectByThemeTermplanitemList(byThemeTermplanitem);
if (listItem != null && listItem.size() > 0) {
for (int j = 0; j < list.size(); j++) {
for (int j = 0; j < listItem.size(); j++) {
String themeIds = listItem.get(j).getThemeconent();
if (!schoolCommon.isStringEmpty(themeIds)) {
strThemeIds = strThemeIds + themeIds;
@ -163,7 +163,7 @@ public class ByThemeMonthplanController extends BaseController {
for (int i = 0; i < ids.length; i++) {
ByThemeMonthplanitem byThemeMonthplanitem = new ByThemeMonthplanitem();
byThemeMonthplanitem.setMpid(ids[i]);
List<ByThemeMonthplanitem> list = byThemeWeekplanService.selectByThemeMonthplanitemList(byThemeMonthplanitem);
List<ByThemeMonthplanitem> list = byThemeonthplanitemService.selectByThemeMonthplanitemList(byThemeMonthplanitem);
if (list != null && list.size() > 0) {
return AjaxResult.error("选中的计划下存在子计划,无法删除");
}

View File

@ -104,11 +104,13 @@ public class ByThemeTermplanController extends BaseController {
byThemeTermplanitem = new ByThemeTermplanitem();
byThemeTermplanitem.setTpid(uuid);
byThemeTermplanitem.setCreateuserid(SecurityUtils.getLoginUser().getUser().getUserId());
//月份加1
Calendar calendar = Calendar.getInstance();
calendar.setTime(byThemeTermplan.getStartmonth());
calendar.add(Calendar.MONTH, i);
byThemeTermplanitem.setMonth(calendar.getTime());
// //月份加1
// Calendar calendar = Calendar.getInstance();
// calendar.setTime(byThemeTermplan.getStartmonth());
// calendar.add(Calendar.MONTH, i);
byThemeTermplanitem.setMonth(schoolCommon.DateAddMonths(i, byThemeTermplan.getStartmonth()));
//创建时间
byThemeTermplanitem.setCreateTime(new Date());

View File

@ -0,0 +1,192 @@
package com.ruoyi.project.benyi.controller;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.project.benyi.domain.ByThemeMonthplan;
import com.ruoyi.project.benyi.domain.ByThemeMonthplanitem;
import com.ruoyi.project.benyi.domain.ByThemeWeekplanitem;
import com.ruoyi.project.benyi.service.IByThemeMonthplanService;
import com.ruoyi.project.benyi.service.IByThemeMonthplanitemService;
import com.ruoyi.project.benyi.service.IByThemeWeekplanitemService;
import com.ruoyi.project.common.SchoolCommon;
import com.ruoyi.project.system.service.IByClassService;
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.ByThemeWeekplan;
import com.ruoyi.project.benyi.service.IByThemeWeekplanService;
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-08-26
*/
@RestController
@RequestMapping("/benyi/themeweekplan")
public class ByThemeWeekplanController extends BaseController {
@Autowired
private IByThemeWeekplanService byThemeWeekplanService;
@Autowired
private SchoolCommon schoolCommon;
@Autowired
private IByClassService byClassService;
@Autowired
private IByThemeMonthplanService byThemeMonthplanService;
@Autowired
private IByThemeMonthplanitemService byThemeonthplanitemService;
@Autowired
private IByThemeWeekplanitemService byThemeWeekplanitemService;
/**
* 查询主题整合周计划根据月计划明细列表
*/
@PreAuthorize("@ss.hasPermi('benyi:themeweekplan:list')")
@GetMapping("/list")
public TableDataInfo list(ByThemeWeekplan byThemeWeekplan) {
startPage();
List<ByThemeWeekplan> list = byThemeWeekplanService.selectByThemeWeekplanList(byThemeWeekplan);
return getDataTable(list);
}
/**
* 导出主题整合周计划根据月计划明细列表
*/
@PreAuthorize("@ss.hasPermi('benyi:themeweekplan:export')")
@Log(title = "主题整合周计划(根据月计划明细)", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(ByThemeWeekplan byThemeWeekplan) {
List<ByThemeWeekplan> list = byThemeWeekplanService.selectByThemeWeekplanList(byThemeWeekplan);
ExcelUtil<ByThemeWeekplan> util = new ExcelUtil<ByThemeWeekplan>(ByThemeWeekplan.class);
return util.exportExcel(list, "weekplan");
}
/**
* 获取主题整合周计划根据月计划明细详细信息
*/
@PreAuthorize("@ss.hasPermi('benyi:themeweekplan:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id) {
return AjaxResult.success(byThemeWeekplanService.selectByThemeWeekplanById(id));
}
/**
* 新增主题整合周计划根据月计划明细
*/
@PreAuthorize("@ss.hasPermi('benyi:themeweekplan:add')")
@Log(title = "主题整合周计划(根据月计划明细)", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ByThemeWeekplan byThemeWeekplan) {
String classId = schoolCommon.getClassId();
//首先判断当前账户是否为幼儿园账号
if (schoolCommon.isSchool() && !schoolCommon.isStringEmpty(classId)) {
//判断当前班级是否创建月计划
ByThemeMonthplan byThemeMonthplan = new ByThemeMonthplan();
byThemeMonthplan.setSchoolid(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
byThemeMonthplan.setClassid(classId);
byThemeMonthplan.setXnxq(byThemeWeekplan.getXnxq());
byThemeMonthplan.setMonth(byThemeWeekplan.getMonth());
byThemeMonthplan.setStatus("2");
List<ByThemeMonthplan> list = byThemeMonthplanService.selectByThemeMonthplanList(byThemeMonthplan);
int iCount = 0;
if (list != null && list.size() > 0) {
//循环月计划查找周详情
for (int i = 0; i < list.size(); i++) {
String mpid = list.get(i).getId();
ByThemeMonthplanitem byThemeMonthplanitem = new ByThemeMonthplanitem();
byThemeMonthplanitem.setMpid(mpid);
byThemeMonthplanitem.setZc(byThemeWeekplan.getZc());
List<ByThemeMonthplanitem> listItem = byThemeonthplanitemService.selectByThemeMonthplanitemList(byThemeMonthplanitem);
for (int j = 0; j < listItem.size(); j++) {
iCount = iCount + (j + 1);
}
}
} else {
return AjaxResult.error("当前班级未制定月计划或月计划未审批,无法创建周计划");
}
if (iCount <= 0) {
return AjaxResult.error("当前班级未设置月份明细计划,无法创建周计划");
}
String uuid = schoolCommon.getUuid();
byThemeWeekplan.setId(uuid);
byThemeWeekplan.setName(byClassService.selectByClassById(classId).getBjmc() + "-主题整合周计划" + "(第" + byThemeWeekplan.getZc() + "周)");
byThemeWeekplan.setSchoolid(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
byThemeWeekplan.setClassid(classId);
byThemeWeekplan.setCreateuserid(SecurityUtils.getLoginUser().getUser().getUserId());
if (list != null && list.size() > 0) {
//循环月计划查找周详情
for (int i = 0; i < list.size(); i++) {
String mpid = list.get(i).getId();
ByThemeMonthplanitem byThemeMonthplanitem = new ByThemeMonthplanitem();
byThemeMonthplanitem.setMpid(mpid);
byThemeMonthplanitem.setZc(byThemeWeekplan.getZc());
List<ByThemeMonthplanitem> listItem = byThemeonthplanitemService.selectByThemeMonthplanitemList(byThemeMonthplanitem);
for (int j = 0; j < listItem.size(); j++) {
SimpleDateFormat format = new java.text.SimpleDateFormat("yyyy-MM-dd");
Date dtStart = listItem.get(j).getStarttime();
Date dtEnd = listItem.get(j).getEndtime();
long day = (dtEnd.getTime() - dtStart.getTime()) / (24 * 60 * 60 * 1000) + 1;
System.out.println("day=" + day);
ByThemeWeekplanitem byThemeWeekplanitem = null;
for (int g = 0; g < day; g++) {
byThemeWeekplanitem = new ByThemeWeekplanitem();
byThemeWeekplanitem.setDaytime(schoolCommon.DateAddDays(g, listItem.get(j).getStarttime()));
byThemeWeekplanitem.setZhou(Long.valueOf(schoolCommon.dateToWeek(byThemeWeekplanitem.getDaytime())));
byThemeWeekplanitem.setCreateuserid(SecurityUtils.getLoginUser().getUser().getUserId());
byThemeWeekplanitem.setWpid(uuid);
byThemeWeekplanitemService.insertByThemeWeekplanitem(byThemeWeekplanitem);
}
}
}
}
return toAjax(byThemeWeekplanService.insertByThemeWeekplan(byThemeWeekplan));
} else {
return AjaxResult.error("当前用户非幼儿园教师,无法创建周计划");
}
}
/**
* 修改主题整合周计划根据月计划明细
*/
@PreAuthorize("@ss.hasPermi('benyi:themeweekplan:edit')")
@Log(title = "主题整合周计划(根据月计划明细)", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ByThemeWeekplan byThemeWeekplan) {
return toAjax(byThemeWeekplanService.updateByThemeWeekplan(byThemeWeekplan));
}
/**
* 删除主题整合周计划根据月计划明细
*/
@PreAuthorize("@ss.hasPermi('benyi:themeweekplan:remove')")
@Log(title = "主题整合周计划(根据月计划明细)", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids) {
return toAjax(byThemeWeekplanService.deleteByThemeWeekplanByIds(ids));
}
}

View File

@ -0,0 +1,97 @@
package com.ruoyi.project.benyi.controller;
import java.util.List;
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.ByThemeWeekplanitem;
import com.ruoyi.project.benyi.service.IByThemeWeekplanitemService;
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-08-26
*/
@RestController
@RequestMapping("/benyi/themeweekplanitem")
public class ByThemeWeekplanitemController extends BaseController {
@Autowired
private IByThemeWeekplanitemService byThemeWeekplanitemService;
/**
* 查询主题整合周计划明细列表
*/
@PreAuthorize("@ss.hasPermi('benyi:themeweekplan:list')")
@GetMapping("/list")
public TableDataInfo list(ByThemeWeekplanitem byThemeWeekplanitem) {
startPage();
List<ByThemeWeekplanitem> list = byThemeWeekplanitemService.selectByThemeWeekplanitemList(byThemeWeekplanitem);
return getDataTable(list);
}
/**
* 导出主题整合周计划明细列表
*/
@PreAuthorize("@ss.hasPermi('benyi:themeweekplan:export')")
@Log(title = "主题整合周计划明细", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(ByThemeWeekplanitem byThemeWeekplanitem) {
List<ByThemeWeekplanitem> list = byThemeWeekplanitemService.selectByThemeWeekplanitemList(byThemeWeekplanitem);
ExcelUtil<ByThemeWeekplanitem> util = new ExcelUtil<ByThemeWeekplanitem>(ByThemeWeekplanitem.class);
return util.exportExcel(list, "weekplanitem");
}
/**
* 获取主题整合周计划明细详细信息
*/
@PreAuthorize("@ss.hasPermi('benyi:themeweekplan:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return AjaxResult.success(byThemeWeekplanitemService.selectByThemeWeekplanitemById(id));
}
/**
* 新增主题整合周计划明细
*/
@PreAuthorize("@ss.hasPermi('benyi:themeweekplan:add')")
@Log(title = "主题整合周计划明细", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ByThemeWeekplanitem byThemeWeekplanitem) {
return toAjax(byThemeWeekplanitemService.insertByThemeWeekplanitem(byThemeWeekplanitem));
}
/**
* 修改主题整合周计划明细
*/
@PreAuthorize("@ss.hasPermi('benyi:themeweekplan:edit')")
@Log(title = "主题整合周计划明细", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ByThemeWeekplanitem byThemeWeekplanitem) {
return toAjax(byThemeWeekplanitemService.updateByThemeWeekplanitem(byThemeWeekplanitem));
}
/**
* 删除主题整合周计划明细
*/
@PreAuthorize("@ss.hasPermi('benyi:themeweekplan:remove')")
@Log(title = "主题整合周计划明细", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(byThemeWeekplanitemService.deleteByThemeWeekplanitemByIds(ids));
}
}

View File

@ -0,0 +1,208 @@
package com.ruoyi.project.benyi.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
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_theme_weekplan
*
* @author tsbz
* @date 2020-08-26
*/
public class ByThemeWeekplan extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 编号
*/
private String id;
/**
* 名称
*/
@Excel(name = "名称")
private String name;
/**
* 学校id
*/
@Excel(name = "学校id")
private Long schoolid;
/**
* 班级编号
*/
@Excel(name = "班级编号")
private String classid;
/**
* 所属月份
*/
@JsonFormat(pattern = "yyyy-MM")
@Excel(name = "所属月份", width = 30, dateFormat = "yyyy-MM")
private Date month;
/**
* 所属周
*/
@Excel(name = "所属周")
private Long zc;
/**
* 状态
*/
@Excel(name = "状态")
private String status;
/**
* 审批人
*/
@Excel(name = "审批人")
private Long spr;
/**
* 审批时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "审批时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date sptime;
/**
* 审核意见
*/
@Excel(name = "审核意见")
private String shyj;
/**
* 创建人
*/
@Excel(name = "创建人")
private Long createuserid;
/**
* 学年学期
*/
@Excel(name = "学年学期")
private String xnxq;
public void setId(String id) {
this.id = id;
}
public String getId() {
return id;
}
public void setName(String name) {
this.name = name;
}
public String getName() {
return name;
}
public void setSchoolid(Long schoolid) {
this.schoolid = schoolid;
}
public Long getSchoolid() {
return schoolid;
}
public void setClassid(String classid) {
this.classid = classid;
}
public String getClassid() {
return classid;
}
public void setMonth(Date month) {
this.month = month;
}
public Date getMonth() {
return month;
}
public void setZc(Long zc) {
this.zc = zc;
}
public Long getZc() {
return zc;
}
public void setStatus(String status) {
this.status = status;
}
public String getStatus() {
return status;
}
public void setSpr(Long spr) {
this.spr = spr;
}
public Long getSpr() {
return spr;
}
public void setSptime(Date sptime) {
this.sptime = sptime;
}
public Date getSptime() {
return sptime;
}
public void setShyj(String shyj) {
this.shyj = shyj;
}
public String getShyj() {
return shyj;
}
public void setCreateuserid(Long createuserid) {
this.createuserid = createuserid;
}
public Long getCreateuserid() {
return createuserid;
}
public void setXnxq(String xnxq) {
this.xnxq = xnxq;
}
public String getXnxq() {
return xnxq;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("name", getName())
.append("schoolid", getSchoolid())
.append("classid", getClassid())
.append("month", getMonth())
.append("zc", getZc())
.append("remark", getRemark())
.append("status", getStatus())
.append("spr", getSpr())
.append("sptime", getSptime())
.append("shyj", getShyj())
.append("createuserid", getCreateuserid())
.append("createTime", getCreateTime())
.append("xnxq", getXnxq())
.toString();
}
}

View File

@ -0,0 +1,162 @@
package com.ruoyi.project.benyi.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
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_theme_weekplanitem
*
* @author tsbz
* @date 2020-08-26
*/
public class ByThemeWeekplanitem extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 编号
*/
private Long id;
/**
* 日期
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date daytime;
/**
*
*/
@Excel(name = "")
private Long zhou;
/**
* 活动
*/
@Excel(name = "活动")
private String activityid;
/**
* 分组性质
*/
@Excel(name = "分组性质")
private String fzxz;
/**
* 家长支持
*/
@Excel(name = "家长支持")
private String jzzc;
/**
* 创建人
*/
@Excel(name = "创建人")
private Long createuserid;
/**
* 修改人
*/
@Excel(name = "修改人")
private Long updateuserid;
/**
* 所属周计划
*/
@Excel(name = "所属周计划")
private String wpid;
public void setId(Long id) {
this.id = id;
}
public Long getId() {
return id;
}
public void setDaytime(Date daytime) {
this.daytime = daytime;
}
public Date getDaytime() {
return daytime;
}
public void setZhou(Long zhou) {
this.zhou = zhou;
}
public Long getZhou() {
return zhou;
}
public void setActivityid(String activityid) {
this.activityid = activityid;
}
public String getActivityid() {
return activityid;
}
public void setFzxz(String fzxz) {
this.fzxz = fzxz;
}
public String getFzxz() {
return fzxz;
}
public void setJzzc(String jzzc) {
this.jzzc = jzzc;
}
public String getJzzc() {
return jzzc;
}
public void setCreateuserid(Long createuserid) {
this.createuserid = createuserid;
}
public Long getCreateuserid() {
return createuserid;
}
public void setUpdateuserid(Long updateuserid) {
this.updateuserid = updateuserid;
}
public Long getUpdateuserid() {
return updateuserid;
}
public void setWpid(String wpid) {
this.wpid = wpid;
}
public String getWpid() {
return wpid;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("daytime", getDaytime())
.append("zhou", getZhou())
.append("activityid", getActivityid())
.append("fzxz", getFzxz())
.append("jzzc", getJzzc())
.append("createuserid", getCreateuserid())
.append("createTime", getCreateTime())
.append("updateuserid", getUpdateuserid())
.append("updateTime", getUpdateTime())
.append("wpid", getWpid())
.toString();
}
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.project.benyi.mapper;
import java.util.List;
import com.ruoyi.project.benyi.domain.ByThemeWeekplan;
/**
* 主题整合周计划根据月计划明细Mapper接口
*
* @author tsbz
* @date 2020-08-26
*/
public interface ByThemeWeekplanMapper {
/**
* 查询主题整合周计划根据月计划明细
*
* @param id 主题整合周计划根据月计划明细ID
* @return 主题整合周计划根据月计划明细
*/
public ByThemeWeekplan selectByThemeWeekplanById(String id);
/**
* 查询主题整合周计划根据月计划明细列表
*
* @param byThemeWeekplan 主题整合周计划根据月计划明细
* @return 主题整合周计划根据月计划明细集合
*/
public List<ByThemeWeekplan> selectByThemeWeekplanList(ByThemeWeekplan byThemeWeekplan);
/**
* 新增主题整合周计划根据月计划明细
*
* @param byThemeWeekplan 主题整合周计划根据月计划明细
* @return 结果
*/
public int insertByThemeWeekplan(ByThemeWeekplan byThemeWeekplan);
/**
* 修改主题整合周计划根据月计划明细
*
* @param byThemeWeekplan 主题整合周计划根据月计划明细
* @return 结果
*/
public int updateByThemeWeekplan(ByThemeWeekplan byThemeWeekplan);
/**
* 删除主题整合周计划根据月计划明细
*
* @param id 主题整合周计划根据月计划明细ID
* @return 结果
*/
public int deleteByThemeWeekplanById(String id);
/**
* 批量删除主题整合周计划根据月计划明细
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteByThemeWeekplanByIds(String[] ids);
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.project.benyi.mapper;
import java.util.List;
import com.ruoyi.project.benyi.domain.ByThemeWeekplanitem;
/**
* 主题整合周计划明细Mapper接口
*
* @author tsbz
* @date 2020-08-26
*/
public interface ByThemeWeekplanitemMapper {
/**
* 查询主题整合周计划明细
*
* @param id 主题整合周计划明细ID
* @return 主题整合周计划明细
*/
public ByThemeWeekplanitem selectByThemeWeekplanitemById(Long id);
/**
* 查询主题整合周计划明细列表
*
* @param byThemeWeekplanitem 主题整合周计划明细
* @return 主题整合周计划明细集合
*/
public List<ByThemeWeekplanitem> selectByThemeWeekplanitemList(ByThemeWeekplanitem byThemeWeekplanitem);
/**
* 新增主题整合周计划明细
*
* @param byThemeWeekplanitem 主题整合周计划明细
* @return 结果
*/
public int insertByThemeWeekplanitem(ByThemeWeekplanitem byThemeWeekplanitem);
/**
* 修改主题整合周计划明细
*
* @param byThemeWeekplanitem 主题整合周计划明细
* @return 结果
*/
public int updateByThemeWeekplanitem(ByThemeWeekplanitem byThemeWeekplanitem);
/**
* 删除主题整合周计划明细
*
* @param id 主题整合周计划明细ID
* @return 结果
*/
public int deleteByThemeWeekplanitemById(Long id);
/**
* 批量删除主题整合周计划明细
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteByThemeWeekplanitemByIds(Long[] ids);
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.project.benyi.service;
import java.util.List;
import com.ruoyi.project.benyi.domain.ByThemeWeekplan;
/**
* 主题整合周计划根据月计划明细Service接口
*
* @author tsbz
* @date 2020-08-26
*/
public interface IByThemeWeekplanService {
/**
* 查询主题整合周计划根据月计划明细
*
* @param id 主题整合周计划根据月计划明细ID
* @return 主题整合周计划根据月计划明细
*/
public ByThemeWeekplan selectByThemeWeekplanById(String id);
/**
* 查询主题整合周计划根据月计划明细列表
*
* @param byThemeWeekplan 主题整合周计划根据月计划明细
* @return 主题整合周计划根据月计划明细集合
*/
public List<ByThemeWeekplan> selectByThemeWeekplanList(ByThemeWeekplan byThemeWeekplan);
/**
* 新增主题整合周计划根据月计划明细
*
* @param byThemeWeekplan 主题整合周计划根据月计划明细
* @return 结果
*/
public int insertByThemeWeekplan(ByThemeWeekplan byThemeWeekplan);
/**
* 修改主题整合周计划根据月计划明细
*
* @param byThemeWeekplan 主题整合周计划根据月计划明细
* @return 结果
*/
public int updateByThemeWeekplan(ByThemeWeekplan byThemeWeekplan);
/**
* 批量删除主题整合周计划根据月计划明细
*
* @param ids 需要删除的主题整合周计划根据月计划明细ID
* @return 结果
*/
public int deleteByThemeWeekplanByIds(String[] ids);
/**
* 删除主题整合周计划根据月计划明细信息
*
* @param id 主题整合周计划根据月计划明细ID
* @return 结果
*/
public int deleteByThemeWeekplanById(String id);
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.project.benyi.service;
import java.util.List;
import com.ruoyi.project.benyi.domain.ByThemeWeekplanitem;
/**
* 主题整合周计划明细Service接口
*
* @author tsbz
* @date 2020-08-26
*/
public interface IByThemeWeekplanitemService {
/**
* 查询主题整合周计划明细
*
* @param id 主题整合周计划明细ID
* @return 主题整合周计划明细
*/
public ByThemeWeekplanitem selectByThemeWeekplanitemById(Long id);
/**
* 查询主题整合周计划明细列表
*
* @param byThemeWeekplanitem 主题整合周计划明细
* @return 主题整合周计划明细集合
*/
public List<ByThemeWeekplanitem> selectByThemeWeekplanitemList(ByThemeWeekplanitem byThemeWeekplanitem);
/**
* 新增主题整合周计划明细
*
* @param byThemeWeekplanitem 主题整合周计划明细
* @return 结果
*/
public int insertByThemeWeekplanitem(ByThemeWeekplanitem byThemeWeekplanitem);
/**
* 修改主题整合周计划明细
*
* @param byThemeWeekplanitem 主题整合周计划明细
* @return 结果
*/
public int updateByThemeWeekplanitem(ByThemeWeekplanitem byThemeWeekplanitem);
/**
* 批量删除主题整合周计划明细
*
* @param ids 需要删除的主题整合周计划明细ID
* @return 结果
*/
public int deleteByThemeWeekplanitemByIds(Long[] ids);
/**
* 删除主题整合周计划明细信息
*
* @param id 主题整合周计划明细ID
* @return 结果
*/
public int deleteByThemeWeekplanitemById(Long id);
}

View File

@ -0,0 +1,89 @@
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.ByThemeWeekplanMapper;
import com.ruoyi.project.benyi.domain.ByThemeWeekplan;
import com.ruoyi.project.benyi.service.IByThemeWeekplanService;
/**
* 主题整合周计划根据月计划明细Service业务层处理
*
* @author tsbz
* @date 2020-08-26
*/
@Service
public class ByThemeWeekplanServiceImpl implements IByThemeWeekplanService {
@Autowired
private ByThemeWeekplanMapper byThemeWeekplanMapper;
/**
* 查询主题整合周计划根据月计划明细
*
* @param id 主题整合周计划根据月计划明细ID
* @return 主题整合周计划根据月计划明细
*/
@Override
public ByThemeWeekplan selectByThemeWeekplanById(String id) {
return byThemeWeekplanMapper.selectByThemeWeekplanById(id);
}
/**
* 查询主题整合周计划根据月计划明细列表
*
* @param byThemeWeekplan 主题整合周计划根据月计划明细
* @return 主题整合周计划根据月计划明细
*/
@Override
public List<ByThemeWeekplan> selectByThemeWeekplanList(ByThemeWeekplan byThemeWeekplan) {
return byThemeWeekplanMapper.selectByThemeWeekplanList(byThemeWeekplan);
}
/**
* 新增主题整合周计划根据月计划明细
*
* @param byThemeWeekplan 主题整合周计划根据月计划明细
* @return 结果
*/
@Override
public int insertByThemeWeekplan(ByThemeWeekplan byThemeWeekplan) {
byThemeWeekplan.setCreateTime(DateUtils.getNowDate());
return byThemeWeekplanMapper.insertByThemeWeekplan(byThemeWeekplan);
}
/**
* 修改主题整合周计划根据月计划明细
*
* @param byThemeWeekplan 主题整合周计划根据月计划明细
* @return 结果
*/
@Override
public int updateByThemeWeekplan(ByThemeWeekplan byThemeWeekplan) {
return byThemeWeekplanMapper.updateByThemeWeekplan(byThemeWeekplan);
}
/**
* 批量删除主题整合周计划根据月计划明细
*
* @param ids 需要删除的主题整合周计划根据月计划明细ID
* @return 结果
*/
@Override
public int deleteByThemeWeekplanByIds(String[] ids) {
return byThemeWeekplanMapper.deleteByThemeWeekplanByIds(ids);
}
/**
* 删除主题整合周计划根据月计划明细信息
*
* @param id 主题整合周计划根据月计划明细ID
* @return 结果
*/
@Override
public int deleteByThemeWeekplanById(String id) {
return byThemeWeekplanMapper.deleteByThemeWeekplanById(id);
}
}

View File

@ -0,0 +1,90 @@
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.ByThemeWeekplanitemMapper;
import com.ruoyi.project.benyi.domain.ByThemeWeekplanitem;
import com.ruoyi.project.benyi.service.IByThemeWeekplanitemService;
/**
* 主题整合周计划明细Service业务层处理
*
* @author tsbz
* @date 2020-08-26
*/
@Service
public class ByThemeWeekplanitemServiceImpl implements IByThemeWeekplanitemService {
@Autowired
private ByThemeWeekplanitemMapper byThemeWeekplanitemMapper;
/**
* 查询主题整合周计划明细
*
* @param id 主题整合周计划明细ID
* @return 主题整合周计划明细
*/
@Override
public ByThemeWeekplanitem selectByThemeWeekplanitemById(Long id) {
return byThemeWeekplanitemMapper.selectByThemeWeekplanitemById(id);
}
/**
* 查询主题整合周计划明细列表
*
* @param byThemeWeekplanitem 主题整合周计划明细
* @return 主题整合周计划明细
*/
@Override
public List<ByThemeWeekplanitem> selectByThemeWeekplanitemList(ByThemeWeekplanitem byThemeWeekplanitem) {
return byThemeWeekplanitemMapper.selectByThemeWeekplanitemList(byThemeWeekplanitem);
}
/**
* 新增主题整合周计划明细
*
* @param byThemeWeekplanitem 主题整合周计划明细
* @return 结果
*/
@Override
public int insertByThemeWeekplanitem(ByThemeWeekplanitem byThemeWeekplanitem) {
byThemeWeekplanitem.setCreateTime(DateUtils.getNowDate());
return byThemeWeekplanitemMapper.insertByThemeWeekplanitem(byThemeWeekplanitem);
}
/**
* 修改主题整合周计划明细
*
* @param byThemeWeekplanitem 主题整合周计划明细
* @return 结果
*/
@Override
public int updateByThemeWeekplanitem(ByThemeWeekplanitem byThemeWeekplanitem) {
byThemeWeekplanitem.setUpdateTime(DateUtils.getNowDate());
return byThemeWeekplanitemMapper.updateByThemeWeekplanitem(byThemeWeekplanitem);
}
/**
* 批量删除主题整合周计划明细
*
* @param ids 需要删除的主题整合周计划明细ID
* @return 结果
*/
@Override
public int deleteByThemeWeekplanitemByIds(Long[] ids) {
return byThemeWeekplanitemMapper.deleteByThemeWeekplanitemByIds(ids);
}
/**
* 删除主题整合周计划明细信息
*
* @param id 主题整合周计划明细ID
* @return 结果
*/
@Override
public int deleteByThemeWeekplanitemById(Long id) {
return byThemeWeekplanitemMapper.deleteByThemeWeekplanitemById(id);
}
}

View File

@ -187,4 +187,41 @@ public class SchoolCommon {
int month = (end.get(Calendar.YEAR) - start.get(Calendar.YEAR)) * 12;
return Math.abs(month + result);
}
//日期加天数
public Date DateAddDays(int iday, Date dt) {
//天数加1
Calendar calendar = Calendar.getInstance();
calendar.setTime(dt);
calendar.add(Calendar.DAY_OF_MONTH, iday);
return calendar.getTime();
}
//月份加数
public Date DateAddMonths(int iday, Date dt) {
//天数加1
Calendar calendar = Calendar.getInstance();
calendar.setTime(dt);
calendar.add(Calendar.MONTH, iday);
return calendar.getTime();
}
/**
* 日期转星期
*
* @param datetime
* @return
*/
public int dateToWeek(Date datetime) {
int[] weekDays = {7, 1, 2, 3, 4, 5, 6};
Calendar cal = Calendar.getInstance(); // 获得一个日历
cal.setTime(datetime);
int w = cal.get(Calendar.DAY_OF_WEEK) - 1; // 指示一个星期中的某天
if (w < 0)
w = 0;
return weekDays[w];
}
}

View File

@ -0,0 +1,117 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.benyi.mapper.ByThemeWeekplanMapper">
<resultMap type="ByThemeWeekplan" id="ByThemeWeekplanResult">
<result property="id" column="id"/>
<result property="name" column="name"/>
<result property="schoolid" column="schoolid"/>
<result property="classid" column="classid"/>
<result property="month" column="month"/>
<result property="zc" column="zc"/>
<result property="remark" column="remark"/>
<result property="status" column="status"/>
<result property="spr" column="spr"/>
<result property="sptime" column="sptime"/>
<result property="shyj" column="shyj"/>
<result property="createuserid" column="createuserid"/>
<result property="createTime" column="create_time"/>
<result property="xnxq" column="xnxq"/>
</resultMap>
<sql id="selectByThemeWeekplanVo">
select id, name, schoolid, classid, month, zc, remark, status, spr, sptime, shyj, createuserid, create_time, xnxq from by_theme_weekplan
</sql>
<select id="selectByThemeWeekplanList" parameterType="ByThemeWeekplan" resultMap="ByThemeWeekplanResult">
<include refid="selectByThemeWeekplanVo"/>
<where>
<if test="name != null and name != ''">and name like concat('%', #{name}, '%')</if>
<if test="schoolid != null ">and schoolid = #{schoolid}</if>
<if test="classid != null and classid != ''">and classid = #{classid}</if>
<if test="month != null ">and month = #{month}</if>
<if test="zc != null ">and zc = #{zc}</if>
<if test="status != null and status != ''">and status = #{status}</if>
<if test="spr != null ">and spr = #{spr}</if>
<if test="sptime != null ">and sptime = #{sptime}</if>
<if test="shyj != null and shyj != ''">and shyj = #{shyj}</if>
<if test="createuserid != null ">and createuserid = #{createuserid}</if>
<if test="xnxq != null and xnxq != ''">and xnxq = #{xnxq}</if>
</where>
</select>
<select id="selectByThemeWeekplanById" parameterType="String" resultMap="ByThemeWeekplanResult">
<include refid="selectByThemeWeekplanVo"/>
where id = #{id}
</select>
<insert id="insertByThemeWeekplan" parameterType="ByThemeWeekplan">
insert into by_theme_weekplan
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null and id != ''">id,</if>
<if test="name != null and name != ''">name,</if>
<if test="schoolid != null ">schoolid,</if>
<if test="classid != null and classid != ''">classid,</if>
<if test="month != null ">month,</if>
<if test="zc != null ">zc,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="status != null and status != ''">status,</if>
<if test="spr != null ">spr,</if>
<if test="sptime != null ">sptime,</if>
<if test="shyj != null and shyj != ''">shyj,</if>
<if test="createuserid != null ">createuserid,</if>
<if test="createTime != null ">create_time,</if>
<if test="xnxq != null and xnxq != ''">xnxq,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null and id != ''">#{id},</if>
<if test="name != null and name != ''">#{name},</if>
<if test="schoolid != null ">#{schoolid},</if>
<if test="classid != null and classid != ''">#{classid},</if>
<if test="month != null ">#{month},</if>
<if test="zc != null ">#{zc},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="status != null and status != ''">#{status},</if>
<if test="spr != null ">#{spr},</if>
<if test="sptime != null ">#{sptime},</if>
<if test="shyj != null and shyj != ''">#{shyj},</if>
<if test="createuserid != null ">#{createuserid},</if>
<if test="createTime != null ">#{createTime},</if>
<if test="xnxq != null and xnxq != ''">#{xnxq},</if>
</trim>
</insert>
<update id="updateByThemeWeekplan" parameterType="ByThemeWeekplan">
update by_theme_weekplan
<trim prefix="SET" suffixOverrides=",">
<if test="name != null and name != ''">name = #{name},</if>
<if test="schoolid != null ">schoolid = #{schoolid},</if>
<if test="classid != null and classid != ''">classid = #{classid},</if>
<if test="month != null ">month = #{month},</if>
<if test="zc != null ">zc = #{zc},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="spr != null ">spr = #{spr},</if>
<if test="sptime != null ">sptime = #{sptime},</if>
<if test="shyj != null and shyj != ''">shyj = #{shyj},</if>
<if test="createuserid != null ">createuserid = #{createuserid},</if>
<if test="createTime != null ">create_time = #{createTime},</if>
<if test="xnxq != null and xnxq != ''">xnxq = #{xnxq},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteByThemeWeekplanById" parameterType="String">
delete from by_theme_weekplan where id = #{id}
</delete>
<delete id="deleteByThemeWeekplanByIds" parameterType="String">
delete from by_theme_weekplan where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,101 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.benyi.mapper.ByThemeWeekplanitemMapper">
<resultMap type="ByThemeWeekplanitem" id="ByThemeWeekplanitemResult">
<result property="id" column="id"/>
<result property="daytime" column="daytime"/>
<result property="zhou" column="zhou"/>
<result property="activityid" column="activityid"/>
<result property="fzxz" column="fzxz"/>
<result property="jzzc" column="jzzc"/>
<result property="createuserid" column="createuserid"/>
<result property="createTime" column="create_time"/>
<result property="updateuserid" column="updateuserid"/>
<result property="updateTime" column="update_time"/>
<result property="wpid" column="wpid"/>
</resultMap>
<sql id="selectByThemeWeekplanitemVo">
select id, daytime, zhou, activityid, fzxz, jzzc, createuserid, create_time, updateuserid, update_time, wpid from by_theme_weekplanitem
</sql>
<select id="selectByThemeWeekplanitemList" parameterType="ByThemeWeekplanitem"
resultMap="ByThemeWeekplanitemResult">
<include refid="selectByThemeWeekplanitemVo"/>
<where>
<if test="daytime != null ">and daytime = #{daytime}</if>
<if test="zhou != null ">and zhou = #{zhou}</if>
<if test="activityid != null and activityid != ''">and activityid = #{activityid}</if>
<if test="fzxz != null and fzxz != ''">and fzxz = #{fzxz}</if>
<if test="jzzc != null and jzzc != ''">and jzzc = #{jzzc}</if>
<if test="createuserid != null ">and createuserid = #{createuserid}</if>
<if test="updateuserid != null ">and updateuserid = #{updateuserid}</if>
<if test="wpid != null and wpid != ''">and wpid = #{wpid}</if>
</where>
</select>
<select id="selectByThemeWeekplanitemById" parameterType="Long" resultMap="ByThemeWeekplanitemResult">
<include refid="selectByThemeWeekplanitemVo"/>
where id = #{id}
</select>
<insert id="insertByThemeWeekplanitem" parameterType="ByThemeWeekplanitem" useGeneratedKeys="true" keyProperty="id">
insert into by_theme_weekplanitem
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="daytime != null ">daytime,</if>
<if test="zhou != null ">zhou,</if>
<if test="activityid != null and activityid != ''">activityid,</if>
<if test="fzxz != null and fzxz != ''">fzxz,</if>
<if test="jzzc != null and jzzc != ''">jzzc,</if>
<if test="createuserid != null ">createuserid,</if>
<if test="createTime != null ">create_time,</if>
<if test="updateuserid != null ">updateuserid,</if>
<if test="updateTime != null ">update_time,</if>
<if test="wpid != null and wpid != ''">wpid,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="daytime != null ">#{daytime},</if>
<if test="zhou != null ">#{zhou},</if>
<if test="activityid != null and activityid != ''">#{activityid},</if>
<if test="fzxz != null and fzxz != ''">#{fzxz},</if>
<if test="jzzc != null and jzzc != ''">#{jzzc},</if>
<if test="createuserid != null ">#{createuserid},</if>
<if test="createTime != null ">#{createTime},</if>
<if test="updateuserid != null ">#{updateuserid},</if>
<if test="updateTime != null ">#{updateTime},</if>
<if test="wpid != null and wpid != ''">#{wpid},</if>
</trim>
</insert>
<update id="updateByThemeWeekplanitem" parameterType="ByThemeWeekplanitem">
update by_theme_weekplanitem
<trim prefix="SET" suffixOverrides=",">
<if test="daytime != null ">daytime = #{daytime},</if>
<if test="zhou != null ">zhou = #{zhou},</if>
<if test="activityid != null and activityid != ''">activityid = #{activityid},</if>
<if test="fzxz != null and fzxz != ''">fzxz = #{fzxz},</if>
<if test="jzzc != null and jzzc != ''">jzzc = #{jzzc},</if>
<if test="createuserid != null ">createuserid = #{createuserid},</if>
<if test="createTime != null ">create_time = #{createTime},</if>
<if test="updateuserid != null ">updateuserid = #{updateuserid},</if>
<if test="updateTime != null ">update_time = #{updateTime},</if>
<if test="wpid != null and wpid != ''">wpid = #{wpid},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteByThemeWeekplanitemById" parameterType="Long">
delete from by_theme_weekplanitem where id = #{id}
</delete>
<delete id="deleteByThemeWeekplanitemByIds" parameterType="String">
delete from by_theme_weekplanitem where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>