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

Merge remote-tracking branch 'origin/first' into first

parents 54631aa8 cec8bf41
......@@ -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
......@@ -34,7 +34,7 @@ public class DataPermissionAspect {
public static final String DATA_PERMISSION_SEARCH_SQL = "DATA_PERMISSION_SEARCH_SQL";
@Pointcut("execution(public * com.mortals..*Controller.*(..))")
@Pointcut("execution(public * com.mortals..ChildLicenseController.*(..))")
public void pointCut() {
}
......
......@@ -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