|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
package com.docus.demo.controller;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import com.docus.demo.dto.BasicCorrectDto;
|
|
|
|
|
import com.docus.demo.dto.SyncBasicDataDto;
|
|
|
|
|
import com.docus.demo.dto.SyncFileDto;
|
|
|
|
@ -17,6 +18,8 @@ import org.springframework.validation.annotation.Validated;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
|
|
|
|
import java.text.ParseException;
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
@Api(value = "临时方法接口", tags = "临时方法接口")
|
|
|
|
@ -30,7 +33,27 @@ public class TemporaryFunctionController {
|
|
|
|
|
|
|
|
|
|
@ApiOperation("扫描软件修正基础数据临时方案")
|
|
|
|
|
@PostMapping("/scan/basicCorrect")
|
|
|
|
|
public CommonResult<?> scanBasicCorrect(@RequestBody @Validated List<BasicCorrectDto> basicCorrectDtos){
|
|
|
|
|
public CommonResult<?> scanBasicCorrect(@RequestBody List<BasicCorrectDto> basicCorrectDtos){
|
|
|
|
|
SimpleDateFormat inFormat = new SimpleDateFormat("yyyyMMdd");
|
|
|
|
|
for (BasicCorrectDto basicCorrectDto : basicCorrectDtos) {
|
|
|
|
|
if (StrUtil.isBlank(basicCorrectDto.getPatientId())) {
|
|
|
|
|
return CommonResult.failed("患者病案主键不能为空!");
|
|
|
|
|
}
|
|
|
|
|
if (StrUtil.isBlank(basicCorrectDto.getInpatientNo())) {
|
|
|
|
|
return CommonResult.failed("患者病案号不能为空!");
|
|
|
|
|
}
|
|
|
|
|
if (StrUtil.isBlank(basicCorrectDto.getDisDate())) {
|
|
|
|
|
return CommonResult.failed("患者出院日期不能为空!");
|
|
|
|
|
}
|
|
|
|
|
if (StrUtil.isBlank(basicCorrectDto.getPh())) {
|
|
|
|
|
return CommonResult.failed("患者箱号不能为空!");
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
inFormat.parse(basicCorrectDto.getDisDate());
|
|
|
|
|
} catch (ParseException e) {
|
|
|
|
|
return CommonResult.failed("患者出院日期格式错误!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
syncBasicDataService.scanBasicCorrect(basicCorrectDtos);
|
|
|
|
|
return CommonResult.success("成功!");
|
|
|
|
|
}
|
|
|
|
|