Commit cec8bf41 authored by 赵啸非's avatar 赵啸非

添加目录字段

parent 28d9c9cd
......@@ -22,9 +22,9 @@ import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.Method;
import java.util.List;
@Aspect
//@Aspect
@Slf4j
@Component
//@Component
public class DataPermissionAspect {
@Autowired
......
......@@ -9,6 +9,7 @@ import com.mortals.xhx.module.certificate.model.CertificateDocumentQuery;
import com.mortals.xhx.module.certificate.service.CertificateDocumentService;
import com.mortals.xhx.module.device.model.DeviceEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
......@@ -70,6 +71,19 @@ public class ChildLicenseController extends BaseCRUDJsonBodyMappingController<Ch
return super.list(query);
}
@Override
protected void doListBefore(ChildLicenseEntity query, Map<String, Object> model, Context context) throws AppException {
if(!ObjectUtils.isEmpty(context.getUser())){
Long deptId = context.getUser().getDeptId();
if(!context.getUser().isAdmin()){
query.setDeptId(deptId);
}
}
super.doListBefore(query, model, context);
}
@Override
protected void doListAfter(ChildLicenseEntity query, List<ChildLicenseEntity> list, Context context) throws AppException {
list.forEach(item -> {
......
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