Merge branch 'dev_gy_0920' of http://182.92.166.109:3000/jihan/xinelu-api into dev_gy_0920

# Conflicts:
#	xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/service/impl/ResidentPatientInfoServiceImpl.java
This commit is contained in:
mengkuiliang 2023-09-28 11:42:57 +08:00
commit 75ef1415ad

View File

@ -17,6 +17,7 @@ import com.xinelu.familydoctor.applet.pojo.body.PatientInfoBody;
import com.xinelu.familydoctor.applet.pojo.entity.PatientInfo;
import com.xinelu.familydoctor.applet.service.IResidentPatientInfoService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
@ -165,6 +166,7 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi
@Override
public void register(PatientInfoBody body) {
// 获取当前微信绑定的居民
<<<<<<< HEAD:xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/service/impl/ResidentPatientInfoServiceImpl.java
List<PatientInfo> list = residentPatientInfoMapper.getList(body.getOpenid(), body.getCityCode());
PatientInfo patientInfo = residentPatientInfoMapper.isRegisterByCardNo(body.getCardNo());
@ -192,6 +194,36 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi
patientInfo.setHeadPictureUrl(body.getHeadPictureUrl());
patientInfo.setDelFlag(0);
residentPatientInfoMapper.updatePatientInfo(patientInfo);
=======
List<PatientInfo> list = patientInfoMapper.getList(body.getOpenid(), body.getCityCode());
if (ObjectUtils.isNotEmpty(body.getCardNo())) {
PatientInfo patientInfo = patientInfoMapper.isRegisterByCardNo(body.getCardNo());
if (patientInfo == null) {
PatientInfo entity = new PatientInfo();
BeanUtils.copyBeanProp(entity, body);
entity.setPatientCode(IdUtils.fastSimpleUUID());
entity.setBindingTime(new Date());
entity.setIsChecked((list == null || list.size() == 0) ? "1" : "0");
entity.setCreateTime(new Date());
entity.setCreateBy(body.getCardNo());
patientInfoMapper.insertPatientInfo(entity);
} else {
if (!StringUtils.isBlank(patientInfo.getOpenid())) {
throw new ServiceException("该身份证号已被注册");
}
patientInfo.setIsChecked((list == null || list.size() == 0) ? "1" : "0");
patientInfo.setOpenid(body.getOpenid());
patientInfo.setUnionid(body.getUnionid());
patientInfo.setPatientName(body.getPatientName());
patientInfo.setPhone(body.getPhone());
patientInfo.setAddress(body.getAddress());
patientInfo.setUpdateTime(new Date());
patientInfo.setUpdateBy(body.getCardNo());
patientInfo.setHeadPictureUrl(body.getHeadPictureUrl());
patientInfo.setDelFlag(0);
patientInfoMapper.updatePatientInfo(patientInfo);
}
>>>>>>> 34d892aa069ef8de8aee23ae0e5653a942d69476:xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/service/impl/PatientInfoServiceImpl.java
}
}