三表一册为了测试将数据改成定制月

This commit is contained in:
方亮 2025-10-23 17:52:46 +08:00
parent 235582756c
commit 5b4fb4d5b3
2 changed files with 24 additions and 14 deletions

View File

@ -300,7 +300,7 @@
delete from sys_user_home_page where user_id = #{userId}
</select>
<select id="addMenu" resultType="java.lang.Integer">
<insert id="addMenu">
INSERT INTO sys_user_home_page( user_id, permission_id)
VALUES
<foreach item="item" collection="list" separator="," index="index" >
@ -308,5 +308,5 @@
#{item.id},#{item.name}
)
</foreach>
</select>
</insert>
</mapper>

View File

@ -42,21 +42,31 @@ public class ThreeTableOneRosterTask {
*/
public void createThreeTableOneRosterData(){
try{
// // 获取当前年月
// YearMonth current = YearMonth.now();
// // 获取上一个月
// YearMonth lastMonth = current.minusMonths(1);
// // 本月第一天
// LocalDate firstDayOfThisMonth = YearMonth.now().atDay(1);
// // 上个月第一天先得到本月第一天再减一个月
// LocalDate firstDayOfLastMonth = YearMonth.now().minusMonths(1).atDay(1);
//
// // 获取上一个月的天数即该月最后一天是几号
// int daysInLastMonth = lastMonth.lengthOfMonth();
//
// String startTime = firstDayOfLastMonth.format(FORMATTER)+" 00:00:00";
// String endTime = firstDayOfThisMonth.format(FORMATTER)+" 00:00:00";
// 获取当前年月
YearMonth current = YearMonth.now();
String current = "2025-11";
// 获取上一个月
YearMonth lastMonth = current.minusMonths(1);
// 本月第一天
LocalDate firstDayOfThisMonth = YearMonth.now().atDay(1);
// 上个月第一天先得到本月第一天再减一个月
LocalDate firstDayOfLastMonth = YearMonth.now().minusMonths(1).atDay(1);
String lastMonth = "2025-10";
// 获取上一个月的天数即该月最后一天是几号
int daysInLastMonth = lastMonth.lengthOfMonth();
String startTime = firstDayOfLastMonth.format(FORMATTER)+" 00:00:00";
String endTime = firstDayOfThisMonth.format(FORMATTER)+" 00:00:00";
int daysInLastMonth = 30;
String startTime = "2025-10-01"+" 00:00:00";
String endTime = "2025-11-01"+" 00:00:00";
//先去检测上一月是否已经生成三表一册
boolean isExist = mapper.getThreeTableOneRosterDataByLastMonth(lastMonth.toString());
@ -71,7 +81,7 @@ public class ThreeTableOneRosterTask {
List<ThreeTableOneRosterPo> listApply = mapper.getWorkerApplyData(lastMonth.toString(),mapBeanVo.getId());
//3.考勤明细表
List<ThreeTableOneRosterPo> listAtt = mapper.getWorkerAttData(lastMonth.toString(),mapBeanVo.getId());
List<ThreeTableOneRosterPo> listAttDeal = dealAttData(listAtt,lastMonth);
List<ThreeTableOneRosterPo> listAttDeal = dealAttData(listAtt,YearMonth.parse(lastMonth));
//4.农民工资支付表
// 数据串联生成工资支付数据
// 通过workerId,proId将listApplylistAttDeal数据填充到listRoster