Commit dd83730b authored by 廖旭伟's avatar 廖旭伟

页面保存请假记录bug修改

parent 52d70cdf
...@@ -21,6 +21,8 @@ import com.mortals.xhx.module.attendance.model.AttendanceLeaveRecordQuery; ...@@ -21,6 +21,8 @@ import com.mortals.xhx.module.attendance.model.AttendanceLeaveRecordQuery;
import com.mortals.xhx.module.attendance.service.AttendanceLeaveRecordService; import com.mortals.xhx.module.attendance.service.AttendanceLeaveRecordService;
import com.mortals.xhx.module.dept.model.DeptQuery; import com.mortals.xhx.module.dept.model.DeptQuery;
import com.mortals.xhx.module.dept.service.DeptService; import com.mortals.xhx.module.dept.service.DeptService;
import com.mortals.xhx.module.staff.model.StaffEntity;
import com.mortals.xhx.module.staff.service.StaffService;
import com.mortals.xhx.module.workman.model.WorkmanQuery; import com.mortals.xhx.module.workman.model.WorkmanQuery;
import com.mortals.xhx.module.workman.service.WorkmanService; import com.mortals.xhx.module.workman.service.WorkmanService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -56,6 +58,8 @@ public class AttendanceLeaveRecordController extends BaseCRUDJsonBodyMappingCont ...@@ -56,6 +58,8 @@ public class AttendanceLeaveRecordController extends BaseCRUDJsonBodyMappingCont
private WorkmanService workmanService; private WorkmanService workmanService;
@Autowired @Autowired
private UserService userService; private UserService userService;
@Autowired
private StaffService staffService;
// @Autowired // @Autowired
// private IUserFeign iUserFeign; // private IUserFeign iUserFeign;
...@@ -124,5 +128,22 @@ public class AttendanceLeaveRecordController extends BaseCRUDJsonBodyMappingCont ...@@ -124,5 +128,22 @@ public class AttendanceLeaveRecordController extends BaseCRUDJsonBodyMappingCont
return jsonObject.toJSONString(); return jsonObject.toJSONString();
} }
@Override
protected void saveBefore(AttendanceLeaveRecordEntity entity, Map<String, Object> model, Context context) throws AppException {
if(entity.getStaffId()!=null){
StaffEntity staffEntity = staffService.getCache(entity.getLeavePersonId().toString());
if(staffEntity!=null){
entity.setLeavePerson(staffEntity.getName());
entity.setDeptId(staffEntity.getDeptId());
entity.setDeptName(staffEntity.getDeptName());
entity.setSalaId(staffEntity.getSalaId());
entity.setSalaName(staffEntity.getSalaName());
}else {
throw new AppException("人员id不正取");
}
}else {
throw new AppException("人员id不能为空");
}
}
} }
\ No newline at end of file
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