主题整合周计划及明细

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

@ -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>