|
|
@@ -136,7 +136,7 @@ public class StaffSchedule extends AbstractDomain<String, StaffSchedulePo>{
|
|
|
EmployeeInfoPo employeeInfoPo = employeeInfoRepository.get(staffScheduleDetailPo.getUserId());
|
|
|
|
|
|
// 添加修改记录 即 调班申请记录
|
|
|
- addAdjustRecord(newDate,oldDate,staffScheduleDetailPo.getId());
|
|
|
+ addAdjustRecord(newDate,oldDate,staffScheduleDetailPo.getId(),getData().getId());
|
|
|
|
|
|
for (Map<String, String> entry : newDate) {
|
|
|
String dateStr = entry.get("date");
|
|
|
@@ -213,7 +213,7 @@ public class StaffSchedule extends AbstractDomain<String, StaffSchedulePo>{
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void addAdjustRecord(List<Map<String,String>> newDateList,List<Map<String,String>> oldDateList,String scheduleId) {
|
|
|
+ private void addAdjustRecord(List<Map<String,String>> newDateList,List<Map<String,String>> oldDateList,String scheduleDetailId,String scheduleId) {
|
|
|
boolean areEqualIgnoreOrder = new HashSet<>(newDateList).equals(new HashSet<>(oldDateList))&& newDateList.size() == oldDateList.size();
|
|
|
if (!areEqualIgnoreOrder) {
|
|
|
AdjustmentPo adjustmentPo = new AdjustmentPo();
|
|
|
@@ -233,6 +233,7 @@ public class StaffSchedule extends AbstractDomain<String, StaffSchedulePo>{
|
|
|
List<AdjustmentDetailPo> adjustmentDetailPoList = new ArrayList<>();
|
|
|
adjustmentPo.setReason("排班修改");
|
|
|
adjustmentPo.setType("排班修改");
|
|
|
+ adjustmentPo.setScheduleId(scheduleId);
|
|
|
for (Map<String, String> newMap : newDateList) {
|
|
|
for (Map<String, String> oldMap : oldDateList) {
|
|
|
String newValue = StrUtil.str(newMap.get("value"));
|
|
|
@@ -244,7 +245,7 @@ public class StaffSchedule extends AbstractDomain<String, StaffSchedulePo>{
|
|
|
newValue = newValue.isEmpty() ?"无":newValue;
|
|
|
AdjustmentDetailPo adjustmentDetailPo = new AdjustmentDetailPo();
|
|
|
adjustmentDetailPo.setCreateBy(ContextUtil.getCurrentUserId());
|
|
|
- adjustmentDetailPo.setRecordId(scheduleId);
|
|
|
+ adjustmentDetailPo.setRecordId(scheduleDetailId);
|
|
|
adjustmentDetailPo.setBeforeAdjust(oldValue);
|
|
|
adjustmentDetailPo.setBeforeDate(oldDate);
|
|
|
adjustmentDetailPo.setAfterAdjust(newValue);
|