Merge branch 'dev'
This commit is contained in:
commit
cf2a2701ca
@ -321,6 +321,27 @@ public class ExpertController {
|
||||
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
|
||||
@ApiOperation(value = "操作说明")
|
||||
@GetMapping("/user/getRubric")
|
||||
|
||||
@ -41,8 +41,7 @@ import java.util.List;
|
||||
import java.util.Objects;
|
||||
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.PROJECT_CLOSE;
|
||||
import static net.lab1024.sa.common.common.code.UserErrorCode.*;
|
||||
|
||||
@Service
|
||||
public class MedicalRecordService {
|
||||
@ -104,6 +103,12 @@ public class MedicalRecordService {
|
||||
|
||||
@Transactional
|
||||
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);
|
||||
int total = medicalRecorDao.getTotal();
|
||||
if(Integer.parseInt(caseNum.getConfigValue()) <= total){
|
||||
@ -279,6 +284,12 @@ public class MedicalRecordService {
|
||||
|
||||
@Transactional
|
||||
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 medicalRecordId = updateForm.getId();
|
||||
|
||||
|
||||
@ -37,6 +37,8 @@ public enum UserErrorCode implements ErrorCode {
|
||||
NO_PERMISSION_EDIT(30010, "该状态不允许修改"),
|
||||
NO_MODIFY(30011, "该账号无需补充资料"),
|
||||
PROJECT_CLOSE(30012, "本年度人工肝病例登记项目已暂停,谢谢您的关注!"),
|
||||
CASE_NEW_CLOSE(30015, "该项目已暂停新增病例登记,谢谢您的关注!"),
|
||||
CASE_UPDATE_CLOSE(30016, "该项目已暂停修改病例,谢谢您的关注!"),
|
||||
ExpertBankVerifyFail(30013, "银行卡认证失败"),
|
||||
|
||||
NO_AUTH(30014, "对不起,您暂无权限访问该项目~");
|
||||
|
||||
@ -28,6 +28,9 @@ public enum ConfigKeyEnum implements BaseEnum {
|
||||
SUPER_PASSWORD("super_password", "万能密码"),
|
||||
CaseNum("CaseNum", "项目总病例数"),
|
||||
CaseSwitch("CaseSwitch", "项目开关"),
|
||||
CaseNewSwitch("CaseNewSwitch", "病例新增开关"),
|
||||
CaseUpdateSwitch("CaseUpdateSwitch", "病例修改开关"),
|
||||
IndexNotice("IndexNotice", "首页弹窗"),
|
||||
RUBRIC("rubric", "投稿说明"),
|
||||
DEAL("deal", "项目协议"),
|
||||
PRIVACY("privacy", "隐私协议"),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user