新增了活动申请111
This commit is contained in:
parent
ae6e93bfa7
commit
983d0f098d
@ -37,13 +37,7 @@ import net.lab1024.sa.common.module.support.config.ConfigService;
|
||||
import net.lab1024.sa.common.module.support.config.domain.ConfigVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.validation.Valid;
|
||||
@ -646,4 +640,15 @@ public class ExpertController {
|
||||
return ResponseDTO.error(ExpertBankVerifyFail);
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("专家活动申请")
|
||||
@PostMapping("/caseplatformCase/activity")
|
||||
public ResponseDTO<String> addCaseplatformAcApp() {
|
||||
Long expertId = SmartRequestUtil.getRequestUserId();
|
||||
if (expertId == null) {
|
||||
return ResponseDTO.error(LOGIN_STATE_INVALID);
|
||||
}
|
||||
|
||||
return expertService.addCaseplatformAcApp(expertId);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,10 +1,14 @@
|
||||
package net.lab1024.sa.admin.module.app.expert.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import net.lab1024.sa.admin.module.app.expert.admin.ExpertEntity;
|
||||
import net.lab1024.sa.admin.module.app.expert.admin.ExpertVO;
|
||||
import net.lab1024.sa.admin.module.app.expert.dao.ExpertDao;
|
||||
import net.lab1024.sa.admin.module.app.medicalrecord.dao.MedicalRecorDao;
|
||||
import net.lab1024.sa.admin.module.app.medicalrecord.domain.MedicalRecordEntity;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.constant.CaseStatusEnum;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.dao.CaseplatformAcAppDao;
|
||||
import net.lab1024.sa.admin.module.business.caseplatformcase.domain.entity.CaseplatformAcAppEntity;
|
||||
import net.lab1024.sa.admin.module.business.token.service.TokenService;
|
||||
import net.lab1024.sa.admin.module.system.login.service.LoginService;
|
||||
import net.lab1024.sa.common.common.domain.RequestUser;
|
||||
@ -17,6 +21,9 @@ import net.lab1024.sa.common.module.support.token.LoginDeviceEnum;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Arrays;
|
||||
|
||||
@Service
|
||||
public class ExpertService {
|
||||
|
||||
@ -31,6 +38,11 @@ public class ExpertService {
|
||||
|
||||
|
||||
|
||||
@Autowired
|
||||
private CaseplatformAcAppDao caseplatformAcAppDao;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据id 查询
|
||||
@ -77,4 +89,38 @@ public class ExpertService {
|
||||
addForm.setToken(token);
|
||||
return addForm;
|
||||
}
|
||||
|
||||
/**
|
||||
* 专家活动申请
|
||||
*/
|
||||
public ResponseDTO<String> addCaseplatformAcApp(Long expertId) {
|
||||
LambdaQueryWrapper<CaseplatformAcAppEntity> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(CaseplatformAcAppEntity::getExpertId,expertId);
|
||||
CaseplatformAcAppEntity caseplatformAcApp = caseplatformAcAppDao.selectOne(queryWrapper);
|
||||
if (caseplatformAcApp != null) {
|
||||
if (caseplatformAcApp.getStatus() == 1){
|
||||
return ResponseDTO.app_ok("恭喜您,您的病例交流活动申请已通过审核");
|
||||
}
|
||||
|
||||
if (caseplatformAcApp.getStatus() == 2){
|
||||
return ResponseDTO.app_ok("您的病例交流活动申请正在审核中");
|
||||
}
|
||||
}
|
||||
|
||||
LambdaQueryWrapper<MedicalRecordEntity> caseCountQueryWrapper = new LambdaQueryWrapper<>();
|
||||
caseCountQueryWrapper.eq(MedicalRecordEntity::getExpertId,expertId);
|
||||
caseCountQueryWrapper.eq(MedicalRecordEntity::getStatus, 1);
|
||||
Long caseCount = medicalRecorDao.selectCount(caseCountQueryWrapper);
|
||||
if (caseCount < 1){
|
||||
return ResponseDTO.app_ok("病例审核通过5份及以上可申请病例交流活动");
|
||||
}
|
||||
|
||||
CaseplatformAcAppEntity caseplatformAcAppData = new CaseplatformAcAppEntity();
|
||||
caseplatformAcAppData.setExpertId(expertId);
|
||||
caseplatformAcAppData.setStatus(2);
|
||||
caseplatformAcAppData.setCreateTime(LocalDateTime.now());
|
||||
caseplatformAcAppDao.insert(caseplatformAcAppData);
|
||||
|
||||
return ResponseDTO.app_ok("您已成功申请,请耐心等待审核");
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,6 +11,7 @@ import net.lab1024.sa.admin.module.app.medicalrecord.domain.MedicalRecordUpdateF
|
||||
import net.lab1024.sa.admin.module.app.medicalrecord.service.MedicalRecordService;
|
||||
import net.lab1024.sa.common.common.domain.PageResult;
|
||||
import net.lab1024.sa.common.common.domain.ResponseDTO;
|
||||
import net.lab1024.sa.common.common.util.SmartRequestUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@ -21,6 +22,8 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
import static net.lab1024.sa.common.common.code.UserErrorCode.LOGIN_STATE_INVALID;
|
||||
|
||||
@RestController
|
||||
@Api(tags = {AdminSwaggerTagConst.App.MedicalRecord})
|
||||
public class MedicalRecordController {
|
||||
@ -57,4 +60,14 @@ public class MedicalRecordController {
|
||||
return medicalRecordService.update(updateForm);
|
||||
}
|
||||
|
||||
@ApiOperation("获取有效病例数量")
|
||||
@GetMapping("/medicalRecord/count")
|
||||
public ResponseDTO<Long> addCaseplatformAcApp() {
|
||||
Long expertId = SmartRequestUtil.getRequestUserId();
|
||||
if (expertId == null) {
|
||||
return ResponseDTO.error(LOGIN_STATE_INVALID);
|
||||
}
|
||||
|
||||
return medicalRecordService.getMedicalRecordCount(expertId);
|
||||
}
|
||||
}
|
||||
|
||||
@ -609,13 +609,6 @@ public class MedicalRecordService {
|
||||
}
|
||||
}
|
||||
|
||||
LambdaQueryWrapper<MedicalRecordEntity> medicalRecordQueryWrapper = new LambdaQueryWrapper<>();
|
||||
medicalRecordQueryWrapper.eq(MedicalRecordEntity::getExpertId, expertId);
|
||||
List<MedicalRecordEntity> medicalRecords = medicalRecorDao.selectList(medicalRecordQueryWrapper);
|
||||
if (medicalRecords.size() >= 4){
|
||||
return ResponseDTO.userErrorParam("每人参与病例征集不得超过20例");
|
||||
}
|
||||
|
||||
return ResponseDTO.app_ok();
|
||||
}
|
||||
|
||||
@ -671,4 +664,15 @@ public class MedicalRecordService {
|
||||
|
||||
return ResponseDTO.app_ok();
|
||||
}
|
||||
|
||||
// 获取病例数量
|
||||
public ResponseDTO<Long> getMedicalRecordCount(Long expertId) {
|
||||
// 获取专家提交病例数量
|
||||
LambdaQueryWrapper<MedicalRecordEntity> caseCountQueryWrapper = new LambdaQueryWrapper<>();
|
||||
caseCountQueryWrapper.eq(MedicalRecordEntity::getExpertId,expertId);
|
||||
caseCountQueryWrapper.in(MedicalRecordEntity::getStatus, Arrays.asList(0, 1));
|
||||
Long caseCount = medicalRecorDao.selectCount(caseCountQueryWrapper);
|
||||
|
||||
return ResponseDTO.app_ok(caseCount);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user