|
|
@ -187,15 +187,37 @@ public class ScheduleServiceImpl implements ScheduleService { |
|
|
@Override |
|
|
@Override |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
public void batchUpdateOperatorTime(Map<String, Object> inData) { |
|
|
public void batchUpdateOperatorTime(Map<String, Object> inData) { |
|
|
|
|
|
String site = (String) inData.get("site"); |
|
|
|
|
|
String orderNo = (String) inData.get("orderNo"); |
|
|
|
|
|
Integer itemNo = (Integer) inData.get("itemNo"); |
|
|
|
|
|
// seqNo 可能是 String 或 Integer,需要安全转换 |
|
|
|
|
|
Object seqNoObj = inData.get("seqNo"); |
|
|
|
|
|
String seqNo = seqNoObj != null ? String.valueOf(seqNoObj) : null; |
|
|
|
|
|
|
|
|
|
|
|
// 处理需要下岗的人员(设置 is_on_duty = 'N') |
|
|
@SuppressWarnings("unchecked") |
|
|
@SuppressWarnings("unchecked") |
|
|
List<Map<String, Object>> operatorList = (List<Map<String, Object>>) inData.get("operatorList"); |
|
|
|
|
|
if (operatorList != null && !operatorList.isEmpty()) { |
|
|
|
|
|
for (Map<String, Object> operator : operatorList) { |
|
|
|
|
|
operator.put("site", inData.get("site")); |
|
|
|
|
|
operator.put("orderNo", inData.get("orderNo")); |
|
|
|
|
|
operator.put("itemNo", inData.get("itemNo")); |
|
|
|
|
|
operator.put("seqNo", inData.get("seqNo")); |
|
|
|
|
|
scheduleMapper.updateOperatorTime(operator); |
|
|
|
|
|
|
|
|
List<Map<String, Object>> offDutyList = (List<Map<String, Object>>) inData.get("offDutyList"); |
|
|
|
|
|
if (offDutyList != null && !offDutyList.isEmpty()) { |
|
|
|
|
|
for (Map<String, Object> operator : offDutyList) { |
|
|
|
|
|
operator.put("site", site); |
|
|
|
|
|
operator.put("orderNo", orderNo); |
|
|
|
|
|
operator.put("itemNo", itemNo); |
|
|
|
|
|
operator.put("seqNo", seqNo); |
|
|
|
|
|
operator.put("isOnDuty", "N"); |
|
|
|
|
|
scheduleMapper.removeOperatorOnDuty(operator); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 处理只需要更新上岗时间的人员 |
|
|
|
|
|
@SuppressWarnings("unchecked") |
|
|
|
|
|
List<Map<String, Object>> updateOnDutyList = (List<Map<String, Object>>) inData.get("updateOnDutyList"); |
|
|
|
|
|
if (updateOnDutyList != null && !updateOnDutyList.isEmpty()) { |
|
|
|
|
|
for (Map<String, Object> operator : updateOnDutyList) { |
|
|
|
|
|
operator.put("site", site); |
|
|
|
|
|
operator.put("orderNo", orderNo); |
|
|
|
|
|
operator.put("itemNo", itemNo); |
|
|
|
|
|
operator.put("seqNo", seqNo); |
|
|
|
|
|
scheduleMapper.updateOnDutyTime(operator); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|