托费历史数据

This commit is contained in:
zhanglipeng
2021-09-22 09:57:12 +08:00
parent d7b0b9f074
commit 372246c212
7 changed files with 184 additions and 12 deletions

View File

@ -51,14 +51,24 @@ public class BySchoolchargeController extends BaseController {
@PreAuthorize("@ss.hasPermi('benyi:schoolcharge:list')")
@GetMapping("/child/list")
public TableDataInfo childlist(BySchoolcharge bySchoolcharge) {
startPage();
List<BySchoolcharge> list = bySchoolchargeService.selectByChildchargeList(bySchoolcharge);
if (list != null && list.size() > 0) {
for (int i = 0; i < list.size(); i++) {
list.get(i).setZj(getZongji(list.get(i)));
System.out.println("month---" + bySchoolcharge.getMonth());
bySchoolcharge.setMonthday(bySchoolcharge.getMonth() + "-15");
List<BySchoolcharge> listScope = bySchoolchargeService.selectByChildchargeListByMonth(bySchoolcharge);
if (listScope != null && listScope.size() > 0) {
bySchoolcharge.setId(listScope.get(0).getId());
startPage();
List<BySchoolcharge> list = bySchoolchargeService.selectByChildchargeList(bySchoolcharge);
if (list != null && list.size() > 0) {
for (int i = 0; i < list.size(); i++) {
list.get(i).setZj(getZongji(list.get(i)));
}
}
return getDataTable(list);
} else {
bySchoolcharge.setId(Long.valueOf(0));
List<BySchoolcharge> list = bySchoolchargeService.selectByChildchargeList(bySchoolcharge);
return getDataTable(list);
}
return getDataTable(list);
}
//根据每条幼儿统计数计算总费用
@ -154,7 +164,23 @@ public class BySchoolchargeController extends BaseController {
@Log(title = "园所收费标准", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody BySchoolcharge bySchoolcharge) {
return toAjax(bySchoolchargeService.updateBySchoolcharge(bySchoolcharge));
int iCount = 0;
BySchoolcharge bySchoolchargeNew = bySchoolchargeService.selectBySchoolchargeById(bySchoolcharge.getId());
if (bySchoolcharge.getStartTime().equals(bySchoolchargeNew.getStartTime())) {
if (bySchoolcharge.getEndtime().equals(bySchoolchargeNew.getEndtime())) {
iCount = iCount + bySchoolchargeService.updateBySchoolcharge(bySchoolcharge);
} else {
bySchoolchargeNew.setIsdel("1");
iCount = iCount + bySchoolchargeService.updateBySchoolcharge(bySchoolchargeNew);
iCount = iCount + bySchoolchargeService.insertBySchoolcharge(bySchoolcharge);
}
} else {
bySchoolchargeNew.setIsdel("1");
iCount = iCount + bySchoolchargeService.updateBySchoolcharge(bySchoolchargeNew);
iCount = iCount + bySchoolchargeService.insertBySchoolcharge(bySchoolcharge);
}
return toAjax(iCount);
}
/**

View File

@ -1,11 +1,14 @@
package com.ruoyi.project.benyi.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.project.system.domain.SysDept;
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;
import java.util.Date;
/**
* 园所收费标准对象 by_schoolcharge
*
@ -80,10 +83,58 @@ public class BySchoolcharge extends BaseEntity {
@Excel(name = "伙食费中班")
private Double hsfZ;
/**
* 起止时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
private Date startTime;
public Date getStartTime() {
return startTime;
}
public void setStartTime(Date startTime) {
this.startTime = startTime;
}
public Date getEndtime() {
return endtime;
}
public void setEndtime(Date endtime) {
this.endtime = endtime;
}
/**
* 起止时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
private Date endtime;
public String getIsdel() {
return isdel;
}
public void setIsdel(String isdel) {
this.isdel = isdel;
}
private String isdel;
private SysDept dept;
// 幼儿考勤系统属性
private String month;
public String getMonthday() {
return monthday;
}
public void setMonthday(String monthday) {
this.monthday = monthday;
}
private String monthday;
private String name;
private String classid;
private Long days;
@ -256,6 +307,10 @@ public class BySchoolcharge extends BaseEntity {
.append("bjtype", getBjtype())
.append("days", getDays())
.append("zj", getZj())
.append("startTime",getStartTime())
.append("endtime",getEndtime())
.append("isdel",getIsdel())
.append("monthday",getMonthday())
.toString();
}
}

View File

@ -35,6 +35,14 @@ public interface BySchoolchargeMapper {
*/
public List<BySchoolcharge> selectByChildchargeList(BySchoolcharge bySchoolcharge);
/**
* 查询幼儿收费列表
*
* @param bySchoolcharge 收费标准
* @return 幼儿收费集合
*/
public List<BySchoolcharge> selectByChildchargeListByMonth(BySchoolcharge bySchoolcharge);
/**
* 新增园所收费标准
*

View File

@ -35,6 +35,15 @@ public interface IBySchoolchargeService {
*/
public List<BySchoolcharge> selectByChildchargeList(BySchoolcharge bySchoolcharge);
/**
* 查询幼儿收费列表
*
* @param bySchoolcharge 收费标准
* @return 幼儿收费集合
*/
public List<BySchoolcharge> selectByChildchargeListByMonth(BySchoolcharge bySchoolcharge);
/**
* 新增园所收费标准
*

View File

@ -52,10 +52,22 @@ public class BySchoolchargeServiceImpl implements IBySchoolchargeService {
*/
@Override
@DataScope(deptAlias = "b")
public List<BySchoolcharge> selectByChildchargeList(BySchoolcharge bySchoolcharge){
public List<BySchoolcharge> selectByChildchargeList(BySchoolcharge bySchoolcharge) {
return bySchoolchargeMapper.selectByChildchargeList(bySchoolcharge);
}
/**
* 查询幼儿收费列表
*
* @param bySchoolcharge 收费标准
* @return 幼儿收费集合
*/
@Override
@DataScope(deptAlias = "b")
public List<BySchoolcharge> selectByChildchargeListByMonth(BySchoolcharge bySchoolcharge) {
return bySchoolchargeMapper.selectByChildchargeListByMonth(bySchoolcharge);
}
/**
* 新增园所收费标准
*

View File

@ -17,7 +17,11 @@
<result property="hsfT" column="hsf_t"/>
<result property="byfZ" column="byf_z"/>
<result property="hsfZ" column="hsf_z"/>
<result property="startTime" column="start_time"/>
<result property="endtime" column="endtime"/>
<result property="isdel" column="isdel"/>
<result property="month" column="month"/>
<result property="monthday" column="monthday"/>
<result property="name" column="name"/>
<result property="classid" column="classid"/>
<result property="days" column="days"/>
@ -35,13 +39,13 @@
</resultMap>
<sql id="selectBySchoolchargeVo">
select a.id, a.dept_id, a.byf, a.hsf, a.create_userid, a.create_time,a.byf_x, a.hsf_x, a.byf_t, a.hsf_t, a.byf_z, a.hsf_z,b.dept_name from by_schoolcharge a
select a.id, a.dept_id, a.byf, a.hsf, a.create_userid, a.create_time,a.byf_x, a.hsf_x, a.byf_t, a.hsf_t, a.byf_z, a.hsf_z,a.start_time,a.endtime,a.isdel,b.dept_name from by_schoolcharge a
right join sys_dept b on a.dept_id=b.dept_id
</sql>
<select id="selectBySchoolchargeList" parameterType="BySchoolcharge" resultMap="BySchoolchargeResult">
<include refid="selectBySchoolchargeVo"/>
where school_id is not null and del_flag=0
where school_id is not null and del_flag=0 and isdel=0
<if test="byf != null ">and byf = #{byf}</if>
<if test="hsf != null ">and hsf = #{hsf}</if>
<if test="createUserid != null ">and create_userid = #{createUserid}</if>
@ -49,6 +53,19 @@
${dataScope}
</select>
<select id="selectByChildchargeListByMonth" parameterType="BySchoolcharge" resultMap="BySchoolchargeResult">
<include refid="selectBySchoolchargeVo"/>
where school_id is not null and del_flag=0
<if test="monthday != null and monthday != ''"><!-- 开始时间检索 -->
AND date_format(start_time,'%y%m%d') &lt;= date_format(#{monthday},'%y%m%d')
</if>
<if test="monthday != null and monthday != ''"><!-- 结束时间检索 -->
AND date_format(endtime,'%y%m%d') &gt;= date_format(#{monthday},'%y%m%d')
</if>
<!-- 数据范围过滤 -->
${dataScope}
</select>
<select id="selectByChildchargeList" parameterType="BySchoolcharge" resultMap="BySchoolchargeResult">
select a.name,a.classid,
c.bjtype,
@ -59,7 +76,7 @@
from by_child a
left join by_class c on a.classid=c.bjbh
left join by_schoolcharge b on a.schoolid=b.dept_id
where c.bjbh = #{classid}
where c.bjbh = #{classid} and b.id=#{id}
<!-- 数据范围过滤 -->
${dataScope}
</select>
@ -83,6 +100,9 @@
<if test="hsfT != null ">hsf_t,</if>
<if test="byfZ != null and byfZ != ''">byf_z,</if>
<if test="hsfZ != null ">hsf_z,</if>
<if test="startTime != null ">start_time,</if>
<if test="endtime != null ">endtime,</if>
<if test="isdel != null and isdel != ''">isdel,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="deptId != null ">#{deptId},</if>
@ -96,6 +116,9 @@
<if test="hsfT != null ">#{hsfT},</if>
<if test="byfZ != null and byfZ != ''">#{byfZ},</if>
<if test="hsfZ != null ">#{hsfZ},</if>
<if test="startTime != null ">#{startTime},</if>
<if test="endtime != null ">#{endtime},</if>
<if test="isdel != null and isdel != ''">#{isdel},</if>
</trim>
</insert>
@ -113,6 +136,9 @@
<if test="hsfT != null ">hsf_t = #{hsfT},</if>
<if test="byfZ != null and byfZ != ''">byf_z = #{byfZ},</if>
<if test="hsfZ != null ">hsf_z = #{hsfZ},</if>
<if test="startTime != null ">start_time = #{startTime},</if>
<if test="endtime != null ">endtime = #{endtime},</if>
<if test="isdel != null and isdel != ''">isdel = #{isdel},</if>
</trim>
where id = #{id}
</update>