新增根据表单创建患者信息和项目信息接口
This commit is contained in:
parent
9f8988372c
commit
a5b959de71
@ -299,6 +299,55 @@ public class InspectPatientController {
|
||||
patientitemsService.createPatientListitems(batch);
|
||||
}
|
||||
}
|
||||
@PostMapping("/insertPatinetInfo")
|
||||
@Operation(summary = "根据表单创建患者信息和项目信息")
|
||||
public CommonResult<Boolean> insertPatinetInfo(@Valid @RequestBody InspectPatientSaveReqVO inspectPatientSaveReqVO)
|
||||
{
|
||||
|
||||
//检查项目
|
||||
List<InspectPatientitemsSaveReqVO> dataList2 = new ArrayList<>();
|
||||
//检查套餐信息
|
||||
List<InspectitemsDO> doList = exammoduleService.selectItemsByExamModuleID(1001);
|
||||
// 获取当前日期并格式化为 yyyyMMdd 格式
|
||||
LocalDate currentDate = LocalDate.now();
|
||||
String datePart = currentDate.format(DateTimeFormatter.ofPattern("yyyyMMdd"));
|
||||
// 生成一个6位的序列号
|
||||
int sequenceNumber = counter.incrementAndGet() % 1000000; // 确保序列号是6位数
|
||||
String sequencePart = String.format("%06d", sequenceNumber);
|
||||
//患者信息
|
||||
InspectPatientSaveReqVO rowData = new InspectPatientSaveReqVO();
|
||||
rowData.setMedicalSn(sequencePart);
|
||||
rowData.setPName(inspectPatientSaveReqVO.getPName());
|
||||
rowData.setCardId(inspectPatientSaveReqVO.getCardId());
|
||||
rowData.setBirthday(inspectPatientSaveReqVO.getBirthday());
|
||||
rowData.setPhoneNum(inspectPatientSaveReqVO.getPhoneNum());
|
||||
rowData.setGender(inspectPatientSaveReqVO.getGender());
|
||||
rowData.setDomicileaddress(inspectPatientSaveReqVO.getDomicileaddress());
|
||||
patientService.createPatient(rowData);
|
||||
|
||||
//填写项目信息
|
||||
for (InspectitemsDO inspectitemsDO : doList) {
|
||||
//套餐信息
|
||||
InspectPatientitemsSaveReqVO rowData2 = new InspectPatientitemsSaveReqVO();
|
||||
rowData2.setMedicalSn(sequencePart);
|
||||
rowData2.setItemCode(inspectitemsDO.getItemCode());
|
||||
rowData2.setItemName(inspectitemsDO.getItemName());
|
||||
rowData2.setPrice(inspectitemsDO.getPrice());
|
||||
rowData2.setSectionID(inspectitemsDO.getSectionID());
|
||||
rowData2.setUnit(inspectitemsDO.getUnit());
|
||||
rowData2.setItemStatus("0");
|
||||
rowData2.setGroupname(inspectitemsDO.getGroupname());
|
||||
rowData2.setGroupcode(inspectitemsDO.getGroupcode());
|
||||
rowData2.setCreateTime(LocalDateTime.now());
|
||||
rowData2.setHighValue(inspectitemsDO.getHighValue());
|
||||
rowData2.setLowValue(inspectitemsDO.getLowValue());
|
||||
rowData2.setMealfrontorafter(inspectitemsDO.getMealfrontorafter());
|
||||
dataList2.add(rowData2);
|
||||
}
|
||||
// 分批插入患者项目信息
|
||||
batchInsertPatientItems(dataList2);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/syncinspectApplyTj")
|
||||
@Operation(summary = "发送检验申请单")
|
||||
|
@ -1,6 +1,7 @@
|
||||
package cn.iocoder.yudao.module.inspect.controller.admin.inspectpatient.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
@ -26,6 +27,8 @@ public class InspectPatientSaveReqVO {
|
||||
private String gender;
|
||||
|
||||
@Schema(description = "出生日期")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd ", timezone = "GMT+8")
|
||||
private LocalDate birthday;
|
||||
|
||||
@Schema(description = "证件类型", example = "1")
|
||||
|
Loading…
Reference in New Issue
Block a user