Authored by zhaoyue

ADD code for uspih

... ... @@ -3,6 +3,7 @@ package com.xkl.authorization.resolvers;
import com.xkl.authorization.annotation.CurrentAdmin;
import com.xkl.config.Constants;
import com.xkl.controller.uploadsoft.UpSoftAccountController;
import com.xkl.controller.uspih.AdminAccountController;
import com.xkl.domain.XklAdminEntity;
import com.xkl.repository.AdminRepository;
import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -39,7 +40,8 @@ public class CurrentAdminMethodArgumentResolver implements HandlerMethodArgument
@Override
public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer, NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception {
//取出鉴权时存入的登录用户Id
String currentAdminId = ((String) webRequest.getAttribute(Constants.CURRENT_USER_ID, RequestAttributes.SCOPE_REQUEST)).replace(UpSoftAccountController.UPSOFT_TOKEN_PREFIX, "");
String currentAdminId = ((String) webRequest.getAttribute(Constants.CURRENT_USER_ID, RequestAttributes.SCOPE_REQUEST)).
replace(UpSoftAccountController.UPSOFT_TOKEN_PREFIX, "").replace(AdminAccountController.USPIH_TOKEN_PREFIX, "");
if (currentAdminId != null) {
//从数据库中查询并返回
XklAdminEntity admin = adminRepository.findByIdAndStatus(Long.parseLong(currentAdminId), Constants.STATUS_OK);
... ...
... ... @@ -127,6 +127,8 @@ public class ReportService implements IReportService {
reportRepository.delete(report);
List<XklAmpReportDetailEntity> detailList = reportDetailRepository.findByReportId(report.getId());
reportDetailRepository.delete(detailList);
List<XklAmpReportResultEntity> rpResList = reportResultRepository.findByReportId(report.getId());
reportResultRepository.delete(rpResList);
return new ResponseEntity<>(ResultModel.ok(), HttpStatus.OK);
}
... ...