Commit 0b7342f6 authored by 赵啸非's avatar 赵啸非

员工修改为缓存模式

parent a4d296ed
...@@ -16,4 +16,7 @@ public class StaffVo extends BaseEntityLong { ...@@ -16,4 +16,7 @@ public class StaffVo extends BaseEntityLong {
private List <Long> idList; private List <Long> idList;
private List<holidayInfoVo> holidayInfoVoList;
} }
\ No newline at end of file
package com.mortals.xhx.module.staff.model.vo;
import lombok.Data;
@Data
public class holidayInfoVo {
//调休
//private Integer
}
package com.mortals.xhx.module.staff.service; package com.mortals.xhx.module.staff.service;
import com.mortals.framework.service.ICRUDCacheService;
import com.mortals.framework.service.ICRUDService; import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.staff.model.StaffEntity; import com.mortals.xhx.module.staff.model.StaffEntity;
/** /**
...@@ -9,6 +10,6 @@ import com.mortals.xhx.module.staff.model.StaffEntity; ...@@ -9,6 +10,6 @@ import com.mortals.xhx.module.staff.model.StaffEntity;
* @author zxfei * @author zxfei
* @date 2023-04-07 * @date 2023-04-07
*/ */
public interface StaffService extends ICRUDService<StaffEntity,Long>{ public interface StaffService extends ICRUDCacheService<StaffEntity,Long> {
} }
\ No newline at end of file
package com.mortals.xhx.module.staff.service.impl; package com.mortals.xhx.module.staff.service.impl;
import com.mortals.framework.service.impl.AbstractCRUDCacheServiceImpl;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl; import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
...@@ -6,14 +8,20 @@ import com.mortals.framework.model.Context; ...@@ -6,14 +8,20 @@ import com.mortals.framework.model.Context;
import com.mortals.xhx.module.staff.dao.StaffDao; import com.mortals.xhx.module.staff.dao.StaffDao;
import com.mortals.xhx.module.staff.model.StaffEntity; import com.mortals.xhx.module.staff.model.StaffEntity;
import com.mortals.xhx.module.staff.service.StaffService; import com.mortals.xhx.module.staff.service.StaffService;
/** /**
* StaffService * StaffService
* 员工基本信息 service实现 * 员工基本信息 service实现
* *
* @author zxfei * @author zxfei
* @date 2023-04-07 * @date 2023-04-07
*/ */
@Service("staffService") @Service("staffService")
public class StaffServiceImpl extends AbstractCRUDServiceImpl<StaffDao, StaffEntity, Long> implements StaffService { public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, StaffEntity, Long> implements StaffService {
@Override
protected String getExtKey(StaffEntity data) {
//工号作为redis 扩展key
return data.getWorkNum();
}
} }
\ No newline at end of file
...@@ -15,12 +15,10 @@ import com.mortals.xhx.module.staff.model.StaffEntity; ...@@ -15,12 +15,10 @@ import com.mortals.xhx.module.staff.model.StaffEntity;
import com.mortals.xhx.module.staff.service.StaffService; import com.mortals.xhx.module.staff.service.StaffService;
import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils; import com.mortals.framework.util.StringUtils;
import java.util.HashMap;
import java.util.List; import java.util.*;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import java.util.Arrays;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*; import static com.mortals.framework.ap.SysConstains.*;
...@@ -61,4 +59,15 @@ public class StaffController extends BaseCRUDJsonBodyMappingController<StaffServ ...@@ -61,4 +59,15 @@ public class StaffController extends BaseCRUDJsonBodyMappingController<StaffServ
protected int doListAfter(StaffEntity query, Map<String, Object> model, Context context) throws AppException { protected int doListAfter(StaffEntity query, Map<String, Object> model, Context context) throws AppException {
return super.doListAfter(query, model, context); return super.doListAfter(query, model, context);
} }
@Override
protected int infoAfter(Long id, Map<String, Object> model, StaffEntity entity, Context context) throws AppException {
//todo 员工统计信息
entity.setHolidayInfoVoList(new ArrayList<>());
// StaffEntity cache = this.service.getCache(entity.getWorkNum());
return super.infoAfter(id, model, entity, context);
}
} }
\ 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