Commit 516891f7 authored by lisong's avatar lisong

修改bug

parent 05e94e43
......@@ -529,8 +529,19 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
Map<Date, Long> dutyPersonShiftMap = dutyPersonShiftsDb.stream()
.collect(Collectors.toMap(DutyPersonShift::getDutyDate, DutyPersonShift::getSequenceNbr));
// todo: 只更新当天及值班之后数据
// 修复导入当天值班数据bug
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
String format = simpleDateFormat.format(new Date());
Date date = null;
try {
date = simpleDateFormat.parse(format);
} catch (ParseException e) {
e.printStackTrace();
}
Date finalDate = date;
Set<DutyPersonShift> needToDb = shiftDtos.stream()
.filter(s -> DateUtils.dateCompare(s.getDutyDate(), new Date()) >= 0).map(shiftDto -> {
.filter(s -> DateUtils.dateCompare(s.getDutyDate(), finalDate) >= 0).map(shiftDto -> {
DutyPersonShift dutyPersonShift = new DutyPersonShift();
Bean.copyExistPropertis(shiftDto, dutyPersonShift);
dutyPersonShift.setInstanceId(finalInstanceId);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment