新增病例新增开关、病例修改开关、首页弹窗
This commit is contained in:
parent
150ceae865
commit
45fe79c593
@ -321,6 +321,27 @@ public class ExpertController {
|
|||||||
return ResponseDTO.app_ok();
|
return ResponseDTO.app_ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "病例新增开关")
|
||||||
|
@GetMapping("/user/getCaseNewSwitch")
|
||||||
|
public ResponseDTO<String> getCaseNewSwitch() {
|
||||||
|
ConfigVO configVO = configService.getConfig(ConfigKeyEnum.CaseNewSwitch);
|
||||||
|
return ResponseDTO.app_ok(configVO.getConfigValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "病例修改开关")
|
||||||
|
@GetMapping("/user/getCaseUpdateSwitch")
|
||||||
|
public ResponseDTO<String> getCaseUpdateSwitch() {
|
||||||
|
ConfigVO configVO = configService.getConfig(ConfigKeyEnum.CaseUpdateSwitch);
|
||||||
|
return ResponseDTO.app_ok(configVO.getConfigValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "首页弹窗内容")
|
||||||
|
@GetMapping("/user/getIndexNotice")
|
||||||
|
public ResponseDTO<String> getIndexNotice() {
|
||||||
|
ConfigVO configVO = configService.getConfig(ConfigKeyEnum.IndexNotice);
|
||||||
|
return ResponseDTO.app_ok(configVO.getConfigValue());
|
||||||
|
}
|
||||||
|
|
||||||
@NoNeedLogin
|
@NoNeedLogin
|
||||||
@ApiOperation(value = "操作说明")
|
@ApiOperation(value = "操作说明")
|
||||||
@GetMapping("/user/getRubric")
|
@GetMapping("/user/getRubric")
|
||||||
|
|||||||
@ -41,8 +41,7 @@ import java.util.List;
|
|||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import static net.lab1024.sa.common.common.code.UserErrorCode.NO_PERMISSION_EDIT;
|
import static net.lab1024.sa.common.common.code.UserErrorCode.*;
|
||||||
import static net.lab1024.sa.common.common.code.UserErrorCode.PROJECT_CLOSE;
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class MedicalRecordService {
|
public class MedicalRecordService {
|
||||||
@ -104,6 +103,12 @@ public class MedicalRecordService {
|
|||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public ResponseDTO<String> add(MedicalRecordAddForm addForm){
|
public ResponseDTO<String> add(MedicalRecordAddForm addForm){
|
||||||
|
|
||||||
|
ConfigVO caseSwitch = configService.getConfig(ConfigKeyEnum.CaseNewSwitch);
|
||||||
|
if(caseSwitch.getConfigValue().equals("false")){
|
||||||
|
return ResponseDTO.error(CASE_NEW_CLOSE);
|
||||||
|
}
|
||||||
|
|
||||||
ConfigVO caseNum = configService.getConfig(ConfigKeyEnum.CaseNum);
|
ConfigVO caseNum = configService.getConfig(ConfigKeyEnum.CaseNum);
|
||||||
int total = medicalRecorDao.getTotal();
|
int total = medicalRecorDao.getTotal();
|
||||||
if(Integer.parseInt(caseNum.getConfigValue()) <= total){
|
if(Integer.parseInt(caseNum.getConfigValue()) <= total){
|
||||||
@ -279,6 +284,12 @@ public class MedicalRecordService {
|
|||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public ResponseDTO<String> update(MedicalRecordUpdateForm updateForm){
|
public ResponseDTO<String> update(MedicalRecordUpdateForm updateForm){
|
||||||
|
|
||||||
|
ConfigVO caseSwitch = configService.getConfig(ConfigKeyEnum.CaseUpdateSwitch);
|
||||||
|
if(caseSwitch.getConfigValue().equals("false")){
|
||||||
|
return ResponseDTO.error(CASE_UPDATE_CLOSE);
|
||||||
|
}
|
||||||
|
|
||||||
Long expertId = SmartRequestUtil.getRequestUserId();
|
Long expertId = SmartRequestUtil.getRequestUserId();
|
||||||
Long medicalRecordId = updateForm.getId();
|
Long medicalRecordId = updateForm.getId();
|
||||||
|
|
||||||
|
|||||||
@ -36,7 +36,9 @@ public enum UserErrorCode implements ErrorCode {
|
|||||||
|
|
||||||
NO_PERMISSION_EDIT(30010, "该状态不允许修改"),
|
NO_PERMISSION_EDIT(30010, "该状态不允许修改"),
|
||||||
NO_MODIFY(30011, "该账号无需补充资料"),
|
NO_MODIFY(30011, "该账号无需补充资料"),
|
||||||
PROJECT_CLOSE(30012, "本年度人工肝病例登记项目已暂停,谢谢您的关注!"),
|
PROJECT_CLOSE(30012, "本年度人工肝病例登记项目已结束,谢谢您的关注!"),
|
||||||
|
CASE_NEW_CLOSE(30015, "该项目已暂停新增病例登记,谢谢您的关注!"),
|
||||||
|
CASE_UPDATE_CLOSE(30016, "该项目已暂停修改病例,谢谢您的关注!"),
|
||||||
ExpertBankVerifyFail(30013, "银行卡认证失败"),
|
ExpertBankVerifyFail(30013, "银行卡认证失败"),
|
||||||
|
|
||||||
NO_AUTH(30014, "对不起,您暂无权限访问该项目~");
|
NO_AUTH(30014, "对不起,您暂无权限访问该项目~");
|
||||||
|
|||||||
@ -28,6 +28,9 @@ public enum ConfigKeyEnum implements BaseEnum {
|
|||||||
SUPER_PASSWORD("super_password", "万能密码"),
|
SUPER_PASSWORD("super_password", "万能密码"),
|
||||||
CaseNum("CaseNum", "项目总病例数"),
|
CaseNum("CaseNum", "项目总病例数"),
|
||||||
CaseSwitch("CaseSwitch", "项目开关"),
|
CaseSwitch("CaseSwitch", "项目开关"),
|
||||||
|
CaseNewSwitch("CaseNewSwitch", "病例新增开关"),
|
||||||
|
CaseUpdateSwitch("CaseUpdateSwitch", "病例修改开关"),
|
||||||
|
IndexNotice("IndexNotice", "首页弹窗"),
|
||||||
RUBRIC("rubric", "投稿说明"),
|
RUBRIC("rubric", "投稿说明"),
|
||||||
DEAL("deal", "项目协议"),
|
DEAL("deal", "项目协议"),
|
||||||
PRIVACY("privacy", "隐私协议"),
|
PRIVACY("privacy", "隐私协议"),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user