主题整合学期计划

This commit is contained in:
paidaxing444 2020-08-24 17:59:49 +08:00
parent 90b454d7af
commit fd6616a29a
10 changed files with 242 additions and 216 deletions

View File

@ -1,87 +1,31 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px"> <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
<el-form-item label="学校id" prop="schoolid"> <el-form-item label="班级编码" prop="classid">
<el-input <el-select v-model="queryParams.classid" placeholder="请选择班级">
v-model="queryParams.schoolid" <el-option
placeholder="请输入学校id" v-for="dict in classOptions"
clearable :key="dict.bjbh"
size="small" :label="dict.bjmc"
@keyup.enter.native="handleQuery" :value="dict.bjbh"
/> ></el-option>
</el-form-item> </el-select>
<el-form-item label="班级id" prop="classid">
<el-input
v-model="queryParams.classid"
placeholder="请输入班级id"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<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="month">
<el-date-picker
clearable
size="small"
style="width: 200px"
v-model="queryParams.month"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择月份"
></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="学年学期" prop="xnxq"> <el-form-item label="学年学期" prop="xnxq">
<el-input <el-select v-model="queryParams.xnxq" placeholder="请选择学年学期" clearable size="small">
v-model="queryParams.xnxq" <el-option
placeholder="请输入学年学期" v-for="dict in xnxqOptions"
clearable :key="dict.dictValue"
size="small" :label="dict.dictLabel"
@keyup.enter.native="handleQuery" :value="dict.dictValue"
/> />
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="创建人" prop="createuserid"> <el-form-item label="当前状态" prop="status">
<el-input
v-model="queryParams.createuserid"
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-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
<el-option label="请选择字典生成" value /> <el-option label="请选择字典生成" value />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="审批人" prop="spr">
<el-input
v-model="queryParams.spr"
placeholder="请输入审批人"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="审批时间" prop="sptime">
<el-date-picker
clearable
size="small"
style="width: 200px"
v-model="queryParams.sptime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择审批时间"
></el-date-picker>
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <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-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@ -122,30 +66,21 @@
<el-table v-loading="loading" :data="termplanList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="termplanList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="编号" align="center" prop="id" /> <el-table-column label="班级" align="center" prop="classid" :formatter="classFormat" />
<el-table-column label="学校id" align="center" prop="schoolid" />
<el-table-column label="班级id" align="center" prop="classid" />
<el-table-column label="名称" align="center" prop="name" /> <el-table-column label="名称" align="center" prop="name" />
<el-table-column label="月份" align="center" prop="startmonth" width="180"> <el-table-column label="开始月份" align="center" prop="startmonth" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.startmonth, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.startmonth, '{y}-{m}') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="结束月份" align="center" prop="endmonth" width="180"> <el-table-column label="结束月份" align="center" prop="endmonth" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.endmonth, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.endmonth, '{y}-{m}') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="学年学期" align="center" prop="xnxq" /> <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="remark" />
<el-table-column label="创建人" align="center" prop="createuserid" />
<el-table-column label="状态" align="center" prop="status" /> <el-table-column label="状态" align="center" prop="status" />
<el-table-column label="审批人" align="center" prop="spr" />
<el-table-column label="审批时间" align="center" prop="sptime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.sptime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
@ -177,61 +112,28 @@
<!-- 添加或修改主题整合学期计划对话框 --> <!-- 添加或修改主题整合学期计划对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <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 ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="学校id" prop="schoolid">
<el-input v-model="form.schoolid" placeholder="请输入学校id" />
</el-form-item>
<el-form-item label="班级id" prop="classid">
<el-input v-model="form.classid" placeholder="请输入班级id" />
</el-form-item>
<el-form-item label="名称" prop="name">
<el-input v-model="form.name" placeholder="请输入名称" />
</el-form-item>
<el-form-item label="月份" prop="startmonth"> <el-form-item label="月份" prop="startmonth">
<el-date-picker <el-date-picker
clearable
size="small"
style="width: 200px"
v-model="form.startmonth" v-model="form.startmonth"
type="date" type="monthrange"
value-format="yyyy-MM-dd" range-separator="至"
placeholder="选择月份" start-placeholder="开始月份"
></el-date-picker> end-placeholder="结束月份"
</el-form-item> value-format="yyyy-MM"
<el-form-item label="结束月份" prop="endmonth">
<el-date-picker
clearable
size="small"
style="width: 200px"
v-model="form.endmonth"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择结束月份"
></el-date-picker> ></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="学年学期" prop="xnxq"> <el-form-item label="学年学期" prop="xnxq">
<el-input v-model="form.xnxq" placeholder="请输入学年学期" /> <el-select v-model="form.xnxq" placeholder="请选择学年学期">
<el-option
v-for="dict in xnxqOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="创建人" prop="createuserid"> <el-form-item label="备注" prop="remark">
<el-input v-model="form.createuserid" placeholder="请输入创建人" /> <el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
</el-form-item>
<el-form-item label="状态">
<el-radio-group v-model="form.status">
<el-radio label="1">请选择字典生成</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="审批人" prop="spr">
<el-input v-model="form.spr" placeholder="请输入审批人" />
</el-form-item>
<el-form-item label="审批时间" prop="sptime">
<el-date-picker
clearable
size="small"
style="width: 200px"
v-model="form.sptime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择审批时间"
></el-date-picker>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
@ -250,6 +152,7 @@ import {
addTermplan, addTermplan,
updateTermplan, updateTermplan,
} from "@/api/benyi/themetermplan"; } from "@/api/benyi/themetermplan";
import { listClass } from "@/api/system/class";
export default { export default {
name: "Termplan", name: "Termplan",
@ -267,6 +170,10 @@ export default {
total: 0, total: 0,
// //
termplanList: [], termplanList: [],
//
classOptions: [],
//
xnxqOptions: [],
// //
title: "", title: "",
// //
@ -289,13 +196,47 @@ export default {
// //
form: {}, form: {},
// //
rules: {}, rules: {
xnxq: [
{ required: true, message: "学年学期不能为空", trigger: "blur" },
],
startmonth: [
{ required: true, message: "日期不能为空", trigger: "blur" },
],
},
}; };
}, },
created() { created() {
this.getClassList();
this.getList(); this.getList();
this.getDicts("sys_xnxq").then((response) => {
this.xnxqOptions = response.data;
});
}, },
methods: { methods: {
//
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("");
},
// --
xnxqFormat(row, column) {
return this.selectDictLabel(this.xnxqOptions, row.xnxq);
},
//
getClassList() {
listClass(null).then((response) => {
this.classOptions = response.rows;
});
},
/** 查询主题整合学期计划列表 */ /** 查询主题整合学期计划列表 */
getList() { getList() {
this.loading = true; this.loading = true;
@ -359,12 +300,19 @@ export default {
this.form = response.data; this.form = response.data;
this.open = true; this.open = true;
this.title = "修改主题整合学期计划"; this.title = "修改主题整合学期计划";
const time = [];
time.push(response.data.startmonth);
time.push(response.data.endmonth);
this.form.startmonth = time;
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm: function () { submitForm: function () {
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
const time = this.form.startmonth;
this.form.startmonth = time[0];
this.form.endmonth = time[1];
if (this.form.id != undefined) { if (this.form.id != undefined) {
updateTermplan(this.form).then((response) => { updateTermplan(this.form).then((response) => {
if (response.code === 200) { if (response.code === 200) {

View File

@ -1,6 +1,16 @@
package com.ruoyi.project.benyi.controller; package com.ruoyi.project.benyi.controller;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.List; import java.util.List;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.project.benyi.domain.ByThemeTermplanitem;
import com.ruoyi.project.benyi.service.IByThemeTermplanitemService;
import com.ruoyi.project.common.SchoolCommon;
import com.ruoyi.project.system.service.IByClassService;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
@ -28,18 +38,22 @@ import com.ruoyi.framework.web.page.TableDataInfo;
*/ */
@RestController @RestController
@RequestMapping("/benyi/themetermplan") @RequestMapping("/benyi/themetermplan")
public class ByThemeTermplanController extends BaseController public class ByThemeTermplanController extends BaseController {
{
@Autowired @Autowired
private IByThemeTermplanService byThemeTermplanService; private IByThemeTermplanService byThemeTermplanService;
@Autowired
private SchoolCommon schoolCommon;
@Autowired
private IByClassService byClassService;
@Autowired
private IByThemeTermplanitemService byThemeTermplanitemService;
/** /**
* 查询主题整合学期计划列表 * 查询主题整合学期计划列表
*/ */
@PreAuthorize("@ss.hasPermi('benyi:themetermplan:list')") @PreAuthorize("@ss.hasPermi('benyi:themetermplan:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(ByThemeTermplan byThemeTermplan) public TableDataInfo list(ByThemeTermplan byThemeTermplan) {
{
startPage(); startPage();
List<ByThemeTermplan> list = byThemeTermplanService.selectByThemeTermplanList(byThemeTermplan); List<ByThemeTermplan> list = byThemeTermplanService.selectByThemeTermplanList(byThemeTermplan);
return getDataTable(list); return getDataTable(list);
@ -51,8 +65,7 @@ public class ByThemeTermplanController extends BaseController
@PreAuthorize("@ss.hasPermi('benyi:themetermplan:export')") @PreAuthorize("@ss.hasPermi('benyi:themetermplan:export')")
@Log(title = "主题整合学期计划", businessType = BusinessType.EXPORT) @Log(title = "主题整合学期计划", businessType = BusinessType.EXPORT)
@GetMapping("/export") @GetMapping("/export")
public AjaxResult export(ByThemeTermplan byThemeTermplan) public AjaxResult export(ByThemeTermplan byThemeTermplan) {
{
List<ByThemeTermplan> list = byThemeTermplanService.selectByThemeTermplanList(byThemeTermplan); List<ByThemeTermplan> list = byThemeTermplanService.selectByThemeTermplanList(byThemeTermplan);
ExcelUtil<ByThemeTermplan> util = new ExcelUtil<ByThemeTermplan>(ByThemeTermplan.class); ExcelUtil<ByThemeTermplan> util = new ExcelUtil<ByThemeTermplan>(ByThemeTermplan.class);
return util.exportExcel(list, "themetermplan"); return util.exportExcel(list, "themetermplan");
@ -63,8 +76,7 @@ public class ByThemeTermplanController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('benyi:themetermplan:query')") @PreAuthorize("@ss.hasPermi('benyi:themetermplan:query')")
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) public AjaxResult getInfo(@PathVariable("id") String id) {
{
return AjaxResult.success(byThemeTermplanService.selectByThemeTermplanById(id)); return AjaxResult.success(byThemeTermplanService.selectByThemeTermplanById(id));
} }
@ -74,9 +86,41 @@ public class ByThemeTermplanController extends BaseController
@PreAuthorize("@ss.hasPermi('benyi:themetermplan:add')") @PreAuthorize("@ss.hasPermi('benyi:themetermplan:add')")
@Log(title = "主题整合学期计划", businessType = BusinessType.INSERT) @Log(title = "主题整合学期计划", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody ByThemeTermplan byThemeTermplan) public AjaxResult add(@RequestBody ByThemeTermplan byThemeTermplan) {
{ String classId = schoolCommon.getClassId();
//首先判断当前账户是否为幼儿园账号
if (schoolCommon.isSchool() && !schoolCommon.isStringEmpty(classId)) {
int iCount = schoolCommon.getDifMonth(byThemeTermplan.getStartmonth(), byThemeTermplan.getEndmonth());
System.out.println("月份差=" + iCount);
String uuid = schoolCommon.getUuid();
byThemeTermplan.setId(uuid);
byThemeTermplan.setSchoolid(SecurityUtils.getLoginUser().getUser().getDept().getDeptId());
byThemeTermplan.setCreateuserid(SecurityUtils.getLoginUser().getUser().getUserId());
byThemeTermplan.setClassid(classId);
byThemeTermplan.setName(byClassService.selectByClassById(classId).getBjmc() + "-主题整合学期计划");
ByThemeTermplanitem byThemeTermplanitem = null;
for (int i = 0; i <= iCount; i++) {
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());
//创建时间
byThemeTermplanitem.setCreateTime(new Date());
//新增每月计划
byThemeTermplanitemService.insertByThemeTermplanitem(byThemeTermplanitem);
}
return toAjax(byThemeTermplanService.insertByThemeTermplan(byThemeTermplan)); return toAjax(byThemeTermplanService.insertByThemeTermplan(byThemeTermplan));
} else {
return AjaxResult.error("当前用户非幼儿园,无法添加幼儿");
}
} }
/** /**
@ -85,8 +129,7 @@ public class ByThemeTermplanController extends BaseController
@PreAuthorize("@ss.hasPermi('benyi:themetermplan:edit')") @PreAuthorize("@ss.hasPermi('benyi:themetermplan:edit')")
@Log(title = "主题整合学期计划", businessType = BusinessType.UPDATE) @Log(title = "主题整合学期计划", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody ByThemeTermplan byThemeTermplan) public AjaxResult edit(@RequestBody ByThemeTermplan byThemeTermplan) {
{
return toAjax(byThemeTermplanService.updateByThemeTermplan(byThemeTermplan)); return toAjax(byThemeTermplanService.updateByThemeTermplan(byThemeTermplan));
} }
@ -96,8 +139,7 @@ public class ByThemeTermplanController extends BaseController
@PreAuthorize("@ss.hasPermi('benyi:themetermplan:remove')") @PreAuthorize("@ss.hasPermi('benyi:themetermplan:remove')")
@Log(title = "主题整合学期计划", businessType = BusinessType.DELETE) @Log(title = "主题整合学期计划", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) public AjaxResult remove(@PathVariable String[] ids) {
{
return toAjax(byThemeTermplanService.deleteByThemeTermplanByIds(ids)); return toAjax(byThemeTermplanService.deleteByThemeTermplanByIds(ids));
} }
} }

View File

@ -43,15 +43,15 @@ public class ByThemeTermplan extends BaseEntity {
/** /**
* 月份 * 月份
*/ */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM")
@Excel(name = "月份", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "月份", width = 30, dateFormat = "yyyy-MM")
private Date startmonth; private Date startmonth;
/** /**
* 结束月份 * 结束月份
*/ */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM")
@Excel(name = "结束月份", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "结束月份", width = 30, dateFormat = "yyyy-MM")
private Date endmonth; private Date endmonth;
/** /**
@ -85,6 +85,12 @@ public class ByThemeTermplan extends BaseEntity {
@Excel(name = "审批时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "审批时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date sptime; private Date sptime;
/**
* 审核意见
*/
@Excel(name = "审核意见")
private String shyj;
public void setId(String id) { public void setId(String id) {
this.id = id; this.id = id;
} }
@ -173,6 +179,14 @@ public class ByThemeTermplan extends BaseEntity {
return sptime; return sptime;
} }
public void setShyj(String shyj) {
this.shyj = shyj;
}
public String getShyj() {
return shyj;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
@ -189,6 +203,7 @@ public class ByThemeTermplan extends BaseEntity {
.append("status", getStatus()) .append("status", getStatus())
.append("spr", getSpr()) .append("spr", getSpr())
.append("sptime", getSptime()) .append("sptime", getSptime())
.append("shyj", getShyj())
.toString(); .toString();
} }
} }

View File

@ -28,6 +28,13 @@ public class ByThemeTermplanitem extends BaseEntity {
@Excel(name = "所属计划") @Excel(name = "所属计划")
private String tpid; private String tpid;
/**
* 月份
*/
@JsonFormat(pattern = "yyyy-MM")
@Excel(name = "月份", width = 30, dateFormat = "yyyy-MM")
private Date month;
/** /**
* 主题内容 * 主题内容
*/ */
@ -40,13 +47,6 @@ public class ByThemeTermplanitem extends BaseEntity {
@Excel(name = "创建人") @Excel(name = "创建人")
private Long createuserid; private Long createuserid;
/**
* $column.columnComment
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "创建人", width = 30, dateFormat = "yyyy-MM-dd")
private Date 创建时间;
/** /**
* 修改人 * 修改人
*/ */
@ -69,6 +69,14 @@ public class ByThemeTermplanitem extends BaseEntity {
return tpid; return tpid;
} }
public void setMonth(Date month) {
this.month = month;
}
public Date getMonth() {
return month;
}
public void setThemeconent(String themeconent) { public void setThemeconent(String themeconent) {
this.themeconent = themeconent; this.themeconent = themeconent;
} }
@ -85,14 +93,6 @@ public class ByThemeTermplanitem extends BaseEntity {
return createuserid; return createuserid;
} }
public void set创建时间(Date 创建时间) {
this.创建时间 = 创建时间;
}
public Date get创建时间() {
return 创建时间;
}
public void setUpdateuserid(Long updateuserid) { public void setUpdateuserid(Long updateuserid) {
this.updateuserid = updateuserid; this.updateuserid = updateuserid;
} }
@ -106,10 +106,11 @@ public class ByThemeTermplanitem extends BaseEntity {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId()) .append("id", getId())
.append("tpid", getTpid()) .append("tpid", getTpid())
.append("month", getMonth())
.append("themeconent", getThemeconent()) .append("themeconent", getThemeconent())
.append("remark", getRemark()) .append("remark", getRemark())
.append("createuserid", getCreateuserid()) .append("createuserid", getCreateuserid())
.append("创建时间", get创建时间()) .append("createTime", getCreateTime())
.append("updateuserid", getUpdateuserid()) .append("updateuserid", getUpdateuserid())
.append("updateTime", getUpdateTime()) .append("updateTime", getUpdateTime())
.toString(); .toString();

View File

@ -14,10 +14,10 @@ public interface ByThemeTermplanMapper {
/** /**
* 查询主题整合学期计划 * 查询主题整合学期计划
* *
* @param id 主题整合学期计划ID * @param id 主题整合学期计划IDdeleteByThemeTermplanByIds
* @return 主题整合学期计划 * @return 主题整合学期计划
*/ */
public ByThemeTermplan selectByThemeTermplanById(Long id); public ByThemeTermplan selectByThemeTermplanById(String id);
/** /**
* 查询主题整合学期计划列表 * 查询主题整合学期计划列表
@ -49,7 +49,7 @@ public interface ByThemeTermplanMapper {
* @param id 主题整合学期计划ID * @param id 主题整合学期计划ID
* @return 结果 * @return 结果
*/ */
public int deleteByThemeTermplanById(Long id); public int deleteByThemeTermplanById(String id);
/** /**
* 批量删除主题整合学期计划 * 批量删除主题整合学期计划
@ -57,5 +57,5 @@ public interface ByThemeTermplanMapper {
* @param ids 需要删除的数据ID * @param ids 需要删除的数据ID
* @return 结果 * @return 结果
*/ */
public int deleteByThemeTermplanByIds(Long[] ids); public int deleteByThemeTermplanByIds(String[] ids);
} }

View File

@ -17,7 +17,7 @@ public interface IByThemeTermplanService {
* @param id 主题整合学期计划ID * @param id 主题整合学期计划ID
* @return 主题整合学期计划 * @return 主题整合学期计划
*/ */
public ByThemeTermplan selectByThemeTermplanById(Long id); public ByThemeTermplan selectByThemeTermplanById(String id);
/** /**
* 查询主题整合学期计划列表 * 查询主题整合学期计划列表
@ -49,7 +49,7 @@ public interface IByThemeTermplanService {
* @param ids 需要删除的主题整合学期计划ID * @param ids 需要删除的主题整合学期计划ID
* @return 结果 * @return 结果
*/ */
public int deleteByThemeTermplanByIds(Long[] ids); public int deleteByThemeTermplanByIds(String[] ids);
/** /**
* 删除主题整合学期计划信息 * 删除主题整合学期计划信息
@ -57,5 +57,5 @@ public interface IByThemeTermplanService {
* @param id 主题整合学期计划ID * @param id 主题整合学期计划ID
* @return 结果 * @return 结果
*/ */
public int deleteByThemeTermplanById(Long id); public int deleteByThemeTermplanById(String id);
} }

View File

@ -27,7 +27,7 @@ public class ByThemeTermplanServiceImpl implements IByThemeTermplanService {
* @return 主题整合学期计划 * @return 主题整合学期计划
*/ */
@Override @Override
public ByThemeTermplan selectByThemeTermplanById(Long id) { public ByThemeTermplan selectByThemeTermplanById(String id) {
return byThemeTermplanMapper.selectByThemeTermplanById(id); return byThemeTermplanMapper.selectByThemeTermplanById(id);
} }
@ -72,7 +72,7 @@ public class ByThemeTermplanServiceImpl implements IByThemeTermplanService {
* @return 结果 * @return 结果
*/ */
@Override @Override
public int deleteByThemeTermplanByIds(Long[] ids) { public int deleteByThemeTermplanByIds(String[] ids) {
return byThemeTermplanMapper.deleteByThemeTermplanByIds(ids); return byThemeTermplanMapper.deleteByThemeTermplanByIds(ids);
} }
@ -83,7 +83,7 @@ public class ByThemeTermplanServiceImpl implements IByThemeTermplanService {
* @return 结果 * @return 结果
*/ */
@Override @Override
public int deleteByThemeTermplanById(Long id) { public int deleteByThemeTermplanById(String id) {
return byThemeTermplanMapper.deleteByThemeTermplanById(id); return byThemeTermplanMapper.deleteByThemeTermplanById(id);
} }
} }

View File

@ -109,8 +109,8 @@ public class SchoolCommon {
byClass.setZljs(sysUser.getUserId()); byClass.setZljs(sysUser.getUserId());
//新的返回byclassNew返回整条数据 //新的返回byclassNew返回整条数据
ByClass byClassNew = byClassService.selectByClassByUserId(byClass); ByClass byClassNew = byClassService.selectByClassByUserId(byClass);
System.out.println("--------------------"+ byClassNew); System.out.println("--------------------" + byClassNew);
if(byClassNew != null) { if (byClassNew != null) {
//如果实体byclassnew不为空,那么取出它的班级编号 //如果实体byclassnew不为空,那么取出它的班级编号
return byClassNew.getBjbh(); return byClassNew.getBjbh();
} else { } else {
@ -137,10 +137,10 @@ public class SchoolCommon {
//根据时间 生成学年学期 //根据时间 生成学年学期
public String getCurrentXnXq(Date date) { public String getCurrentXnXq(Date date) {
String year=String.format("%tY", date); String year = String.format("%tY", date);
Integer iYear = Integer.parseInt(year); Integer iYear = Integer.parseInt(year);
System.out.println("当前年======:" + iYear); System.out.println("当前年======:" + iYear);
String mon=String.format("%tm", date); String mon = String.format("%tm", date);
Integer iMonth = Integer.parseInt(mon); Integer iMonth = Integer.parseInt(mon);
System.out.println("当前月======:" + iMonth); System.out.println("当前月======:" + iMonth);
String strNxNq = ""; String strNxNq = "";
@ -155,7 +155,7 @@ public class SchoolCommon {
} }
public String getCurrentXn() { public String getCurrentXn() {
return getCurrentXnXq().substring(0,9); return getCurrentXnXq().substring(0, 9);
} }
public String getCurrentYear() { public String getCurrentYear() {
@ -173,7 +173,18 @@ public class SchoolCommon {
} }
// 生成UUID // 生成UUID
public String getUuid(){ public String getUuid() {
return UUID.randomUUID().toString().replace("-",""); return UUID.randomUUID().toString().replace("-", "");
}
//日期相减 获取月份
public Integer getDifMonth(Date startDate, Date endDate) {
Calendar start = Calendar.getInstance();
Calendar end = Calendar.getInstance();
start.setTime(startDate);
end.setTime(endDate);
int result = end.get(Calendar.MONTH) - start.get(Calendar.MONTH);
int month = (end.get(Calendar.YEAR) - start.get(Calendar.YEAR)) * 12;
return Math.abs(month + result);
} }
} }

View File

@ -18,10 +18,11 @@
<result property="status" column="status"/> <result property="status" column="status"/>
<result property="spr" column="spr"/> <result property="spr" column="spr"/>
<result property="sptime" column="sptime"/> <result property="sptime" column="sptime"/>
<result property="shyj" column="shyj"/>
</resultMap> </resultMap>
<sql id="selectByThemeTermplanVo"> <sql id="selectByThemeTermplanVo">
select id, schoolid, classid, name, startmonth, endmonth, xnxq, remark, createuserid, create_time, status, spr, sptime from by_theme_termplan select id, schoolid, classid, name, startmonth, endmonth, xnxq, remark, createuserid, create_time, status, spr, sptime, shyj from by_theme_termplan
</sql> </sql>
<select id="selectByThemeTermplanList" parameterType="ByThemeTermplan" resultMap="ByThemeTermplanResult"> <select id="selectByThemeTermplanList" parameterType="ByThemeTermplan" resultMap="ByThemeTermplanResult">
@ -37,6 +38,7 @@
<if test="status != null and status != ''">and status = #{status}</if> <if test="status != null and status != ''">and status = #{status}</if>
<if test="spr != null ">and spr = #{spr}</if> <if test="spr != null ">and spr = #{spr}</if>
<if test="sptime != null ">and sptime = #{sptime}</if> <if test="sptime != null ">and sptime = #{sptime}</if>
<if test="shyj != null and shyj != ''">and shyj = #{shyj}</if>
</where> </where>
</select> </select>
@ -61,6 +63,7 @@
<if test="status != null and status != ''">status,</if> <if test="status != null and status != ''">status,</if>
<if test="spr != null ">spr,</if> <if test="spr != null ">spr,</if>
<if test="sptime != null ">sptime,</if> <if test="sptime != null ">sptime,</if>
<if test="shyj != null and shyj != ''">shyj,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null and id != ''">#{id},</if> <if test="id != null and id != ''">#{id},</if>
@ -76,6 +79,7 @@
<if test="status != null and status != ''">#{status},</if> <if test="status != null and status != ''">#{status},</if>
<if test="spr != null ">#{spr},</if> <if test="spr != null ">#{spr},</if>
<if test="sptime != null ">#{sptime},</if> <if test="sptime != null ">#{sptime},</if>
<if test="shyj != null and shyj != ''">#{shyj},</if>
</trim> </trim>
</insert> </insert>
@ -94,6 +98,7 @@
<if test="status != null and status != ''">status = #{status},</if> <if test="status != null and status != ''">status = #{status},</if>
<if test="spr != null ">spr = #{spr},</if> <if test="spr != null ">spr = #{spr},</if>
<if test="sptime != null ">sptime = #{sptime},</if> <if test="sptime != null ">sptime = #{sptime},</if>
<if test="shyj != null and shyj != ''">shyj = #{shyj},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>

View File

@ -5,30 +5,31 @@
<mapper namespace="com.ruoyi.project.benyi.mapper.ByThemeTermplanitemMapper"> <mapper namespace="com.ruoyi.project.benyi.mapper.ByThemeTermplanitemMapper">
<resultMap type="ByThemeTermplanitem" id="ByThemeTermplanitemResult"> <resultMap type="ByThemeTermplanitem" id="ByThemeTermplanitemResult">
<result property="id" column="id"/> <result property="id" column="id" />
<result property="tpid" column="tpid"/> <result property="tpid" column="tpid" />
<result property="themeconent" column="themeconent"/> <result property="month" column="month" />
<result property="remark" column="remark"/> <result property="themeconent" column="themeconent" />
<result property="createuserid" column="createuserid"/> <result property="remark" column="remark" />
<result property="创建时间" column="创建时间"/> <result property="createuserid" column="createuserid" />
<result property="updateuserid" column="updateuserid"/> <result property="createTime" column="create_time" />
<result property="updateTime" column="update_time"/> <result property="updateuserid" column="updateuserid" />
<result property="updateTime" column="update_time" />
</resultMap> </resultMap>
<sql id="selectByThemeTermplanitemVo"> <sql id="selectByThemeTermplanitemVo">
select id, tpid, themeconent, remark, createuserid, 创建时间, updateuserid, update_time from by_theme_termplanitem select id, tpid, month, themeconent, remark, createuserid, create_time, updateuserid, update_time from by_theme_termplanitem
</sql> </sql>
<select id="selectByThemeTermplanitemList" parameterType="ByThemeTermplanitem" <select id="selectByThemeTermplanitemList" parameterType="ByThemeTermplanitem" resultMap="ByThemeTermplanitemResult">
resultMap="ByThemeTermplanitemResult">
<include refid="selectByThemeTermplanitemVo"/> <include refid="selectByThemeTermplanitemVo"/>
<where> <where>
<if test="tpid != null and tpid != ''">and tpid = #{tpid}</if> <if test="tpid != null and tpid != ''"> and tpid = #{tpid}</if>
<if test="themeconent != null and themeconent != ''">and themeconent = #{themeconent}</if> <if test="month != null "> and month = #{month}</if>
<if test="createuserid != null ">and createuserid = #{createuserid}</if> <if test="themeconent != null and themeconent != ''"> and themeconent = #{themeconent}</if>
<if test="创建时间 != null ">and 创建时间 = #{创建时间}</if> <if test="createuserid != null "> and createuserid = #{createuserid}</if>
<if test="updateuserid != null ">and updateuserid = #{updateuserid}</if> <if test="updateuserid != null "> and updateuserid = #{updateuserid}</if>
</where> </where>
order by month
</select> </select>
<select id="selectByThemeTermplanitemById" parameterType="Long" resultMap="ByThemeTermplanitemResult"> <select id="selectByThemeTermplanitemById" parameterType="Long" resultMap="ByThemeTermplanitemResult">
@ -40,19 +41,21 @@
insert into by_theme_termplanitem insert into by_theme_termplanitem
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="tpid != null and tpid != ''">tpid,</if> <if test="tpid != null and tpid != ''">tpid,</if>
<if test="month != null ">month,</if>
<if test="themeconent != null and themeconent != ''">themeconent,</if> <if test="themeconent != null and themeconent != ''">themeconent,</if>
<if test="remark != null and remark != ''">remark,</if> <if test="remark != null and remark != ''">remark,</if>
<if test="createuserid != null ">createuserid,</if> <if test="createuserid != null ">createuserid,</if>
<if test="创建时间 != null ">创建时间,</if> <if test="createTime != null ">create_time,</if>
<if test="updateuserid != null ">updateuserid,</if> <if test="updateuserid != null ">updateuserid,</if>
<if test="updateTime != null ">update_time,</if> <if test="updateTime != null ">update_time,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="tpid != null and tpid != ''">#{tpid},</if> <if test="tpid != null and tpid != ''">#{tpid},</if>
<if test="month != null ">#{month},</if>
<if test="themeconent != null and themeconent != ''">#{themeconent},</if> <if test="themeconent != null and themeconent != ''">#{themeconent},</if>
<if test="remark != null and remark != ''">#{remark},</if> <if test="remark != null and remark != ''">#{remark},</if>
<if test="createuserid != null ">#{createuserid},</if> <if test="createuserid != null ">#{createuserid},</if>
<if test="创建时间 != null ">#{创建时间},</if> <if test="createTime != null ">#{createTime},</if>
<if test="updateuserid != null ">#{updateuserid},</if> <if test="updateuserid != null ">#{updateuserid},</if>
<if test="updateTime != null ">#{updateTime},</if> <if test="updateTime != null ">#{updateTime},</if>
</trim> </trim>
@ -62,10 +65,11 @@
update by_theme_termplanitem update by_theme_termplanitem
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="tpid != null and tpid != ''">tpid = #{tpid},</if> <if test="tpid != null and tpid != ''">tpid = #{tpid},</if>
<if test="month != null ">month = #{month},</if>
<if test="themeconent != null and themeconent != ''">themeconent = #{themeconent},</if> <if test="themeconent != null and themeconent != ''">themeconent = #{themeconent},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if> <if test="remark != null and remark != ''">remark = #{remark},</if>
<if test="createuserid != null ">createuserid = #{createuserid},</if> <if test="createuserid != null ">createuserid = #{createuserid},</if>
<if test="创建时间 != null ">创建时间 = #{创建时间},</if> <if test="createTime != null ">create_time = #{createTime},</if>
<if test="updateuserid != null ">updateuserid = #{updateuserid},</if> <if test="updateuserid != null ">updateuserid = #{updateuserid},</if>
<if test="updateTime != null ">update_time = #{updateTime},</if> <if test="updateTime != null ">update_time = #{updateTime},</if>
</trim> </trim>