Browse Source

Merge branch 'pt' of dd.tall.wiki:ccsens_wiki/ccsenscloud into pt

pt
zhizhi wu 5 years ago
parent
commit
4d99f2c135
  1. 4
      wisdomcar/src/main/java/com/ccsens/wisdomcar/api/WisdomCarController.java
  2. 13
      wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/vo/WisdomCarVo.java
  3. 2
      wisdomcar/src/main/java/com/ccsens/wisdomcar/service/IWisdomCarService.java
  4. 12
      wisdomcar/src/main/java/com/ccsens/wisdomcar/service/OtherRecordsService.java
  5. 8
      wisdomcar/src/main/java/com/ccsens/wisdomcar/service/WisdomCarService.java
  6. 4
      wisdomcar/src/main/resources/application.yml

4
wisdomcar/src/main/java/com/ccsens/wisdomcar/api/WisdomCarController.java

@ -45,9 +45,9 @@ public class WisdomCarController {
@MustLogin @MustLogin
@ApiOperation(value = "创建病例接口", notes = "") @ApiOperation(value = "创建病例接口", notes = "")
@RequestMapping(value = "/createCase", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) @RequestMapping(value = "/createCase", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse createCase(@ApiParam @Validated @RequestBody QueryDto<CreateCaseDto.PatientInfo> params) { public JsonResponse<WisdomCarVo.PatientProject> createCase(@ApiParam @Validated @RequestBody QueryDto<CreateCaseDto.PatientInfo> params) {
log.info("创建病例接口:{}", params); log.info("创建病例接口:{}", params);
wisdomCarService.createCase(params.getParam(), params.getUserId()); WisdomCarVo.PatientProject patientProject = wisdomCarService.createCase(params.getParam(), params.getUserId());
log.info("创建病例接口"); log.info("创建病例接口");
return JsonResponse.newInstance().ok(); return JsonResponse.newInstance().ok();
} }

13
wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/vo/WisdomCarVo.java

@ -21,6 +21,19 @@ public class WisdomCarVo {
private String carNumber; private String carNumber;
} }
@Data
@ApiModel("添加患者-返回项目id")
public static class PatientProject{
@ApiModelProperty("平车ID")
private Long projectId;
public PatientProject(Long projectId) {
this.projectId = projectId;
}
public PatientProject() {
}
}
@Data @Data

2
wisdomcar/src/main/java/com/ccsens/wisdomcar/service/IWisdomCarService.java

@ -26,7 +26,7 @@ public interface IWisdomCarService {
* @param param 患者信息与家属信息 * @param param 患者信息与家属信息
* @param userId 当前用户id * @param userId 当前用户id
*/ */
void createCase(CreateCaseDto.PatientInfo param, Long userId); WisdomCarVo.PatientProject createCase(CreateCaseDto.PatientInfo param, Long userId);
/** /**
* 绑定平车 * 绑定平车

12
wisdomcar/src/main/java/com/ccsens/wisdomcar/service/OtherRecordsService.java

@ -57,16 +57,16 @@ public class OtherRecordsService implements IOtherRecordsService {
//通过t_patient_information_record里面的分解任务id 找到患者平车id 最新的 拿到患者平车id t_patient_information_record //通过t_patient_information_record里面的分解任务id 找到患者平车id 最新的 拿到患者平车id t_patient_information_record
//拿到患者平车id //拿到患者平车id
ProjectVo.BindCar bindCar = stepTaskDao.getBindCarTaskId(param.getId()); ProjectVo.BindCar bindCar = stepTaskDao.getBindCarTaskId(param.getId());
if (bindCar == null) { /*if (bindCar == null) {
log.info("没有找到绑定的平车信息:{}", param); log.info("没有找到绑定的平车信息:{}", param);
throw new BaseException(CodeEnum.PARAM_ERROR); throw new BaseException(CodeEnum.PARAM_ERROR);
} }*/
//判断是否是图片是否为空 //判断是否是图片是否为空
if (CollectionUtil.isNotEmpty(param.getPictures())){ if (CollectionUtil.isNotEmpty(param.getPictures())){
for (int i = 0; i < param.getPictures().size(); i++) { for (int i = 0; i < param.getPictures().size(); i++) {
PatientInformationRecord patientInformationRecord = new PatientInformationRecord(); PatientInformationRecord patientInformationRecord = new PatientInformationRecord();
patientInformationRecord.setId(snowflake.nextId()); patientInformationRecord.setId(snowflake.nextId());
patientInformationRecord.setPatientCarId(bindCar.getId()); patientInformationRecord.setPatientCarId(bindCar == null ? 0 : bindCar.getId());
patientInformationRecord.setTaskSubId(param.getId()); patientInformationRecord.setTaskSubId(param.getId());
//上传图片 //上传图片
patientInformationRecord.setInformationType((byte) 0); patientInformationRecord.setInformationType((byte) 0);
@ -80,7 +80,7 @@ public class OtherRecordsService implements IOtherRecordsService {
if(!StringUtil.isEmpty(param.getRecords())) { if(!StringUtil.isEmpty(param.getRecords())) {
PatientInformationRecord patientInformationRecord = new PatientInformationRecord(); PatientInformationRecord patientInformationRecord = new PatientInformationRecord();
patientInformationRecord.setId(snowflake.nextId()); patientInformationRecord.setId(snowflake.nextId());
patientInformationRecord.setPatientCarId(bindCar.getId()); patientInformationRecord.setPatientCarId(bindCar == null ? 0 : bindCar.getId());
patientInformationRecord.setTaskSubId(param.getId()); patientInformationRecord.setTaskSubId(param.getId());
patientInformationRecord.setInformationType((byte) 1); patientInformationRecord.setInformationType((byte) 1);
patientInformationRecord.setContent(param.getRecords()); patientInformationRecord.setContent(param.getRecords());
@ -97,10 +97,6 @@ public class OtherRecordsService implements IOtherRecordsService {
PatientInformationRecordExample patientInformationRecordExample = new PatientInformationRecordExample(); PatientInformationRecordExample patientInformationRecordExample = new PatientInformationRecordExample();
patientInformationRecordExample.createCriteria().andTaskSubIdEqualTo(param.getId()); patientInformationRecordExample.createCriteria().andTaskSubIdEqualTo(param.getId());
List<PatientInformationRecord> patientInformationRecords = patientInformationRecordMapper.selectByExample(patientInformationRecordExample); List<PatientInformationRecord> patientInformationRecords = patientInformationRecordMapper.selectByExample(patientInformationRecordExample);
if(CollectionUtil.isEmpty(patientInformationRecords)){
log.info("没有找到对应的的任务");
throw new BaseException(CodeEnum.PARAM_ERROR);
}
for (PatientInformationRecord patientInformationRecord : patientInformationRecords) { for (PatientInformationRecord patientInformationRecord : patientInformationRecords) {
OtherRecordsVo.TypeAndComment query = new OtherRecordsVo.TypeAndComment(); OtherRecordsVo.TypeAndComment query = new OtherRecordsVo.TypeAndComment();
query.setComment(patientInformationRecord.getContent()); query.setComment(patientInformationRecord.getContent());

8
wisdomcar/src/main/java/com/ccsens/wisdomcar/service/WisdomCarService.java

@ -70,7 +70,8 @@ public class WisdomCarService implements IWisdomCarService {
private PatientDataDao patientDataDao; private PatientDataDao patientDataDao;
@Override @Override
public void createCase(CreateCaseDto.PatientInfo param, Long userId) { public WisdomCarVo.PatientProject createCase(CreateCaseDto.PatientInfo param, Long userId) {
Long patientProjectId = null;
//tall中需要添加的成员 //tall中需要添加的成员
MemberRoleDto.SaveMemberForTemplate saveMemberForTemplate = new MemberRoleDto.SaveMemberForTemplate(); MemberRoleDto.SaveMemberForTemplate saveMemberForTemplate = new MemberRoleDto.SaveMemberForTemplate();
List<MemberRoleDto.MemberForTemplate> memberList = new ArrayList<>(); List<MemberRoleDto.MemberForTemplate> memberList = new ArrayList<>();
@ -88,7 +89,7 @@ public class WisdomCarService implements IWisdomCarService {
//设置病历号,redis自增 //设置病历号,redis自增
if (CollectionUtil.isNotEmpty(hospitalMembers)){ if (CollectionUtil.isNotEmpty(hospitalMembers)){
hospitalMember = hospitalMembers.get(0); hospitalMember = hospitalMembers.get(0);
long incr = redisUtil.incr("医院_" + hospitalMember.getHospitalId().toString(), 1L); long incr = redisUtil.incr("hospital_" + hospitalMember.getHospitalId().toString(), 1L);
patient.setMedicalRecordNum(String.valueOf(incr)); patient.setMedicalRecordNum(String.valueOf(incr));
} }
if (ObjectUtil.isNotNull(param.getPatientName())){ if (ObjectUtil.isNotNull(param.getPatientName())){
@ -201,7 +202,9 @@ public class WisdomCarService implements IWisdomCarService {
} }
ProjectVo.ProjectInfo data = projectId.getData(); ProjectVo.ProjectInfo data = projectId.getData();
if (ObjectUtil.isNotNull(data)){ if (ObjectUtil.isNotNull(data)){
patientProjectId = data.getId();
//将患者与项目绑定 //将患者与项目绑定
PatientProject patientProject = new PatientProject(); PatientProject patientProject = new PatientProject();
patientProject.setId(patient.getId()); patientProject.setId(patient.getId());
@ -245,6 +248,7 @@ public class WisdomCarService implements IWisdomCarService {
}else{ }else{
throw new BaseException(Constant.RETURN_NULL); throw new BaseException(Constant.RETURN_NULL);
} }
return new WisdomCarVo.PatientProject(patientProjectId);
} }

4
wisdomcar/src/main/resources/application.yml

@ -1,6 +1,6 @@
spring: spring:
profiles: profiles:
active: prod active: dev
include: common, util-prod include: common, util-dev

Loading…
Cancel
Save