Commit 8c1099cf authored by huyuchen's avatar huyuchen

假勤信息优化修改

parent c12dcc1a
......@@ -21,6 +21,7 @@ import org.springframework.web.bind.annotation.*;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -169,8 +170,17 @@ public class TBusLeaveController {
}
int i = 1;
List<TBusLeave> updateLsit = new ArrayList<>();
Map<String,String> map = new HashMap<>();
for (TBusLeave tBusLeave : leaveList) {
i++;
if (Common.isNotNull(tBusLeave.getTeleNo()) && Common.isNotNull(tBusLeave.getName())) {
if (null != map.get(tBusLeave.getTeleNo()) &&
tBusLeave.getName().equals(map.get(tBusLeave.getTeleNo()))) {
errorList.add(new ErrorMessage(i, "'" + tBusLeave.getTeleNo() + "'工号员工已离职,请核实无误后再操作!"));
} else {
map.put(tBusLeave.getTeleNo(), tBusLeave.getName());
}
}
if (Common.isEmpty(tBusLeave.getLeaveDate()) || Common.isEmpty(tBusLeave.getLeavePostDate())
|| Common.isEmpty(tBusLeave.getLeaveReason()) || tBusLeave.getLeaveReason().length() > 200) {
// 判断并拦截
......@@ -180,6 +190,9 @@ public class TBusLeaveController {
this.saveAndJudge(user, nows, errorList, empMap, i, updateLsit, tBusLeave);
}
}
if (!map.isEmpty()) {
map.clear();
}
// 更新人员信息
this.batchUpdateEmpInfo(updateLsit);
return R.ok(errorList,"操作成功");
......@@ -196,22 +209,27 @@ public class TBusLeaveController {
**/
private void judgeLeave(List<ErrorMessage> errorList, int i, TBusLeave tBusLeave) {
String error;
if (Common.isEmpty(tBusLeave.getLeaveDate())) {
error = "'" + tBusLeave.getTeleNo() + "'工号无离职日期,无法导入!";
errorList.add(new ErrorMessage(i, error));
}
if (Common.isEmpty(tBusLeave.getLeavePostDate())) {
error = "'" + tBusLeave.getTeleNo() + "'工号无离岗日期,无法导入!";
errorList.add(new ErrorMessage(i, error));
}
if (Common.isEmpty(tBusLeave.getLeaveReason())) {
error = "'" + tBusLeave.getTeleNo() + "'工号无离职原因,无法导入!";
errorList.add(new ErrorMessage(i, error));
}
if (Common.isNotNull(tBusLeave.getLeaveReason()) && tBusLeave.getLeaveReason().length() > 200) {
error = "'" + tBusLeave.getTeleNo() + "'工号离职原因超过200字符,无法导入!";
errorList.add(new ErrorMessage(i, error));
}
if (Common.isEmpty(tBusLeave.getTeleNo())) {
error = "'" + "'电信工号为空,无法导入!";
errorList.add(new ErrorMessage(i, error));
} else {
if (Common.isEmpty(tBusLeave.getLeaveDate())) {
error = "'" + tBusLeave.getTeleNo() + "'工号无离职日期,无法导入!";
errorList.add(new ErrorMessage(i, error));
}
if (Common.isEmpty(tBusLeave.getLeavePostDate())) {
error = "'" + tBusLeave.getTeleNo() + "'工号无离岗日期,无法导入!";
errorList.add(new ErrorMessage(i, error));
}
if (Common.isEmpty(tBusLeave.getLeaveReason())) {
error = "'" + tBusLeave.getTeleNo() + "'工号无离职原因,无法导入!";
errorList.add(new ErrorMessage(i, error));
}
if (Common.isNotNull(tBusLeave.getLeaveReason()) && tBusLeave.getLeaveReason().length() > 200) {
error = "'" + tBusLeave.getTeleNo() + "'工号离职原因超过200字符,无法导入!";
errorList.add(new ErrorMessage(i, error));
}
}
}
/**
......
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