小程序个人中心添加更新签约编号
This commit is contained in:
parent
5adce2514b
commit
366cd7b1e1
@ -103,4 +103,5 @@ public interface ResidentPatientInfoMapper {
|
||||
*@return PatientInfo
|
||||
**/
|
||||
PatientInfo getPatientInfoByPatientCode(String patientCode);
|
||||
|
||||
}
|
||||
|
||||
@ -26,6 +26,7 @@ import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@ -49,6 +50,7 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi
|
||||
private AppletAccessTokenUtils appletAccessTokenUtils;
|
||||
@Resource
|
||||
private RedisTemplate<String, Object> redisTemplate;
|
||||
|
||||
/**
|
||||
* @return com.xinelu.familydoctor.applet.pojo.entity.PatientInfo
|
||||
* @Author mengkuiliang
|
||||
@ -164,7 +166,6 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi
|
||||
patientInfo.setDisease("0");
|
||||
}
|
||||
patientInfo.setLoginFlag(Long.valueOf(1));
|
||||
patientInfo.setSignNo(getSignInfo(body.getCityCode(), body.getCardNo()));
|
||||
updatePatientInfo(patientInfo);
|
||||
}
|
||||
// 注册
|
||||
@ -186,7 +187,6 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi
|
||||
entity.setCreateTime(new Date());
|
||||
entity.setCreateBy(body.getCardNo());
|
||||
entity.setLoginFlag(Long.valueOf(1));
|
||||
entity.setSignNo(getSignInfo(body.getCityCode(), body.getCardNo()));
|
||||
residentPatientInfoMapper.insertPatientInfo(entity);
|
||||
} else {
|
||||
if (!StringUtils.isBlank(patientInfo.getOpenid())) {
|
||||
@ -208,7 +208,6 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi
|
||||
} else {
|
||||
patientInfo.setDisease("0");
|
||||
}
|
||||
patientInfo.setSignNo(getSignInfo(body.getCityCode(), body.getCardNo()));
|
||||
residentPatientInfoMapper.updatePatientInfo(patientInfo);
|
||||
}
|
||||
}
|
||||
@ -278,6 +277,7 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi
|
||||
* @Param [registerCode]
|
||||
**/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public PatientInfo switchResident(String openid, String patientCode) {
|
||||
PatientInfo register = residentPatientInfoMapper.selectPatientInfoByCode(patientCode);
|
||||
if (register == null) {
|
||||
@ -294,6 +294,8 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi
|
||||
return residentPatientInfoMapper.selectPatientInfoByCode(patientCode);
|
||||
}
|
||||
|
||||
/** 判断2个参数是否一样 */
|
||||
|
||||
/**
|
||||
* @return java.lang.String
|
||||
* @Author mengkuiliang
|
||||
@ -307,15 +309,16 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi
|
||||
if (list == null || list.size() == 0) {
|
||||
return null;
|
||||
}
|
||||
PatientInfo patientInfo = null;
|
||||
// 获取当前选中的
|
||||
List<PatientInfo> currentList = list.stream().filter(p -> p.getIsChecked().equals("1")).collect(Collectors.toList());
|
||||
if (currentList.size() > 0) {
|
||||
if (!StringUtils.isBlank(currentList.get(0).getDisease())) {
|
||||
currentList.get(0).setDiseaseList(Arrays.asList(currentList.get(0).getDisease().split(",")));
|
||||
}
|
||||
return currentList.get(0);
|
||||
} else {
|
||||
patientInfo = currentList.get(0);
|
||||
// 没有已选择的,则取最新注册的一条数据
|
||||
} else {
|
||||
|
||||
// 更新选择标识
|
||||
residentPatientInfoMapper.updateChecked(list.get(0).getPatientCode(), "1");
|
||||
@ -324,8 +327,9 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi
|
||||
list.get(0).setDiseaseList(Arrays.asList(list.get(0).getDisease().split(",")));
|
||||
}
|
||||
list.get(0).setIsChecked("1");
|
||||
return list.get(0);
|
||||
patientInfo = list.get(0);
|
||||
}
|
||||
return patientInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -341,17 +345,16 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi
|
||||
}
|
||||
|
||||
/**
|
||||
* @return com.xinelu.familydoctor.applet.pojo.entity.PatientInfo
|
||||
* @Author mengkuiliang
|
||||
* @Description 是否已注册
|
||||
* @Date 2023-10-11 011 10:46
|
||||
* @Param [code]
|
||||
* @return com.xinelu.familydoctor.applet.pojo.entity.PatientInfo
|
||||
**/
|
||||
/*@Override
|
||||
public PatientInfo isRegistered(String code) {
|
||||
return getCurrentResident(getOpenId(code), null);
|
||||
}*/
|
||||
|
||||
@Override
|
||||
public HashMap<String, String> login(String loginCode, String phoneCode) throws Exception {
|
||||
HashMap<String, String> HashMap = new HashMap<>();
|
||||
|
||||
@ -487,7 +487,6 @@
|
||||
update patient_info set is_checked = #{isChecked} where patient_code = #{patientCode}
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 获取注册详细信息 -->
|
||||
<select id="selectPatientInfoByPhone" parameterType="String" resultMap="PatientInfoResult">
|
||||
<include refid="selectPatientInfoVo"/>
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.xinelu.applet.service.nurseapplogin.impl;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.xinelu.applet.dto.appletlogin.StationItemInfoDTO;
|
||||
import com.xinelu.applet.mapper.appletlogin.AppletLoginMapper;
|
||||
import com.xinelu.applet.mapper.nurseapplogin.NurseAppLoginMapper;
|
||||
@ -15,6 +16,8 @@ import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.common.enums.AppointmentTimeIntervalEnum;
|
||||
import com.xinelu.common.enums.GooodsOrderStatusEnum;
|
||||
import com.xinelu.common.utils.AgeUtil;
|
||||
import com.xinelu.common.utils.http.HttpService;
|
||||
import com.xinelu.common.utils.spring.SpringUtils;
|
||||
import com.xinelu.manage.domain.goodsOrder.GoodsOrder;
|
||||
import com.xinelu.manage.mapper.patientinfo.PatientInfoMapper;
|
||||
import com.xinelu.manage.mapper.sysarea.SysAreaMapper;
|
||||
@ -54,7 +57,8 @@ public class NurseAppLoginServiceImpl implements NurseAppLoginService {
|
||||
private SysConfigMapper sysConfigMapper;
|
||||
@Resource
|
||||
private PatientInfoMapper patientInfoMapper;
|
||||
|
||||
@Resource
|
||||
private HttpService httpService;
|
||||
|
||||
/**
|
||||
* 判断用户是否完善信息-微信小程序和APP共用
|
||||
@ -205,9 +209,39 @@ public class NurseAppLoginServiceImpl implements NurseAppLoginService {
|
||||
patientDisease.setWaitReceivedGoodsCount(waitReceivedGoodsCount);
|
||||
patientDisease.setReceivedGoodsCount(receivedGoodsCount);
|
||||
patientDisease.setEvaluatedCount(evaluatedCount);
|
||||
// 更新签约编号
|
||||
setSignInfo(patientDisease);
|
||||
return AjaxResult.success(patientDisease);
|
||||
}
|
||||
|
||||
// 更新签约编号
|
||||
private void setSignInfo(PatientAndDiseaseVO patientDisease) {
|
||||
if (!StringUtils.isBlank(patientDisease.getCityCode())) {
|
||||
try {
|
||||
String result = (String) httpService.get(SpringUtils.getFdUrl(patientDisease.getCityCode()) + "/resident/signinfo/detail/" + patientDisease.getCardNo(), null, String.class);
|
||||
JSONObject jsonObject = JSONObject.parseObject(result);
|
||||
if ("1".equals(jsonObject.get("code"))) {
|
||||
String signNo = "";
|
||||
if (jsonObject.getJSONObject("data") != null) {
|
||||
JSONObject signInfo = jsonObject.getJSONObject("data");
|
||||
if (signInfo.containsKey("signNo")) {
|
||||
signNo = signInfo.getString("signNo");
|
||||
}
|
||||
} else {
|
||||
signNo = null;
|
||||
}
|
||||
// 不一致才更新签约编号
|
||||
if(!String.valueOf(signNo).equals(String.valueOf(patientDisease.getSignNo()))) {
|
||||
patientInfoMapper.updateSignNo(patientDisease.getPatientId(), signNo);
|
||||
patientDisease.setSignNo(signNo);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("更新签约编号出错:{}", e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* App查询预约服务订单
|
||||
*
|
||||
|
||||
@ -161,6 +161,7 @@ public class PatientAndDiseaseVO implements Serializable {
|
||||
|
||||
private String disease;
|
||||
private String signNo;
|
||||
private String cityCode;
|
||||
/**
|
||||
* 基础疾病信息
|
||||
*/
|
||||
|
||||
@ -85,6 +85,7 @@
|
||||
pi.patient_code,
|
||||
pi.disease,
|
||||
pi.sign_no,
|
||||
pi.city_code,
|
||||
pdi.id patientDiseaseId,
|
||||
pdi.disease_id,
|
||||
pdi.disease_name,
|
||||
|
||||
@ -141,4 +141,13 @@ public interface PatientInfoMapper {
|
||||
* @return 数量
|
||||
*/
|
||||
int updatePersonalWeChatCodeUrl(@Param("id") Long id, @Param("personalWeChatCodeUrl") String personalWeChatCodeUrl);
|
||||
|
||||
/**
|
||||
* @Author mengkuiliang
|
||||
* @Description 更新签约标识
|
||||
* @Date 2023-10-23 023 14:33
|
||||
* @Param [id, signInfo]
|
||||
* @return void
|
||||
**/
|
||||
void updateSignNo(@Param("patientId") Long patientId, @Param("signNo") String signNo);
|
||||
}
|
||||
|
||||
@ -660,4 +660,10 @@
|
||||
update_time = now()
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 更新签约标识 -->
|
||||
<update id="updateSignNo">
|
||||
update patient_info set sign_no = #{signNo} where id = #{patientId}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user