diff --git a/ruoyi-ui/src/api/benyi/thememonthplan.js b/ruoyi-ui/src/api/benyi/thememonthplan.js index f6283aa4f..784e0d05b 100644 --- a/ruoyi-ui/src/api/benyi/thememonthplan.js +++ b/ruoyi-ui/src/api/benyi/thememonthplan.js @@ -43,6 +43,14 @@ export function delMonthplan(id) { }) } +// 提交主题整合学期计划 +export function checkMonthplan(id) { + return request({ + url: '/benyi/thememonthplan/check/' + id, + method: 'post' + }) +} + // 导出主题整合月计划 export function exportMonthplan(query) { return request({ diff --git a/ruoyi-ui/src/api/benyi/themeweekplan.js b/ruoyi-ui/src/api/benyi/thememonthplanitem.js similarity index 76% rename from ruoyi-ui/src/api/benyi/themeweekplan.js rename to ruoyi-ui/src/api/benyi/thememonthplanitem.js index 3838723a4..c7f444402 100644 --- a/ruoyi-ui/src/api/benyi/themeweekplan.js +++ b/ruoyi-ui/src/api/benyi/thememonthplanitem.js @@ -3,7 +3,7 @@ import request from '@/utils/request' // 查询主题整合周计划列表 export function listWeekplan(query) { return request({ - url: '/benyi/themeweekplan/list', + url: '/benyi/thememonthplanitem/list', method: 'get', params: query }) @@ -12,7 +12,7 @@ export function listWeekplan(query) { // 查询主题整合周计划详细 export function getWeekplan(id) { return request({ - url: '/benyi/themeweekplan/' + id, + url: '/benyi/thememonthplanitem/' + id, method: 'get' }) } @@ -20,7 +20,7 @@ export function getWeekplan(id) { // 新增主题整合周计划 export function addWeekplan(data) { return request({ - url: '/benyi/themeweekplan', + url: '/benyi/thememonthplanitem', method: 'post', data: data }) @@ -29,7 +29,7 @@ export function addWeekplan(data) { // 修改主题整合周计划 export function updateWeekplan(data) { return request({ - url: '/benyi/themeweekplan', + url: '/benyi/thememonthplanitem', method: 'put', data: data }) @@ -38,7 +38,7 @@ export function updateWeekplan(data) { // 删除主题整合周计划 export function delWeekplan(id) { return request({ - url: '/benyi/themeweekplan/' + id, + url: '/benyi/thememonthplanitem/' + id, method: 'delete' }) } @@ -46,7 +46,7 @@ export function delWeekplan(id) { // 导出主题整合周计划 export function exportWeekplan(query) { return request({ - url: '/benyi/themeweekplan/export', + url: '/benyi/thememonthplanitem/export', method: 'get', params: query }) diff --git a/ruoyi-ui/src/views/benyi/child/index.vue b/ruoyi-ui/src/views/benyi/child/index.vue index c28ab7028..0d5532d23 100644 --- a/ruoyi-ui/src/views/benyi/child/index.vue +++ b/ruoyi-ui/src/views/benyi/child/index.vue @@ -350,7 +350,7 @@ import { delChild, addChild, updateChild, - updateChild_tb + updateChild_tb, } from "@/api/benyi/child"; import { listClass } from "@/api/system/class"; @@ -365,22 +365,22 @@ export default { placeholders: { province: "请选择省", city: "请选择市", - area: "请选择区" + area: "请选择区", }, diglogForm: { province: null, city: null, - area: null + area: null, }, diglogForm1: { province: null, city: null, - area: null + area: null, }, diglogForm2: { province: null, city: null, - area: null + area: null, }, // 遮罩层 loading: true, @@ -455,46 +455,47 @@ export default { firstLanguage: undefined, seconderLanguage: undefined, otherLanguage: undefined, - createuserid: undefined + createuserid: undefined, }, // 表单参数 form: {}, // 表单校验 rules: { name: [ - { required: true, message: "幼儿姓名不能为空", trigger: "blur" } + { required: true, message: "幼儿姓名不能为空", trigger: "blur" }, ], phone: [ - { required: true, message: "家长手机号码不能为空", trigger: "blur" } - ] + { required: true, message: "家长手机号码不能为空", trigger: "blur" }, + ], + classid: [{ required: true, message: "班级不能为空", trigger: "blur" }], }, rules_tb: { - classid: [{ required: true, message: "班级不能为空", trigger: "blur" }] - } + classid: [{ required: true, message: "班级不能为空", trigger: "blur" }], + }, }; }, created() { this.getList(); this.getClassList(); - this.getDicts("sys_user_sex").then(response => { + this.getDicts("sys_user_sex").then((response) => { this.sexOptions = response.data; }); - this.getDicts("sys_normal_disable").then(response => { + this.getDicts("sys_normal_disable").then((response) => { this.statusOptions = response.data; }); - this.getDicts("sys_dm_mz").then(response => { + this.getDicts("sys_dm_mz").then((response) => { this.mzOptions = response.data; }); - this.getDicts("sys_yes_no").then(response => { + this.getDicts("sys_yes_no").then((response) => { this.ynOptions = response.data; }); - this.getDicts("sys_dm_ryqd").then(response => { + this.getDicts("sys_dm_ryqd").then((response) => { this.sourceOptions = response.data; }); }, components: { //省市区三级联动全局组件 - VDistpicker + VDistpicker, }, methods: { // 性别字典翻译 @@ -522,7 +523,7 @@ export default { // return this.selectDictLabel(this.classOptions, row.classid); var actions = []; var datas = this.classOptions; - Object.keys(datas).map(key => { + Object.keys(datas).map((key) => { if (datas[key].bjbh == "" + row.classid) { actions.push(datas[key].bjmc); return false; @@ -531,14 +532,14 @@ export default { return actions.join(""); }, getClassList() { - listClass(null).then(response => { + listClass(null).then((response) => { this.classOptions = response.rows; }); }, /** 查询幼儿信息列表 */ getList() { this.loading = true; - listChild(this.queryParams).then(response => { + listChild(this.queryParams).then((response) => { this.childList = response.rows; this.total = response.total; this.loading = false; @@ -597,7 +598,7 @@ export default { seconderLanguage: undefined, otherLanguage: undefined, createuserid: undefined, - createTime: undefined + createTime: undefined, }; this.diglogForm.province = ""; @@ -626,7 +627,7 @@ export default { }, // 多选框选中数据 handleSelectionChange(selection) { - this.ids = selection.map(item => item.id); + this.ids = selection.map((item) => item.id); this.single = selection.length != 1; this.multiple = !selection.length; }, @@ -640,7 +641,7 @@ export default { handleUpdate(row) { this.reset(); const id = row.id || this.ids; - getChild(id).then(response => { + getChild(id).then((response) => { this.form = response.data; this.diglogForm.province = response.data.birthProvincename; @@ -660,11 +661,11 @@ export default { }); }, /** 提交按钮 */ - submitForm: function() { - this.$refs["form"].validate(valid => { + submitForm: function () { + this.$refs["form"].validate((valid) => { if (valid) { if (this.form.id != undefined) { - updateChild(this.form).then(response => { + updateChild(this.form).then((response) => { if (response.code === 200) { this.msgSuccess("修改成功"); this.open = false; @@ -672,7 +673,7 @@ export default { } }); } else { - addChild(this.form).then(response => { + addChild(this.form).then((response) => { if (response.code === 200) { this.msgSuccess("新增成功"); this.open = false; @@ -684,11 +685,11 @@ export default { }); }, /** 提交按钮 */ - submitForm_tb: function() { - this.$refs["form"].validate(valid => { + submitForm_tb: function () { + this.$refs["form"].validate((valid) => { if (valid) { console.log(this.ids + "---" + this.form.classid); - updateChild_tb(this.form, this.ids).then(response => { + updateChild_tb(this.form, this.ids).then((response) => { if (response.code === 200) { this.msgSuccess("调班成功"); this.open_tb = false; @@ -714,17 +715,17 @@ export default { { confirmButtonText: "确定", cancelButtonText: "取消", - type: "warning" + type: "warning", } ) - .then(function() { + .then(function () { return delChild(ids); }) .then(() => { this.getList(); this.msgSuccess("删除成功"); }) - .catch(function() {}); + .catch(function () {}); }, //所在省市区触发联动方法 onSelected_brith(data) { @@ -779,7 +780,7 @@ export default { this.form.addrAreaname = data.area.value; this.form.addrArea = data.area.code; } - } - } + }, + }, }; \ No newline at end of file diff --git a/ruoyi-ui/src/views/benyi/thememonthplan/data.vue b/ruoyi-ui/src/views/benyi/thememonthplan/data.vue index e56c78f32..6aad5c0a8 100644 --- a/ruoyi-ui/src/views/benyi/thememonthplan/data.vue +++ b/ruoyi-ui/src/views/benyi/thememonthplan/data.vue @@ -12,9 +12,9 @@ - 新增 @@ -44,6 +45,7 @@ :disabled="single" @click="handleUpdate" v-hasPermi="['benyi:thememonthplan:edit']" + v-show="isShow" >修改 @@ -54,6 +56,7 @@ :disabled="multiple" @click="handleDelete" v-hasPermi="['benyi:thememonthplan:remove']" + v-show="isShow" >删除 @@ -61,7 +64,7 @@ - + - + @@ -174,7 +184,7 @@ import { delWeekplan, addWeekplan, updateWeekplan, -} from "@/api/benyi/themeweekplan"; +} from "@/api/benyi/thememonthplanitem"; import { listMonthplan, getMonthplan } from "@/api/benyi/thememonthplan"; import { listActivityByThemeId } from "@/api/benyi/activity"; @@ -182,6 +192,7 @@ export default { name: "Weekplan", data() { return { + isShow: true, // 遮罩层 loading: true, // 选中数组 @@ -196,8 +207,11 @@ export default { weekplanList: [], //主题整合月计划列表 themeMonthPlanOptions: [], + //id默认值 defaultThemeMonthType: "", + //选中的chebox值 themeactivityList: [], + //获取的活动列表 themeactivityOptions: [], max: 5, // 弹出层标题 @@ -239,6 +253,25 @@ export default { this.getThemeMonthPlanList(); }, methods: { + // 主题--字典状态字典翻译 + themeactivityFormat(row, column) { + if (row.activityid != null) { + var ilength = row.activityid.split(";").length - 1; + var names = ""; + for (var i = 1; i < ilength; i++) { + names = + names + + this.selectMoeDictLabel( + this.themeactivityOptions, + row.activityid.split(";")[i] + ) + + ";"; + } + //this.selectDictLabel(this.scopeOptions, row.xnxq); + return names; + } + return ""; + }, //获取选中的checkbox getThemeActivityIdValue() { //console.log(this.themeList); @@ -257,7 +290,7 @@ export default { this.themeactivityOptions = response.rows; }); }, - // 字典翻译 + // 字典翻译 themeMonthPlanFormat(row, column) { // return this.selectDictLabel(this.classOptions, row.classid); var actions = []; @@ -287,6 +320,12 @@ export default { }); this.getThemeActivityList(array); + if (response.data.status == "0") { + this.isShow = true; + } else { + this.isShow = false; + } + this.getList(); }); }, @@ -323,6 +362,7 @@ export default { createTime: undefined, }; this.resetForm("form"); + this.themeactivityList = []; }, /** 搜索按钮操作 */ handleQuery() { @@ -355,7 +395,17 @@ export default { getWeekplan(id).then((response) => { this.form = response.data; this.open = true; - this.title = "修改主题整合周计划"; + this.title = "修改主题整合周计划明细"; + var activityid = response.data.activityid.split(";"); + var array = []; + //console.log(arr); + activityid.forEach(function (value, key, arr) { + //console.log(value); // 结果依次为1,2,3 + if (value != "") { + array.push(parseInt(value)); + } + }); + this.themeactivityList = array; }); }, /** 提交按钮 */ diff --git a/ruoyi-ui/src/views/benyi/thememonthplan/index.vue b/ruoyi-ui/src/views/benyi/thememonthplan/index.vue index df76de8af..7801ea818 100644 --- a/ruoyi-ui/src/views/benyi/thememonthplan/index.vue +++ b/ruoyi-ui/src/views/benyi/thememonthplan/index.vue @@ -90,8 +90,8 @@ - - + + + --> @@ -188,6 +198,7 @@ import { delMonthplan, addMonthplan, updateMonthplan, + checkMonthplan } from "@/api/benyi/thememonthplan"; import Editor from "@/components/Editor"; import { listClass } from "@/api/system/class"; @@ -269,6 +280,13 @@ export default { }); }, methods: { + isShow(row) { + if (row.status == "0") { + return true; + } else { + return false; + } + }, // 当前状态类型--字典状态字典翻译 statusFormat(row, column) { return this.selectDictLabel(this.statusOptions, row.status); @@ -419,7 +437,7 @@ export default { handleDelete(row) { const ids = row.id || this.ids; this.$confirm( - '是否确认删除主题整合月计划编号为"' + ids + '"的数据项?', + '是否确认删除主题整合月计划数据项?', "警告", { confirmButtonText: "确定", @@ -436,6 +454,27 @@ export default { }) .catch(function () {}); }, + /** 提交按钮操作 */ + handleCheck(row) { + const id = row.id; + this.$confirm( + "是否确认提交主题整合月计划?提交后数据将不能维护", + "警告", + { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + } + ) + .then(function () { + return checkMonthplan(id); + }) + .then(() => { + this.getList(); + this.msgSuccess("提交成功"); + }) + .catch(function () {}); + }, }, }; \ No newline at end of file diff --git a/ruoyi-ui/src/views/benyi/themetermplan/index.vue b/ruoyi-ui/src/views/benyi/themetermplan/index.vue index c1640697b..0a33dd053 100644 --- a/ruoyi-ui/src/views/benyi/themetermplan/index.vue +++ b/ruoyi-ui/src/views/benyi/themetermplan/index.vue @@ -376,7 +376,7 @@ export default { handleDelete(row) { const ids = row.id || this.ids; this.$confirm( - '是否确认删除主题整合学期计划编号为"' + ids + '"的数据项?', + '是否确认删除主题整合学期计划数据项?', "警告", { confirmButtonText: "确定", diff --git a/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByThemeMonthplanController.java b/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByThemeMonthplanController.java index 0e9ea069f..855d634a0 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByThemeMonthplanController.java +++ b/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByThemeMonthplanController.java @@ -1,15 +1,15 @@ package com.ruoyi.project.benyi.controller; -import java.text.ParseException; import java.text.SimpleDateFormat; -import java.util.Date; import java.util.List; import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.project.benyi.domain.ByThemeTermplan; import com.ruoyi.project.benyi.domain.ByThemeTermplanitem; +import com.ruoyi.project.benyi.domain.ByThemeMonthplanitem; import com.ruoyi.project.benyi.service.IByThemeTermplanService; import com.ruoyi.project.benyi.service.IByThemeTermplanitemService; +import com.ruoyi.project.benyi.service.IByThemeMonthplanitemService; import com.ruoyi.project.common.SchoolCommon; import com.ruoyi.project.system.service.IByClassService; import org.springframework.security.access.prepost.PreAuthorize; @@ -50,6 +50,8 @@ public class ByThemeMonthplanController extends BaseController { private IByThemeTermplanService byThemeTermplanService; @Autowired private IByThemeTermplanitemService byThemeTermplanitemService; + @Autowired + private IByThemeMonthplanitemService byThemeWeekplanService; /** * 查询主题整合月计划列表 @@ -136,7 +138,7 @@ public class ByThemeMonthplanController extends BaseController { byThemeMonthplan.setName(byClassService.selectByClassById(classId).getBjmc() + "-主题整合月计划" + "(" + sdf.format(byThemeMonthplan.getMonth()) + ")"); return toAjax(byThemeMonthplanService.insertByThemeMonthplan(byThemeMonthplan)); } else { - return AjaxResult.error("当前用户非幼儿园,无法创建月计划"); + return AjaxResult.error("当前用户非幼儿园教师,无法创建月计划"); } } @@ -157,6 +159,28 @@ public class ByThemeMonthplanController extends BaseController { @Log(title = "主题整合月计划", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable String[] ids) { + //首先判断当前id下是否存在子目录 + for (int i = 0; i < ids.length; i++) { + ByThemeMonthplanitem byThemeMonthplanitem = new ByThemeMonthplanitem(); + byThemeMonthplanitem.setMpid(ids[i]); + List list = byThemeWeekplanService.selectByThemeMonthplanitemList(byThemeMonthplanitem); + if (list != null && list.size() > 0) { + return AjaxResult.error("选中的计划下存在子计划,无法删除"); + } + } return toAjax(byThemeMonthplanService.deleteByThemeMonthplanByIds(ids)); } + + /** + * 提交主题整合学期计划 + */ + @PreAuthorize("@ss.hasPermi('benyi:thememonthplan:edit')") + @Log(title = "主题整合学期计划", businessType = BusinessType.UPDATE) + @PostMapping("/check/{id}") + public AjaxResult check(@PathVariable String id) { + ByThemeMonthplan byThemeMonthplan = new ByThemeMonthplan(); + byThemeMonthplan.setId(id); + byThemeMonthplan.setStatus("1"); + return toAjax(byThemeMonthplanService.updateByThemeMonthplan(byThemeMonthplan)); + } } diff --git a/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByThemeWeekplanController.java b/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByThemeMonthplanitemController.java similarity index 66% rename from ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByThemeWeekplanController.java rename to ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByThemeMonthplanitemController.java index 06c24e342..aeb47eeeb 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByThemeWeekplanController.java +++ b/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByThemeMonthplanitemController.java @@ -16,8 +16,8 @@ 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.project.benyi.domain.ByThemeMonthplanitem; +import com.ruoyi.project.benyi.service.IByThemeMonthplanitemService; import com.ruoyi.framework.web.controller.BaseController; import com.ruoyi.framework.web.domain.AjaxResult; import com.ruoyi.common.utils.poi.ExcelUtil; @@ -30,11 +30,11 @@ import com.ruoyi.framework.web.page.TableDataInfo; * @date 2020-08-25 */ @RestController -@RequestMapping("/benyi/themeweekplan") -public class ByThemeWeekplanController extends BaseController +@RequestMapping("/benyi/thememonthplanitem") +public class ByThemeMonthplanitemController extends BaseController { @Autowired - private IByThemeWeekplanService byThemeWeekplanService; + private IByThemeMonthplanitemService byThemeWeekplanService; @Autowired private SchoolCommon schoolCommon; @@ -43,10 +43,10 @@ public class ByThemeWeekplanController extends BaseController */ @PreAuthorize("@ss.hasPermi('benyi:thememonthplan:list')") @GetMapping("/list") - public TableDataInfo list(ByThemeWeekplan byThemeWeekplan) + public TableDataInfo list(ByThemeMonthplanitem byThemeMonthplanitem) { startPage(); - List list = byThemeWeekplanService.selectByThemeWeekplanList(byThemeWeekplan); + List list = byThemeWeekplanService.selectByThemeMonthplanitemList(byThemeMonthplanitem); return getDataTable(list); } @@ -56,10 +56,10 @@ public class ByThemeWeekplanController extends BaseController @PreAuthorize("@ss.hasPermi('benyi:thememonthplan:export')") @Log(title = "主题整合周计划", businessType = BusinessType.EXPORT) @GetMapping("/export") - public AjaxResult export(ByThemeWeekplan byThemeWeekplan) + public AjaxResult export(ByThemeMonthplanitem byThemeMonthplanitem) { - List list = byThemeWeekplanService.selectByThemeWeekplanList(byThemeWeekplan); - ExcelUtil util = new ExcelUtil(ByThemeWeekplan.class); + List list = byThemeWeekplanService.selectByThemeMonthplanitemList(byThemeMonthplanitem); + ExcelUtil util = new ExcelUtil(ByThemeMonthplanitem.class); return util.exportExcel(list, "weekplan"); } @@ -70,7 +70,7 @@ public class ByThemeWeekplanController extends BaseController @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") String id) { - return AjaxResult.success(byThemeWeekplanService.selectByThemeWeekplanById(id)); + return AjaxResult.success(byThemeWeekplanService.selectByThemeMonthplanitemById(id)); } /** @@ -79,12 +79,12 @@ public class ByThemeWeekplanController extends BaseController @PreAuthorize("@ss.hasPermi('benyi:thememonthplan:add')") @Log(title = "主题整合周计划", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@RequestBody ByThemeWeekplan byThemeWeekplan) + public AjaxResult add(@RequestBody ByThemeMonthplanitem byThemeMonthplanitem) { String uuid=schoolCommon.getUuid(); - byThemeWeekplan.setId(uuid); - byThemeWeekplan.setCreateuserid(SecurityUtils.getLoginUser().getUser().getUserId()); - return toAjax(byThemeWeekplanService.insertByThemeWeekplan(byThemeWeekplan)); + byThemeMonthplanitem.setId(uuid); + byThemeMonthplanitem.setCreateuserid(SecurityUtils.getLoginUser().getUser().getUserId()); + return toAjax(byThemeWeekplanService.insertByThemeMonthplanitem(byThemeMonthplanitem)); } /** @@ -93,9 +93,9 @@ public class ByThemeWeekplanController extends BaseController @PreAuthorize("@ss.hasPermi('benyi:thememonthplan:edit')") @Log(title = "主题整合周计划", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@RequestBody ByThemeWeekplan byThemeWeekplan) + public AjaxResult edit(@RequestBody ByThemeMonthplanitem byThemeMonthplanitem) { - return toAjax(byThemeWeekplanService.updateByThemeWeekplan(byThemeWeekplan)); + return toAjax(byThemeWeekplanService.updateByThemeMonthplanitem(byThemeMonthplanitem)); } /** @@ -106,6 +106,6 @@ public class ByThemeWeekplanController extends BaseController @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable String[] ids) { - return toAjax(byThemeWeekplanService.deleteByThemeWeekplanByIds(ids)); + return toAjax(byThemeWeekplanService.deleteByThemeMonthplanitemByIds(ids)); } } diff --git a/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByThemeTermplanController.java b/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByThemeTermplanController.java index bcbe01507..6b9d012b1 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByThemeTermplanController.java +++ b/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByThemeTermplanController.java @@ -118,7 +118,7 @@ public class ByThemeTermplanController extends BaseController { return toAjax(byThemeTermplanService.insertByThemeTermplan(byThemeTermplan)); } else { - return AjaxResult.error("当前用户非幼儿园,无法添加幼儿"); + return AjaxResult.error("当前用户非幼儿园教师,无法创建计划"); } } @@ -140,6 +140,15 @@ public class ByThemeTermplanController extends BaseController { @Log(title = "主题整合学期计划", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable String[] ids) { + //首先判断当前id下是否存在子目录 + for (int i = 0; i < ids.length; i++) { + ByThemeTermplanitem byThemeTermplanitem = new ByThemeTermplanitem(); + byThemeTermplanitem.setTpid(ids[i]); + List list = byThemeTermplanitemService.selectByThemeTermplanitemList(byThemeTermplanitem); + if (list != null && list.size() > 0) { + return AjaxResult.error("选中的计划下存在子计划,无法删除"); + } + } return toAjax(byThemeTermplanService.deleteByThemeTermplanByIds(ids)); } diff --git a/ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByThemeWeekplan.java b/ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByThemeMonthplanitem.java similarity index 98% rename from ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByThemeWeekplan.java rename to ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByThemeMonthplanitem.java index 8b42decd8..83d8dba74 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByThemeWeekplan.java +++ b/ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByThemeMonthplanitem.java @@ -14,7 +14,7 @@ import com.ruoyi.framework.web.domain.BaseEntity; * @author tsbz * @date 2020-08-25 */ -public class ByThemeWeekplan extends BaseEntity { +public class ByThemeMonthplanitem extends BaseEntity { private static final long serialVersionUID = 1L; /** diff --git a/ruoyi/src/main/java/com/ruoyi/project/benyi/mapper/ByThemeWeekplanMapper.java b/ruoyi/src/main/java/com/ruoyi/project/benyi/mapper/ByThemeMonthplanitemMapper.java similarity index 51% rename from ruoyi/src/main/java/com/ruoyi/project/benyi/mapper/ByThemeWeekplanMapper.java rename to ruoyi/src/main/java/com/ruoyi/project/benyi/mapper/ByThemeMonthplanitemMapper.java index 9a8b2944d..b30a8e498 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/benyi/mapper/ByThemeWeekplanMapper.java +++ b/ruoyi/src/main/java/com/ruoyi/project/benyi/mapper/ByThemeMonthplanitemMapper.java @@ -2,7 +2,7 @@ package com.ruoyi.project.benyi.mapper; import java.util.List; -import com.ruoyi.project.benyi.domain.ByThemeWeekplan; +import com.ruoyi.project.benyi.domain.ByThemeMonthplanitem; /** * 主题整合周计划Mapper接口 @@ -10,38 +10,38 @@ import com.ruoyi.project.benyi.domain.ByThemeWeekplan; * @author tsbz * @date 2020-08-25 */ -public interface ByThemeWeekplanMapper { +public interface ByThemeMonthplanitemMapper { /** * 查询主题整合周计划 * * @param id 主题整合周计划ID * @return 主题整合周计划 */ - public ByThemeWeekplan selectByThemeWeekplanById(String id); + public ByThemeMonthplanitem selectByThemeMonthplanitemById(String id); /** * 查询主题整合周计划列表 * - * @param byThemeWeekplan 主题整合周计划 + * @param byThemeMonthplanitem 主题整合周计划 * @return 主题整合周计划集合 */ - public List selectByThemeWeekplanList(ByThemeWeekplan byThemeWeekplan); + public List selectByThemeMonthplanitemList(ByThemeMonthplanitem byThemeMonthplanitem); /** * 新增主题整合周计划 * - * @param byThemeWeekplan 主题整合周计划 + * @param byThemeMonthplanitem 主题整合周计划 * @return 结果 */ - public int insertByThemeWeekplan(ByThemeWeekplan byThemeWeekplan); + public int insertByThemeMonthplanitem(ByThemeMonthplanitem byThemeMonthplanitem); /** * 修改主题整合周计划 * - * @param byThemeWeekplan 主题整合周计划 + * @param byThemeMonthplanitem 主题整合周计划 * @return 结果 */ - public int updateByThemeWeekplan(ByThemeWeekplan byThemeWeekplan); + public int updateByThemeMonthplanitem(ByThemeMonthplanitem byThemeMonthplanitem); /** * 删除主题整合周计划 @@ -49,7 +49,7 @@ public interface ByThemeWeekplanMapper { * @param id 主题整合周计划ID * @return 结果 */ - public int deleteByThemeWeekplanById(String id); + public int deleteByThemeMonthplanitemById(String id); /** * 批量删除主题整合周计划 @@ -57,5 +57,5 @@ public interface ByThemeWeekplanMapper { * @param ids 需要删除的数据ID * @return 结果 */ - public int deleteByThemeWeekplanByIds(String[] ids); + public int deleteByThemeMonthplanitemByIds(String[] ids); } diff --git a/ruoyi/src/main/java/com/ruoyi/project/benyi/service/IByThemeWeekplanService.java b/ruoyi/src/main/java/com/ruoyi/project/benyi/service/IByThemeMonthplanitemService.java similarity index 52% rename from ruoyi/src/main/java/com/ruoyi/project/benyi/service/IByThemeWeekplanService.java rename to ruoyi/src/main/java/com/ruoyi/project/benyi/service/IByThemeMonthplanitemService.java index 32bc5128f..11edf1c11 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/benyi/service/IByThemeWeekplanService.java +++ b/ruoyi/src/main/java/com/ruoyi/project/benyi/service/IByThemeMonthplanitemService.java @@ -2,7 +2,7 @@ package com.ruoyi.project.benyi.service; import java.util.List; -import com.ruoyi.project.benyi.domain.ByThemeWeekplan; +import com.ruoyi.project.benyi.domain.ByThemeMonthplanitem; /** * 主题整合周计划Service接口 @@ -10,38 +10,38 @@ import com.ruoyi.project.benyi.domain.ByThemeWeekplan; * @author tsbz * @date 2020-08-25 */ -public interface IByThemeWeekplanService { +public interface IByThemeMonthplanitemService { /** * 查询主题整合周计划 * * @param id 主题整合周计划ID * @return 主题整合周计划 */ - public ByThemeWeekplan selectByThemeWeekplanById(String id); + public ByThemeMonthplanitem selectByThemeMonthplanitemById(String id); /** * 查询主题整合周计划列表 * - * @param byThemeWeekplan 主题整合周计划 + * @param byThemeMonthplanitem 主题整合周计划 * @return 主题整合周计划集合 */ - public List selectByThemeWeekplanList(ByThemeWeekplan byThemeWeekplan); + public List selectByThemeMonthplanitemList(ByThemeMonthplanitem byThemeMonthplanitem); /** * 新增主题整合周计划 * - * @param byThemeWeekplan 主题整合周计划 + * @param byThemeMonthplanitem 主题整合周计划 * @return 结果 */ - public int insertByThemeWeekplan(ByThemeWeekplan byThemeWeekplan); + public int insertByThemeMonthplanitem(ByThemeMonthplanitem byThemeMonthplanitem); /** * 修改主题整合周计划 * - * @param byThemeWeekplan 主题整合周计划 + * @param byThemeMonthplanitem 主题整合周计划 * @return 结果 */ - public int updateByThemeWeekplan(ByThemeWeekplan byThemeWeekplan); + public int updateByThemeMonthplanitem(ByThemeMonthplanitem byThemeMonthplanitem); /** * 批量删除主题整合周计划 @@ -49,7 +49,7 @@ public interface IByThemeWeekplanService { * @param ids 需要删除的主题整合周计划ID * @return 结果 */ - public int deleteByThemeWeekplanByIds(String[] ids); + public int deleteByThemeMonthplanitemByIds(String[] ids); /** * 删除主题整合周计划信息 @@ -57,5 +57,5 @@ public interface IByThemeWeekplanService { * @param id 主题整合周计划ID * @return 结果 */ - public int deleteByThemeWeekplanById(String id); + public int deleteByThemeMonthplanitemById(String id); } diff --git a/ruoyi/src/main/java/com/ruoyi/project/benyi/service/impl/ByThemeMonthplanitemServiceImpl.java b/ruoyi/src/main/java/com/ruoyi/project/benyi/service/impl/ByThemeMonthplanitemServiceImpl.java new file mode 100644 index 000000000..650d62d68 --- /dev/null +++ b/ruoyi/src/main/java/com/ruoyi/project/benyi/service/impl/ByThemeMonthplanitemServiceImpl.java @@ -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.ByThemeMonthplanitemMapper; +import com.ruoyi.project.benyi.domain.ByThemeMonthplanitem; +import com.ruoyi.project.benyi.service.IByThemeMonthplanitemService; + +/** + * 主题整合周计划Service业务层处理 + * + * @author tsbz + * @date 2020-08-25 + */ +@Service +public class ByThemeMonthplanitemServiceImpl implements IByThemeMonthplanitemService { + @Autowired + private ByThemeMonthplanitemMapper byThemeMonthplanitemMapper; + + /** + * 查询主题整合周计划 + * + * @param id 主题整合周计划ID + * @return 主题整合周计划 + */ + @Override + public ByThemeMonthplanitem selectByThemeMonthplanitemById(String id) { + return byThemeMonthplanitemMapper.selectByThemeMonthplanitemById(id); + } + + /** + * 查询主题整合周计划列表 + * + * @param byThemeMonthplanitem 主题整合周计划 + * @return 主题整合周计划 + */ + @Override + public List selectByThemeMonthplanitemList(ByThemeMonthplanitem byThemeMonthplanitem) { + return byThemeMonthplanitemMapper.selectByThemeMonthplanitemList(byThemeMonthplanitem); + } + + /** + * 新增主题整合周计划 + * + * @param byThemeMonthplanitem 主题整合周计划 + * @return 结果 + */ + @Override + public int insertByThemeMonthplanitem(ByThemeMonthplanitem byThemeMonthplanitem) { + byThemeMonthplanitem.setCreateTime(DateUtils.getNowDate()); + return byThemeMonthplanitemMapper.insertByThemeMonthplanitem(byThemeMonthplanitem); + } + + /** + * 修改主题整合周计划 + * + * @param byThemeMonthplanitem 主题整合周计划 + * @return 结果 + */ + @Override + public int updateByThemeMonthplanitem(ByThemeMonthplanitem byThemeMonthplanitem) { + return byThemeMonthplanitemMapper.updateByThemeMonthplanitem(byThemeMonthplanitem); + } + + /** + * 批量删除主题整合周计划 + * + * @param ids 需要删除的主题整合周计划ID + * @return 结果 + */ + @Override + public int deleteByThemeMonthplanitemByIds(String[] ids) { + return byThemeMonthplanitemMapper.deleteByThemeMonthplanitemByIds(ids); + } + + /** + * 删除主题整合周计划信息 + * + * @param id 主题整合周计划ID + * @return 结果 + */ + @Override + public int deleteByThemeMonthplanitemById(String id) { + return byThemeMonthplanitemMapper.deleteByThemeMonthplanitemById(id); + } +} diff --git a/ruoyi/src/main/java/com/ruoyi/project/benyi/service/impl/ByThemeWeekplanServiceImpl.java b/ruoyi/src/main/java/com/ruoyi/project/benyi/service/impl/ByThemeWeekplanServiceImpl.java deleted file mode 100644 index f41816150..000000000 --- a/ruoyi/src/main/java/com/ruoyi/project/benyi/service/impl/ByThemeWeekplanServiceImpl.java +++ /dev/null @@ -1,89 +0,0 @@ -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-25 - */ -@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 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); - } -} diff --git a/ruoyi/src/main/java/com/ruoyi/project/system/controller/ByClassController.java b/ruoyi/src/main/java/com/ruoyi/project/system/controller/ByClassController.java index 1c19053df..98a705237 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/system/controller/ByClassController.java +++ b/ruoyi/src/main/java/com/ruoyi/project/system/controller/ByClassController.java @@ -46,7 +46,16 @@ public class ByClassController extends BaseController { @GetMapping("/list") public TableDataInfo list(ByClass byClass) { startPage(); - List list = byClassService.selectByClassList(byClass); + List list = null; + String classId = schoolCommon.getClassId(); + //如果是幼儿园教师 只显示当前班级 + if (schoolCommon.isSchool() && !schoolCommon.isStringEmpty(classId)) { + byClass.setBjbh(classId); + list = byClassService.selectByClassList(byClass); + }else{ + list = byClassService.selectByClassList(byClass); + } + return getDataTable(list); } diff --git a/ruoyi/src/main/resources/mybatis/benyi/ByThemeWeekplanMapper.xml b/ruoyi/src/main/resources/mybatis/benyi/ByThemeMonthplanitemMapper.xml similarity index 76% rename from ruoyi/src/main/resources/mybatis/benyi/ByThemeWeekplanMapper.xml rename to ruoyi/src/main/resources/mybatis/benyi/ByThemeMonthplanitemMapper.xml index a887f7b94..605f78dcb 100644 --- a/ruoyi/src/main/resources/mybatis/benyi/ByThemeWeekplanMapper.xml +++ b/ruoyi/src/main/resources/mybatis/benyi/ByThemeMonthplanitemMapper.xml @@ -2,9 +2,9 @@ - + - + @@ -16,12 +16,12 @@ - - select id, mpid, zc, starttime, endtime, activityid, jzzc, createuserid, create_time from by_theme_weekplan + + select id, mpid, zc, starttime, endtime, activityid, jzzc, createuserid, create_time from by_theme_monthplanitem - + and mpid = #{mpid} and zc = #{zc} @@ -34,13 +34,13 @@ order by zc - + where id = #{id} - - insert into by_theme_weekplan + + insert into by_theme_monthplanitem id, mpid, @@ -65,8 +65,8 @@ - - update by_theme_weekplan + + update by_theme_monthplanitem mpid = #{mpid}, zc = #{zc}, @@ -80,12 +80,12 @@ where id = #{id} - - delete from by_theme_weekplan where id = #{id} + + delete from by_theme_monthplanitem where id = #{id} - - delete from by_theme_weekplan where id in + + delete from by_theme_monthplanitem where id in #{id} diff --git a/ruoyi/src/main/resources/mybatis/system/ByClassMapper.xml b/ruoyi/src/main/resources/mybatis/system/ByClassMapper.xml index 87328643a..a8075e3b3 100644 --- a/ruoyi/src/main/resources/mybatis/system/ByClassMapper.xml +++ b/ruoyi/src/main/resources/mybatis/system/ByClassMapper.xml @@ -34,6 +34,7 @@