根据前端统一请求头中region参数

This commit is contained in:
mengkuiliang 2023-11-09 10:27:18 +08:00
parent 3e28c16035
commit 40900ff82c
7 changed files with 22 additions and 28 deletions

View File

@ -144,15 +144,12 @@ public class ResidentServiceApplyController extends BaseController {
@ApiOperation("服务评价列表") @ApiOperation("服务评价列表")
@GetMapping("/evaluateRecord/{identity}") @GetMapping("/evaluateRecord/{identity}")
public R<List<OrderEvaluateVo>> performanceEvaluateRecord(@PathVariable String identity) { public R<List<OrderEvaluateVo>> performanceEvaluateRecord(@PathVariable String identity, @RequestHeader("region") String region) {
PatientInfo patientInfo = residentPatientInfoService.getByCardNo(identity); String result = (String) httpService.get(SpringUtils.getFdUrl(region) + "/performance/recordV2/" + identity, null, String.class);
if (patientInfo != null && !StringUtils.isBlank(patientInfo.getCityCode())) { JSONObject jsonObject = JSONObject.parseObject(result);
String result = (String) httpService.get(SpringUtils.getFdUrl(patientInfo.getCityCode()) + "/performance/recordV2/" + identity, null, String.class); if (jsonObject.getInteger("code") == 1) {
JSONObject jsonObject = JSONObject.parseObject(result); if (jsonObject.get("data") != null && jsonObject.getJSONArray("data").size() > 0) {
if (jsonObject.getInteger("code") == 1) { return R.ok(JSONArray.parseArray(jsonObject.getJSONArray("data").toJSONString()).toJavaList(OrderEvaluateVo.class));
if (jsonObject.get("data") != null && jsonObject.getJSONArray("data").size() > 0) {
return R.ok(JSONArray.parseArray(jsonObject.getJSONArray("data").toJSONString()).toJavaList(OrderEvaluateVo.class));
}
} }
} }
return R.ok(); return R.ok();

View File

@ -20,13 +20,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
/** /**
@ -102,13 +96,14 @@ public class ChatRecordController extends BaseController {
@ApiOperation(value = "获取指定类型的消息记录", notes = "1通知公告 2健康推送 4消息通知") @ApiOperation(value = "获取指定类型的消息记录", notes = "1通知公告 2健康推送 4消息通知")
@GetMapping("/getMegList") @GetMapping("/getMegList")
public TableDataInfo getMegList(MessageSearchDto messageDto) { public TableDataInfo getMegList(MessageSearchDto messageDto, @RequestHeader("region") String region) {
if (messageDto.getPatientId() == null) { if (messageDto.getPatientId() == null) {
throw new ServiceException("居民业务主键不能为空"); throw new ServiceException("居民业务主键不能为空");
} }
if (StringUtils.isBlank(messageDto.getMessageCategory())) { if (StringUtils.isBlank(messageDto.getMessageCategory())) {
throw new ServiceException("消息类型不能为空"); throw new ServiceException("消息类型不能为空");
} }
messageDto.setCityCode(region);
startPage(); startPage();
return getDataTable(chatRecordService.getMegList(messageDto)); return getDataTable(chatRecordService.getMegList(messageDto));
} }

View File

@ -9,12 +9,10 @@ import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.core.page.TableDataInfo; import com.xinelu.common.core.page.TableDataInfo;
import com.xinelu.common.custominterface.Query; import com.xinelu.common.custominterface.Query;
import com.xinelu.common.exception.ServiceException; import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.StringUtils;
import org.springframework.validation.BindingResult; import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List; import java.util.List;
@ -91,11 +89,11 @@ public class NurseAppLoginController extends BaseController {
*/ */
@MobileRequestAuthorization @MobileRequestAuthorization
@GetMapping("/appPersonal") @GetMapping("/appPersonal")
public AjaxResult nurseAppPersonal(Long patientId) { public AjaxResult nurseAppPersonal(Long patientId, @RequestHeader("region") String region) {
if (Objects.isNull(patientId)) { if (Objects.isNull(patientId)) {
return AjaxResult.error("用户信息不能为空!"); return AjaxResult.error("用户信息不能为空!");
} }
return nurseAppLoginService.nurseAppPersonal(patientId); return nurseAppLoginService.nurseAppPersonal(patientId, region);
} }
/** /**
@ -128,4 +126,4 @@ public class NurseAppLoginController extends BaseController {
} }
return nurseAppLoginService.updateAppointmentOrder(appointmentOrderId, cancelAppointmentReason); return nurseAppLoginService.updateAppointmentOrder(appointmentOrderId, cancelAppointmentReason);
} }
} }

View File

@ -44,7 +44,7 @@ public interface NurseAppLoginService {
* @param patientId 会员id * @param patientId 会员id
* @return 结果 * @return 结果
*/ */
AjaxResult nurseAppPersonal(Long patientId); AjaxResult nurseAppPersonal(Long patientId, String region);
/** /**
* App查询预约服务订单 * App查询预约服务订单

View File

@ -180,7 +180,7 @@ public class NurseAppLoginServiceImpl implements NurseAppLoginService {
* @return 结果 * @return 结果
*/ */
@Override @Override
public AjaxResult nurseAppPersonal(Long patientId) { public AjaxResult nurseAppPersonal(Long patientId, String region) {
PatientAndDiseaseVO patientDisease = nurseAppLoginMapper.getPatientDiseaseByPatientId(patientId); PatientAndDiseaseVO patientDisease = nurseAppLoginMapper.getPatientDiseaseByPatientId(patientId);
if (Objects.nonNull(patientDisease) && Objects.nonNull(patientDisease.getBirthDate())) { if (Objects.nonNull(patientDisease) && Objects.nonNull(patientDisease.getBirthDate())) {
patientDisease.setAge(AgeUtil.getAgeMonth(String.valueOf(patientDisease.getBirthDate()))); patientDisease.setAge(AgeUtil.getAgeMonth(String.valueOf(patientDisease.getBirthDate())));
@ -205,6 +205,7 @@ public class NurseAppLoginServiceImpl implements NurseAppLoginService {
} else { } else {
patientDisease.setAreaName(""); patientDisease.setAreaName("");
} }
patientDisease.setCityCode(region);
// 更新签约编号 // 更新签约编号
setSignInfo(patientDisease); setSignInfo(patientDisease);
//查询所有商品订单 //查询所有商品订单
@ -287,4 +288,4 @@ public class NurseAppLoginServiceImpl implements NurseAppLoginService {
} }
return AjaxResult.success(); return AjaxResult.success();
} }
} }

View File

@ -63,4 +63,7 @@ public class MessageSearchDto {
@ApiModelProperty(value = "通知适用人群编号集合", hidden = true) @ApiModelProperty(value = "通知适用人群编号集合", hidden = true)
private List<String> crowdNoList; private List<String> crowdNoList;
@ApiModelProperty("城市编码(1德州 2东营)")
private String cityCode;
} }

View File

@ -255,7 +255,7 @@ public class ChatRecordServiceImpl implements IChatRecordService {
return chatRecordMapper.selectMegList(messageDto); return chatRecordMapper.selectMegList(messageDto);
// 健康推送 // 健康推送
} else if(messageDto.getMessageCategory().equals("2")) { } else if(messageDto.getMessageCategory().equals("2")) {
String result = (String) httpService.get(SpringUtils.getFdUrl(patientInfo.getCityCode()) + "/resident/signinfo/detail/" + patientInfo.getCardNo(), null, String.class); String result = (String) httpService.get(SpringUtils.getFdUrl(messageDto.getCityCode()) + "/resident/signinfo/detail/" + patientInfo.getCardNo(), null, String.class);
JSONObject jsonObject = JSONObject.parseObject(result); JSONObject jsonObject = JSONObject.parseObject(result);
if (!"1".equals(jsonObject.get("code"))) { if (!"1".equals(jsonObject.get("code"))) {
throw new ServiceException(jsonObject.get("msg").toString()); throw new ServiceException(jsonObject.get("msg").toString());