Commit ef4476d1 by 李小龙 Committed by huangjy

fix:

parent 34e219e4
......@@ -5,12 +5,10 @@ import com.makeit.common.dto.BaseIdDTO;
import com.makeit.common.response.ApiResponseEntity;
import com.makeit.common.response.ApiResponseUtils;
import com.makeit.dto.saas.analysis.SaasDiseaseEvaluateReportDTO;
import com.makeit.dto.saas.analysis.SaasSleepEvaluateReportDTO;
import com.makeit.entity.saas.analysis.SaasDiseaseEvaluateReport;
import com.makeit.entity.saas.analysis.SaasSleepEvaluateReport;
import com.makeit.global.annotation.Action;
import com.makeit.service.saas.SaasDiseaseEvaluateReportService;
import com.makeit.service.saas.SaasSleepEvaluateReportService;
import com.makeit.service.saas.SaasOperationLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -37,11 +35,15 @@ public class SaasDiseaseEvaluateReportController {
@Autowired
private SaasDiseaseEvaluateReportService saasDiseaseEvaluateReportService;
@Autowired
private SaasOperationLogService saasOperationLogService;
@Action(module = "报告管理-呼吸心率慢性病模型评估结果", name = "详情", code = "saas:diseaseEvaluateReport:view")
@ApiOperation("详情")
@PostMapping("view")
public ApiResponseEntity<SaasDiseaseEvaluateReport> view(@RequestBody BaseIdDTO dto) {
saasOperationLogService.add("saas端-报告管理-呼吸心率慢性病模型评估结果-详情", null);
return ApiResponseUtils.success(saasDiseaseEvaluateReportService.view(dto.getId()));
}
......@@ -50,6 +52,7 @@ public class SaasDiseaseEvaluateReportController {
@PostMapping("add")
public ApiResponseEntity<Void> add(@Validated @RequestBody SaasDiseaseEvaluateReportDTO dto) {
saasDiseaseEvaluateReportService.add(dto);
saasOperationLogService.add("saas端-报告管理-呼吸心率慢性病模型评估结果-新增", null);
return ApiResponseUtils.success();
}
......@@ -58,6 +61,7 @@ public class SaasDiseaseEvaluateReportController {
@PostMapping("edit")
public ApiResponseEntity<Void> edit(@Validated @RequestBody SaasDiseaseEvaluateReportDTO dto) {
saasDiseaseEvaluateReportService.edit(dto);
saasOperationLogService.add("saas端-报告管理-呼吸心率慢性病模型评估结果-编辑", null);
return ApiResponseUtils.success();
}
}
......
......@@ -8,6 +8,7 @@ import com.makeit.dto.saas.analysis.SaasDiseaseModelDTO;
import com.makeit.entity.saas.analysis.SaasDiseaseModel;
import com.makeit.global.annotation.Action;
import com.makeit.service.saas.SaasDiseaseModelService;
import com.makeit.service.saas.SaasOperationLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -33,12 +34,14 @@ public class SaasDiseaseModelController {
@Autowired
private SaasDiseaseModelService saasDiseaseModelService;
@Autowired
private SaasOperationLogService saasOperationLogService;
@Action(module = "模型管理-呼吸心率慢性病模型", name = "详情", code = "saas:diseaseModel:view")
@ApiOperation("详情")
@PostMapping("view")
public ApiResponseEntity<SaasDiseaseModel> view(@RequestBody BaseIdDTO dto) {
saasOperationLogService.add("saas端-模型管理-呼吸心率慢性病模型-详情", null);
return ApiResponseUtils.success(saasDiseaseModelService.view(dto.getId()));
}
......@@ -48,6 +51,7 @@ public class SaasDiseaseModelController {
public ApiResponseEntity<Void> add(@Validated @RequestBody SaasDiseaseModelDTO dto) {
;
saasDiseaseModelService.add(dto);
saasOperationLogService.add("saas端-模型管理-呼吸心率慢性病模型-新增", null);
return ApiResponseUtils.success();
}
......@@ -56,6 +60,7 @@ public class SaasDiseaseModelController {
@PostMapping("edit")
public ApiResponseEntity<Void> edit(@Validated @RequestBody SaasDiseaseModelDTO dto) {
saasDiseaseModelService.edit(dto);
saasOperationLogService.add("saas端-模型管理-呼吸心率慢性病模型-编辑", null);
return ApiResponseUtils.success();
}
}
......
......@@ -6,10 +6,9 @@ import com.makeit.common.response.ApiResponseEntity;
import com.makeit.common.response.ApiResponseUtils;
import com.makeit.dto.saas.analysis.SaasSleepEvaluateReportDTO;
import com.makeit.entity.saas.analysis.SaasDiseaseReport;
import com.makeit.entity.saas.analysis.SaasSleepEvaluateReport;
import com.makeit.global.annotation.Action;
import com.makeit.service.saas.SaasDiseaseReportService;
import com.makeit.service.saas.SaasSleepEvaluateReportService;
import com.makeit.service.saas.SaasOperationLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -35,12 +34,15 @@ public class SaasDiseaseReportController {
@Autowired
private SaasDiseaseReportService saasDiseaseReportService;
@Autowired
private SaasOperationLogService saasOperationLogService;
@Action(module = "报告管理-呼吸心率慢性病报告", name = "详情", code = "saas:diseaseReport:view")
@ApiOperation("详情")
@PostMapping("view")
public ApiResponseEntity<SaasDiseaseReport> view(@RequestBody BaseIdDTO dto) {
saasOperationLogService.add("saas端-报告管理-呼吸心率慢性病报告-详情", null);
return ApiResponseUtils.success(saasDiseaseReportService.view(dto.getId()));
}
......@@ -48,7 +50,10 @@ public class SaasDiseaseReportController {
@ApiOperation("新增")
@PostMapping("add")
public ApiResponseEntity<Void> add(@Validated @RequestBody SaasSleepEvaluateReportDTO dto) {
saasDiseaseReportService.add(dto);
saasOperationLogService.add("saas端-报告管理-呼吸心率慢性病报告-新增", null);
return ApiResponseUtils.success();
}
......@@ -57,6 +62,8 @@ public class SaasDiseaseReportController {
@PostMapping("edit")
public ApiResponseEntity<Void> edit(@Validated @RequestBody SaasSleepEvaluateReportDTO dto) {
saasDiseaseReportService.edit(dto);
saasOperationLogService.add("saas端-报告管理-呼吸心率慢性病报告-编辑", null);
return ApiResponseUtils.success();
}
}
......
......@@ -8,6 +8,7 @@ import com.makeit.dto.saas.analysis.SaasElderReportConfigDTO;
import com.makeit.entity.saas.analysis.SaasElderReportConfig;
import com.makeit.global.annotation.Action;
import com.makeit.service.saas.SaasElderReportConfigService;
import com.makeit.service.saas.SaasOperationLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -31,12 +32,15 @@ import org.springframework.web.bind.annotation.RestController;
public class SaasElderReportConfigController {
@Autowired
private SaasElderReportConfigService saasElderReportConfigService;
@Autowired
private SaasOperationLogService saasOperationLogService;
@Action(module = "报告管理-长者报告", name = "详情", code = "saas:elderReportConfig:view")
@ApiOperation("详情")
@PostMapping("view")
public ApiResponseEntity<SaasElderReportConfig> view(@RequestBody BaseIdDTO dto) {
saasOperationLogService.add("saas端-报告管理-长者报告配置-详情", null);
return ApiResponseUtils.success(saasElderReportConfigService.view(dto.getId()));
}
......@@ -45,6 +49,8 @@ public class SaasElderReportConfigController {
@PostMapping("add")
public ApiResponseEntity<Void> add(@Validated @RequestBody SaasElderReportConfigDTO dto) {
saasElderReportConfigService.add(dto);
saasOperationLogService.add("saas端-报告管理-长者报告配置-新增", null);
return ApiResponseUtils.success();
}
......@@ -53,6 +59,8 @@ public class SaasElderReportConfigController {
@PostMapping("edit")
public ApiResponseEntity<Void> edit(@Validated @RequestBody SaasElderReportConfigDTO dto) {
saasElderReportConfigService.edit(dto);
saasOperationLogService.add("saas端-报告管理-长者报告配置-编辑", null);
return ApiResponseUtils.success();
}
......
......@@ -7,7 +7,7 @@ import com.makeit.common.response.ApiResponseUtils;
import com.makeit.dto.saas.analysis.SaasSleepAnalysisModelDTO;
import com.makeit.entity.saas.analysis.SaasSleepAnalysisModel;
import com.makeit.global.annotation.Action;
import com.makeit.module.admin.dto.plat.PlatTenantDTOVO;
import com.makeit.service.saas.SaasOperationLogService;
import com.makeit.service.saas.SaasSleepAnalysisModelService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -34,12 +34,14 @@ public class SaasSleepAnalysisModelController {
@Autowired
private SaasSleepAnalysisModelService saasSleepAnalysisModelService;
@Autowired
private SaasOperationLogService saasOperationLogService;
@Action(module = "模型管理-睡眠质量分析模型", name = "详情", code = "saas:sleepAnalysisModel:view")
@ApiOperation("详情")
@PostMapping("view")
public ApiResponseEntity<SaasSleepAnalysisModel> view(@RequestBody BaseIdDTO dto){
saasOperationLogService.add("saas端-模型管理-睡眠质量分析模型-详情", null);
return ApiResponseUtils.success(saasSleepAnalysisModelService.view(dto.getId()));
}
......@@ -48,6 +50,7 @@ public class SaasSleepAnalysisModelController {
@PostMapping("add")
public ApiResponseEntity<Void> add(@Validated @RequestBody SaasSleepAnalysisModelDTO dto){ ;
saasSleepAnalysisModelService.add(dto);
saasOperationLogService.add("saas端-模型管理-睡眠质量分析模型-新增", null);
return ApiResponseUtils.success();
}
......@@ -56,6 +59,7 @@ public class SaasSleepAnalysisModelController {
@PostMapping("edit")
public ApiResponseEntity<Void> edit(@Validated @RequestBody SaasSleepAnalysisModelDTO dto){
saasSleepAnalysisModelService.edit(dto);
saasOperationLogService.add("saas端-模型管理-睡眠质量分析模型-编辑", null);
return ApiResponseUtils.success();
}
......
......@@ -7,6 +7,7 @@ import com.makeit.common.response.ApiResponseUtils;
import com.makeit.dto.saas.analysis.SaasSleepEvaluateReportDTO;
import com.makeit.entity.saas.analysis.SaasSleepEvaluateReport;
import com.makeit.global.annotation.Action;
import com.makeit.service.saas.SaasOperationLogService;
import com.makeit.service.saas.SaasSleepEvaluateReportService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -33,12 +34,14 @@ public class SaasSleepEvaluateReportController {
@Autowired
private SaasSleepEvaluateReportService saasSleepEvaluateReportService;
@Autowired
private SaasOperationLogService saasOperationLogService;
@Action(module = "报告管理-睡眠质量分析模型评估结果", name = "详情", code = "saas:sleepEvaluateReport:view")
@ApiOperation("详情")
@PostMapping("view")
public ApiResponseEntity<SaasSleepEvaluateReport> view(@RequestBody BaseIdDTO dto) {
saasOperationLogService.add("saas端-报告管理-睡眠质量分析模型评估结果-详情", null);
return ApiResponseUtils.success(saasSleepEvaluateReportService.view(dto.getId()));
}
......@@ -47,6 +50,7 @@ public class SaasSleepEvaluateReportController {
@PostMapping("add")
public ApiResponseEntity<Void> add(@Validated @RequestBody SaasSleepEvaluateReportDTO dto) {
saasSleepEvaluateReportService.add(dto);
saasOperationLogService.add("saas端-报告管理-睡眠质量分析模型评估结果-新增", null);
return ApiResponseUtils.success();
}
......@@ -55,6 +59,7 @@ public class SaasSleepEvaluateReportController {
@PostMapping("edit")
public ApiResponseEntity<Void> edit(@Validated @RequestBody SaasSleepEvaluateReportDTO dto) {
saasSleepEvaluateReportService.edit(dto);
saasOperationLogService.add("saas端-报告管理-睡眠质量分析模型评估结果-编辑", null);
return ApiResponseUtils.success();
}
}
......
......@@ -8,6 +8,7 @@ import com.makeit.common.response.ApiResponseUtils;
import com.makeit.dto.saas.analysis.SaasSleepEvaluateStandardReportDTO;
import com.makeit.entity.saas.analysis.SaasSleepEvaluateStandardReport;
import com.makeit.global.annotation.Action;
import com.makeit.service.saas.SaasOperationLogService;
import com.makeit.service.saas.SaasSleepEvaluateStandardReportService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -37,12 +38,15 @@ public class SaasSleepEvaluateStandardReportController {
@Autowired
private SaasSleepEvaluateStandardReportService saasSleepEvaluateStandardReportService;
@Autowired
private SaasOperationLogService saasOperationLogService;
@Action(module = "报告管理-睡眠质量分析模型评估标准", name = "详情", code = "saas:sleepEvaluateStandardReport:view")
@ApiOperation("详情")
@PostMapping("view")
public ApiResponseEntity<SaasSleepEvaluateStandardReport> view(@RequestBody BaseIdDTO dto) {
saasOperationLogService.add("saas端-报告管理-睡眠质量分析模型评估标准-详情", null);
return ApiResponseUtils.success(saasSleepEvaluateStandardReportService.view(dto.getId()));
}
......@@ -51,6 +55,8 @@ public class SaasSleepEvaluateStandardReportController {
@PostMapping("add")
public ApiResponseEntity<Void> add(@Validated @RequestBody SaasSleepEvaluateStandardReportDTO dto) {
saasSleepEvaluateStandardReportService.add(dto);
saasOperationLogService.add("saas端-报告管理-睡眠质量分析模型评估标准-新增", null);
return ApiResponseUtils.success();
}
......@@ -68,6 +74,8 @@ public class SaasSleepEvaluateStandardReportController {
@PostMapping("edit")
public ApiResponseEntity<Void> edit(@Validated @RequestBody SaasSleepEvaluateStandardReportDTO dto) {
saasSleepEvaluateStandardReportService.edit(dto);
saasOperationLogService.add("saas端-报告管理-睡眠质量分析模型评估标准-编辑", null);
return ApiResponseUtils.success();
}
}
......
......@@ -43,6 +43,7 @@ public class PlatUserQueryDTO extends BaseOrgDTO {
@ApiModelProperty(value = "用户id集合")
private List<String> userIdList;
private List<String> notUserIdList;
@ApiModelProperty(value = "角色id集合")
private List<String> roleIdList;
......
......@@ -219,13 +219,16 @@ public class PlatUserServiceImpl extends ServiceImpl<PlatUserMapper, PlatUser>
}
private void checkPerson(PlatUserDTOVO dto) {
private void checkPerson(PlatPersonDTOVO dto) {
List<PlatUser> userList = list(
new QueryWrapper<PlatUser>().lambda()
.eq(PlatUser::getIsTenant, IsTenantAccountEnum.NO.getValue())
.and(qw -> qw.eq(PlatUser::getAccount, dto.getAccount())
.or()
.eq(PlatUser::getMobile, dto.getMobile()))
.eq(PlatUser::getMobile, dto.getMobile())
.or()
.eq(PlatUser::getEmail,dto.getEmail())
)
);
......@@ -236,6 +239,9 @@ public class PlatUserServiceImpl extends ServiceImpl<PlatUserMapper, PlatUser>
if (e.getMobile().equals(dto.getMobile()) && !e.getId().equals(dto.getId())) {
throw new BusinessException(CodeMessageEnum.SYSTEM_ERROR_USER_MOBILE_DUPLICATE);
}
if (e.getEmail().equals(dto.getEmail()) && !e.getId().equals(dto.getId())) {
throw new BusinessException(CodeMessageEnum.SYSTEM_ERROR_USER_MAIL_DUPLICATE);
}
});
}
......@@ -644,6 +650,13 @@ public class PlatUserServiceImpl extends ServiceImpl<PlatUserMapper, PlatUser>
.eq(PlatUserRole::getRoleId, dto.getRoleId()));
userIdList.addAll(StreamUtil.map(userRoleList, PlatUserRole::getUserId));
}
return userIdList;
}
public List<String> userIdListByNotRoleId(PlatUserQueryDTO dto) {
List<String> userIdList = new ArrayList<>(10);
userIdList.add(-1 + "");
if (StringUtils.isNotBlank(dto.getNotRoleId())) {
List<PlatUserRole> userRoleList = platUserRoleService.list(new QueryWrapper<PlatUserRole>().lambda()
.eq(PlatUserRole::getRoleId, dto.getNotRoleId()));
......@@ -658,8 +671,10 @@ public class PlatUserServiceImpl extends ServiceImpl<PlatUserMapper, PlatUser>
List<String> userIdList = userIdListByRoleId(dto);
List<String> notUserIdList = userIdListByNotRoleId(dto);
lambdaQueryWrapper.in(StringUtils.isNotBlank(dto.getRoleId()), PlatUser::getId, userIdList)
.notIn(StringUtils.isNotBlank(dto.getNotRoleId()), PlatUser::getId, userIdList);
.notIn(StringUtils.isNotBlank(dto.getNotRoleId()), PlatUser::getId, notUserIdList);
}
......@@ -774,6 +789,8 @@ public class PlatUserServiceImpl extends ServiceImpl<PlatUserMapper, PlatUser>
List<String> userIdList = userIdListByRoleId(dto);
dto.setUserIdList(userIdList);
List<String> notUserIdList = userIdListByNotRoleId(dto);
dto.setNotUserIdList(notUserIdList);
Page<PlatUser> pageList = pageNoDeptUser(p, dto);
......@@ -835,7 +852,7 @@ public class PlatUserServiceImpl extends ServiceImpl<PlatUserMapper, PlatUser>
@Transactional
@Override
public String addPerson(PlatPersonDTOVO dto) {
checkPerson(BeanDtoVoUtils.convert(dto, PlatUserDTOVO.class));
checkPerson(dto);
PlatUser user = BeanDtoVoUtils.convert(dto, PlatUser.class);
user.setIsTenant(CommonEnum.NO.getValue());
......@@ -868,7 +885,7 @@ public class PlatUserServiceImpl extends ServiceImpl<PlatUserMapper, PlatUser>
@Transactional
@Override
public void editPerson(PlatPersonDTOVO dto) {
checkPerson(BeanDtoVoUtils.convert(dto, PlatUserDTOVO.class));
checkPerson(dto);
PlatUser user = BeanDtoVoUtils.convert(dto, PlatUser.class);
user.setIsTenant(CommonEnum.NO.getValue());
......
......@@ -37,7 +37,7 @@
</if>
<if test="dto.notRoleId != null and dto.notRoleId != ''">
AND t1.id NOT IN
<foreach collection="dto.userIdList" item="item" separator="," open="(" close=")" index="">
<foreach collection="dto.notUserIdList" item="item" separator="," open="(" close=")" index="">
#{item}
</foreach>
</if>
......
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 sign in to comment