提交 f6310f70 authored 作者: 杨凯's avatar 杨凯

feat:家庭医生初始化

上级 ee1e0436
...@@ -58,4 +58,7 @@ public class MobileBenefitPackageEntity { ...@@ -58,4 +58,7 @@ public class MobileBenefitPackageEntity {
@ApiModelProperty(value = "使用次数") @ApiModelProperty(value = "使用次数")
private Integer used; private Integer used;
@ApiModelProperty(value = "医生id")
private String doctorId;
} }
...@@ -25,5 +25,7 @@ public interface MobileBenefitPackageMapper { ...@@ -25,5 +25,7 @@ public interface MobileBenefitPackageMapper {
void update(MobileBenefitPackageEntity entity); void update(MobileBenefitPackageEntity entity);
void updateDoctorId(MobileBenefitPackageEntity entity);
List<String> getPatientIdsByPhoneAndOrderId(@Param("phone") String phone); List<String> getPatientIdsByPhoneAndOrderId(@Param("phone") String phone);
} }
...@@ -13,8 +13,10 @@ import com.ebaiyihui.family.doctor.common.vo.RegisterPatientVo; ...@@ -13,8 +13,10 @@ import com.ebaiyihui.family.doctor.common.vo.RegisterPatientVo;
import com.ebaiyihui.family.doctor.server.common.constants.CommonConstants; import com.ebaiyihui.family.doctor.server.common.constants.CommonConstants;
import com.ebaiyihui.family.doctor.server.entity.MobileBenefitPackageEntity; import com.ebaiyihui.family.doctor.server.entity.MobileBenefitPackageEntity;
import com.ebaiyihui.family.doctor.server.entity.PatientEntity; import com.ebaiyihui.family.doctor.server.entity.PatientEntity;
import com.ebaiyihui.family.doctor.server.entity.PatientSignEntity;
import com.ebaiyihui.family.doctor.server.mapper.MobileBenefitPackageMapper; import com.ebaiyihui.family.doctor.server.mapper.MobileBenefitPackageMapper;
import com.ebaiyihui.family.doctor.server.mapper.PatientMapper; import com.ebaiyihui.family.doctor.server.mapper.PatientMapper;
import com.ebaiyihui.family.doctor.server.mapper.PatientSignMapper;
import com.ebaiyihui.family.doctor.server.service.MobileBenefitPackageService; import com.ebaiyihui.family.doctor.server.service.MobileBenefitPackageService;
import com.ebaiyihui.family.doctor.server.util.DESUtils; import com.ebaiyihui.family.doctor.server.util.DESUtils;
import com.ebaiyihui.framework.response.BaseResponse; import com.ebaiyihui.framework.response.BaseResponse;
...@@ -45,6 +47,9 @@ public class MobileBenefitPackageServiceImpl implements MobileBenefitPackageServ ...@@ -45,6 +47,9 @@ public class MobileBenefitPackageServiceImpl implements MobileBenefitPackageServ
@Autowired @Autowired
private PatientMapper patientMapper; private PatientMapper patientMapper;
@Autowired
private PatientSignMapper patientSignMapper;
@Autowired @Autowired
private MobileBenefitPackageMapper mobileBenefitPackageMapper; private MobileBenefitPackageMapper mobileBenefitPackageMapper;
...@@ -83,8 +88,19 @@ public class MobileBenefitPackageServiceImpl implements MobileBenefitPackageServ ...@@ -83,8 +88,19 @@ public class MobileBenefitPackageServiceImpl implements MobileBenefitPackageServ
RegisterPatientVo registerPatientVo = new RegisterPatientVo(); RegisterPatientVo registerPatientVo = new RegisterPatientVo();
registerPatientVo.setPatientInfo(data); registerPatientVo.setPatientInfo(data);
registerPatientVo.setActivateOrderId(map.get("activateOrderId")); registerPatientVo.setActivateOrderId(map.get("activateOrderId"));
if (Objects.nonNull(map.get("consultOrderNo"))) { if (Objects.nonNull(map.get("admId"))) {
registerPatientVo.setAdmId(map.get("admId")); registerPatientVo.setAdmId(map.get("admId"));
// 更新权益医生id
QueryWrapper<PatientSignEntity> psWrapper = new QueryWrapper<>();
PatientSignEntity patientSign = new PatientSignEntity();
patientSign.setAdmId(map.get("admId"));
psWrapper.setEntity(patientSign);
PatientSignEntity patientSignEntity = patientSignMapper.selectOne(psWrapper);
if (Objects.nonNull(patientSignEntity)) {
entity.setDoctorId(String.valueOf(patientSignEntity.getDoctorId()));
mobileBenefitPackageMapper.updateDoctorId(entity);
}
} }
if (Objects.nonNull(map.get("scheduleFlag"))) { if (Objects.nonNull(map.get("scheduleFlag"))) {
registerPatientVo.setScheduleFlag(Integer.valueOf(map.get("scheduleFlag"))); registerPatientVo.setScheduleFlag(Integer.valueOf(map.get("scheduleFlag")));
......
...@@ -40,6 +40,12 @@ ...@@ -40,6 +40,12 @@
where phone = #{phone,jdbcType=VARCHAR} and orderId = #{orderId} where phone = #{phone,jdbcType=VARCHAR} and orderId = #{orderId}
</update> </update>
<update id="updateDoctorId">
update mobile_benefit_package set
doctorId = #{doctorId,jdbcType=VARCHAR}
where phone = #{phone,jdbcType=VARCHAR} and orderId = #{orderId}
</update>
<select id="queryByPhone" resultType="com.ebaiyihui.family.doctor.server.entity.MobileBenefitPackageEntity"> <select id="queryByPhone" resultType="com.ebaiyihui.family.doctor.server.entity.MobileBenefitPackageEntity">
SELECT SELECT
<include refid="base_columns"/> <include refid="base_columns"/>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论