Merge remote-tracking branch 'origin/dev_gy_0920' into jihan_0920_护理服务、商城、积分兑换、在线问诊功能分支
# Conflicts: # xinelu-admin/src/main/java/com/xinelu/web/controller/applet/ResidentPatientInfoController.java # xinelu-familydoctor/pom.xml # xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/service/impl/ResidentPatientInfoServiceImpl.java # xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/nurseapplogin/impl/NurseAppLoginServiceImpl.java
This commit is contained in:
commit
c6d6eeeb19
@ -79,10 +79,6 @@
|
||||
<groupId>com.xinelu</groupId>
|
||||
<artifactId>xinelu-nurse-applet</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.xinelu</groupId>
|
||||
<artifactId>xinelu-familydoctor</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 家医相关模块 -->
|
||||
<dependency>
|
||||
@ -90,6 +86,14 @@
|
||||
<artifactId>xinelu-familydoctor</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 德州市居民码SM3Hmac算法 -->
|
||||
<dependency>
|
||||
<groupId>com.tzwy</groupId>
|
||||
<artifactId>hmac</artifactId>
|
||||
<version>1.0</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${basedir}/src/main/resources/lib/hmac-1.0.jar</systemPath>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@ -0,0 +1,151 @@
|
||||
package com.xinelu.web.controller.applet;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.xinelu.applet.dto.chatrecord.ChatRecordDTO;
|
||||
import com.xinelu.applet.dto.chatrecord.MessageSearchDto;
|
||||
import com.xinelu.applet.service.chatRecord.IChatRecordService;
|
||||
import com.xinelu.applet.service.messagepush.MessagePushService;
|
||||
import com.xinelu.applet.vo.chatrecord.MessageVo;
|
||||
import com.xinelu.common.core.controller.BaseController;
|
||||
import com.xinelu.common.core.domain.R;
|
||||
import com.xinelu.common.exception.ServiceException;
|
||||
import com.xinelu.familydoctor.applet.pojo.body.MessagePushBody;
|
||||
import com.xinelu.familydoctor.applet.pojo.dto.FDMessageDto;
|
||||
import com.xinelu.familydoctor.applet.pojo.vo.SignInfoDataVo;
|
||||
import com.xinelu.framework.config.AsyncExecutorConfig;
|
||||
import com.xinelu.manage.domain.chatRecord.ChatRecord;
|
||||
import com.xinelu.manage.domain.hospitalpersoninfo.HospitalPersonInfo;
|
||||
import com.xinelu.manage.service.hospitalpersoninfo.IHospitalPersonInfoService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author mengkuiliang
|
||||
* @Description 家医消息推送控制器
|
||||
* @Date 2023-10-19 019 11:18
|
||||
* @Param
|
||||
* @return
|
||||
**/
|
||||
@Api(tags = "家医消息推送控制器")
|
||||
@RestController
|
||||
@RequestMapping("/applet/message")
|
||||
public class FdMessageController extends BaseController {
|
||||
@Resource
|
||||
private MessagePushService messagePushService;
|
||||
@Resource
|
||||
private AsyncExecutorConfig asyncExecutorConfig;
|
||||
@Resource
|
||||
private IChatRecordService chatRecordService;
|
||||
@Resource
|
||||
private IHospitalPersonInfoService hospitalPersonInfoService;
|
||||
|
||||
@ApiOperation(value = "家医推送订阅消息", notes = "向接收方推送订阅消息")
|
||||
@PostMapping("/push")
|
||||
public R<String> pushMessage(@RequestBody FDMessageDto message) throws Exception {
|
||||
if (StringUtils.isBlank(message.getRecipientIdentity())) {
|
||||
return R.fail("接收方参数异常");
|
||||
}
|
||||
if (StringUtils.isBlank(message.getTemplateType())) {
|
||||
return R.fail("消息模版参数异常");
|
||||
}
|
||||
messagePushService.FdPushMessage(JSONObject.parseObject(JSONObject.toJSONString(message)));
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "测试接口")
|
||||
@GetMapping("/test/")
|
||||
public R<SignInfoDataVo> test(MessagePushBody body, @RequestHeader("region") String region) {
|
||||
// JSONObject jsonObject = null;
|
||||
// try {
|
||||
// String result = (String) httpService.get(SpringUtils.getFdUrl(region) + "/resident/signinfo/detail/2334", null, String.class);
|
||||
// jsonObject = JSONObject.parseObject(result);
|
||||
// if ("0".equals(jsonObject.get("code"))) {
|
||||
// return R.fail(jsonObject.get("msg").toString());
|
||||
// }
|
||||
// if (!jsonObject.containsKey("data") || jsonObject.get("data") == null) {
|
||||
// return R.ok();
|
||||
// }
|
||||
// return R.ok(JSONObject.parseObject(jsonObject.getJSONObject("data").toJSONString(), SignInfoDataVo.class));
|
||||
// } catch (Exception e) {
|
||||
// System.out.println("注册完善信息-更新签约标识出错:" + e.getMessage());
|
||||
// }
|
||||
|
||||
ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
//设置子线程共享
|
||||
RequestContextHolder.setRequestAttributes(servletRequestAttributes, true);
|
||||
asyncExecutorConfig.asyncThreadServiceExecutor().execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
System.out.println("发送消息");
|
||||
messagePushService.fdApprovePush(JSONObject.parseObject(JSONObject.toJSONString(body)));
|
||||
}
|
||||
});
|
||||
System.out.println("执行成功");
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("查询通知推送列表-家医PC端")
|
||||
@PostMapping("/getNoticList")
|
||||
public R<PageInfo<MessageVo>> getNoticList(@RequestBody MessageSearchDto messageDto) {
|
||||
if (StringUtils.isBlank(messageDto.getSenderNo())) {
|
||||
return R.fail("发送人编号不能为空");
|
||||
}
|
||||
return R.ok(chatRecordService.getNoticList(messageDto));
|
||||
}
|
||||
|
||||
@ApiOperation("查询通知详情-PC端")
|
||||
@GetMapping("/getNoticDetail/{messageNo}")
|
||||
public R<MessageVo> getNoticDetail(@PathVariable String messageNo) {
|
||||
return R.ok(chatRecordService.getNoticDetail(messageNo));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "保存通知-PC端", notes = "健康推送和通知公告消息通知")
|
||||
@PostMapping("/noticeSave")
|
||||
@Transactional
|
||||
public R<?> noticeSave(@RequestBody ChatRecordDTO message) {
|
||||
// 根据发送人编号查询家医用户信息
|
||||
HospitalPersonInfo hospitalPersonInfo = hospitalPersonInfoService.getByPersonCode(message.getSenderNo(), null);
|
||||
if(hospitalPersonInfo == null) {
|
||||
throw new ServiceException("未查询到医生信息");
|
||||
}
|
||||
if(StringUtils.isBlank(message.getMessageNo())) {
|
||||
message.setSendTime(new Date());
|
||||
message.setSenderId(hospitalPersonInfo.getId());
|
||||
message.setSenderName(hospitalPersonInfo.getPersonName());
|
||||
chatRecordService.insertChatRecord(message);
|
||||
} else {
|
||||
MessageVo messageVo = chatRecordService.getNoticDetail(message.getMessageNo());
|
||||
if(messageVo != null) {
|
||||
ChatRecord entity = new ChatRecord();
|
||||
BeanUtils.copyProperties(messageVo, entity);
|
||||
entity.setMessageType(message.getMessageType());
|
||||
entity.setContent(message.getContent());
|
||||
entity.setCrowds(message.getCrowds());
|
||||
entity.setCrowdsName(message.getCrowdsName());
|
||||
entity.setTitle(message.getTitle());
|
||||
entity.setUpdateTime(new Date());
|
||||
entity.setUpdateBy(message.getSenderNo());
|
||||
chatRecordService.updateChatRecordOfNo(entity);
|
||||
}
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("删除通知-家医PC端")
|
||||
@GetMapping("/noticDel/{messageNo}")
|
||||
public R<String> noticDel(@PathVariable String messageNo) {
|
||||
chatRecordService.del(messageNo);
|
||||
return R.ok();
|
||||
}
|
||||
}
|
||||
@ -37,7 +37,7 @@ public class PatientScoreController extends BaseController {
|
||||
if (!jsonObject.get("code").toString().equals("1")) {
|
||||
return R.fail(jsonObject.get("msg").toString());
|
||||
}
|
||||
return R.ok("请求成功", jsonObject.getString("data"));
|
||||
return R.ok(jsonObject.getString("data"));
|
||||
}
|
||||
|
||||
@ApiOperation("获取居民积分记录列表")
|
||||
|
||||
@ -47,13 +47,14 @@ public class ResidentPatientInfoController extends BaseController {
|
||||
@ApiOperation("注册完善信息")
|
||||
@PostMapping("")
|
||||
public R<String> register(@Validated @RequestBody PatientInfoBody body) {
|
||||
/*if(body.getDiseaseList() == null || body.getDiseaseList().size() == 0) {
|
||||
return R.fail("请选择基础疾病");
|
||||
}*/
|
||||
// if(body.getDiseaseList() == null || body.getDiseaseList().size() == 0) {
|
||||
// return R.fail("请选择基础疾病");
|
||||
// }
|
||||
try {
|
||||
residentPatientInfoService.register(body);
|
||||
return R.ok();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return R.fail(e.getMessage());
|
||||
}
|
||||
}
|
||||
@ -78,9 +79,9 @@ public class ResidentPatientInfoController extends BaseController {
|
||||
}
|
||||
|
||||
@ApiOperation("获取已注册列表")
|
||||
@GetMapping("/getList/{openid}/{cityCode}")
|
||||
public R<List<PatientInfo>> getList(@PathVariable String openid, @PathVariable String cityCode) {
|
||||
return R.ok(residentPatientInfoService.getList(openid, cityCode));
|
||||
@GetMapping("/getList/{openid}")
|
||||
public R<List<PatientInfo>> getList(@PathVariable String openid) {
|
||||
return R.ok(residentPatientInfoService.getList(openid, null));
|
||||
}
|
||||
|
||||
@ApiOperation("切换账号")
|
||||
|
||||
@ -1,14 +1,22 @@
|
||||
package com.xinelu.web.controller.applet;
|
||||
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.xinelu.common.core.controller.BaseController;
|
||||
import com.xinelu.common.core.domain.R;
|
||||
import com.xinelu.common.core.page.TableDataInfo;
|
||||
import com.xinelu.common.exception.ServiceException;
|
||||
import com.xinelu.common.utils.http.HttpService;
|
||||
import com.xinelu.common.utils.spring.SpringUtils;
|
||||
import com.xinelu.familydoctor.applet.pojo.body.ResidentServiceApplyBody;
|
||||
import com.xinelu.familydoctor.applet.pojo.entity.PatientInfo;
|
||||
import com.xinelu.familydoctor.applet.pojo.query.ApplyQuery;
|
||||
import com.xinelu.familydoctor.applet.pojo.vo.ResidentServiceApplyVo;
|
||||
import com.xinelu.familydoctor.applet.pojo.vo.ScreeningProjectVo;
|
||||
import com.xinelu.familydoctor.applet.pojo.query.ServiceRecordQuery;
|
||||
import com.xinelu.familydoctor.applet.pojo.vo.*;
|
||||
import com.xinelu.familydoctor.applet.service.IResidentPatientInfoService;
|
||||
import com.xinelu.familydoctor.applet.service.IResidentServiceAppletService;
|
||||
import com.xinelu.manage.domain.orderevaluateinfo.OrderEvaluateInfo;
|
||||
import com.xinelu.manage.service.orderevaluateinfo.IOrderEvaluateInfoService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@ -16,6 +24,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Author mengkuiliang
|
||||
@ -31,28 +40,34 @@ public class ResidentServiceApplyController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private IResidentServiceAppletService residentServiceAppletService;
|
||||
@Resource
|
||||
private HttpService httpService;
|
||||
@Resource
|
||||
private IResidentPatientInfoService residentPatientInfoService;
|
||||
@Resource
|
||||
private IOrderEvaluateInfoService orderEvaluateInfoService;
|
||||
|
||||
@ApiOperation("提交服务预约")
|
||||
@ApiOperation("提交服务申请")
|
||||
@PostMapping("/save")
|
||||
public R<?> save(@RequestBody ResidentServiceApplyBody body) {
|
||||
if (body == null || StringUtils.isBlank(body.getPackageNo()) || StringUtils.isBlank(body.getFormNo())) {
|
||||
return R.fail("请求参数不能为空");
|
||||
}
|
||||
if(StringUtils.isBlank(body.getIdentity())) {
|
||||
if (StringUtils.isBlank(body.getIdentity())) {
|
||||
return R.fail("居民身份证号不能为空");
|
||||
}
|
||||
residentServiceAppletService.insert(body);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("取消服务预约")
|
||||
@ApiOperation("取消服务申请")
|
||||
@GetMapping("/cancel/{bookingNo}")
|
||||
public R<?> cancel(@PathVariable String bookingNo) {
|
||||
residentServiceAppletService.cancel(bookingNo);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("服务预约列表")
|
||||
@ApiOperation("服务申请列表")
|
||||
@PostMapping("/list")
|
||||
public TableDataInfo performanceBookingList(@RequestBody ApplyQuery query) {
|
||||
if (StringUtils.isBlank(query.getIdentity())) {
|
||||
@ -67,30 +82,79 @@ public class ResidentServiceApplyController extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("服务预约详情")
|
||||
@ApiOperation("服务申请详情")
|
||||
@GetMapping("/detail/{bookingNo}")
|
||||
public R<ResidentServiceApplyVo> performanceBookingDetail(@PathVariable String bookingNo) {
|
||||
return R.ok(residentServiceAppletService.detail(bookingNo));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取服务预约项目列表", notes = "获取家医个性服务包和筛查项目")
|
||||
@ApiOperation(value = "获取服务申请项目列表", notes = "获取家医个性服务包和筛查项目")
|
||||
@GetMapping("/getForm/{identity}")
|
||||
public R<List<ScreeningProjectVo>> getForm(@PathVariable String identity, String projectName, @RequestHeader("region") String region) {
|
||||
return R.ok(residentServiceAppletService.getForm(identity, projectName,region));
|
||||
return R.ok(residentServiceAppletService.getForm(identity, projectName, region));
|
||||
}
|
||||
|
||||
@ApiOperation("服务记录列表")
|
||||
@PostMapping("/record")
|
||||
public TableDataInfo performanceBookingRecord(@RequestBody ApplyQuery query) {
|
||||
if (StringUtils.isBlank(query.getIdentity())) {
|
||||
throw new ServiceException("居民身份证号不能为空");
|
||||
@GetMapping("/record/{identity}")
|
||||
public R<List<ResidentServiceRecordVo>> performanceBookingRecord(@PathVariable String identity, ServiceRecordQuery query, @RequestHeader("region") String region) {
|
||||
query.setIdentity(identity);
|
||||
if (query.getPageNum() == null) {
|
||||
query.setPageNum(1);
|
||||
}
|
||||
try {
|
||||
startPage();
|
||||
return getDataTable(residentServiceAppletService.record(query));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new ServiceException(e.getMessage());
|
||||
if (query.getPageSize() == null) {
|
||||
query.setPageSize(1000);
|
||||
}
|
||||
JSONObject result = httpService.post(SpringUtils.getFdUrl(region) + "/performance/recordV1", null, JSONObject.parseObject(JSONObject.toJSONString(query)));
|
||||
if (result.get("code").toString().equals("0")) {
|
||||
throw new ServiceException(result.get("msg").toString());
|
||||
}
|
||||
if (result.get("data") != null) {
|
||||
List<ResidentServiceRecordVo> perRecordList = JSONArray.parseArray(result.getJSONObject("data").getJSONArray("list").toJSONString()).toJavaList(ResidentServiceRecordVo.class);
|
||||
if (perRecordList != null && perRecordList.size() > 0) {
|
||||
// 查询评价
|
||||
List<OrderEvaluateInfo> list = orderEvaluateInfoService.selectOrderEvaluateByServiceNos(perRecordList.stream().map(ResidentServiceRecordVo::getPerformanceNo).collect(Collectors.toList()), "FAMILY_DOCTOR");
|
||||
if (list != null && list.size() > 0) {
|
||||
List<OrderEvaluateInfo> orderEvaluateInfoTempList;
|
||||
for (ResidentServiceRecordVo record : perRecordList) {
|
||||
orderEvaluateInfoTempList = list.stream().filter(o -> o.getOrderNo().equals(record.getPerformanceNo())).collect(Collectors.toList());
|
||||
if (orderEvaluateInfoTempList.size() > 0) {
|
||||
record.setOrderEvaluateInfo(orderEvaluateInfoTempList.get(0));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return R.ok(perRecordList);
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("获取服务记录详情")
|
||||
@GetMapping("/serviceRecordDetail/{identity}/{performanceNo}")
|
||||
public R<ResidentServiceRecordVo> serviceRecordDetail(@PathVariable String identity, @PathVariable String performanceNo, @RequestHeader("region") String region) {
|
||||
String result = (String) httpService.get(SpringUtils.getFdUrl(region) + "/performance/detail/" + identity + "/" + performanceNo, null, String.class);
|
||||
JSONObject jsonObject = JSONObject.parseObject(result);
|
||||
if (jsonObject.getInteger("code") != 1) {
|
||||
throw new ServiceException(jsonObject.getString("msg"));
|
||||
}
|
||||
if (jsonObject.get("data") != null) {
|
||||
return R.ok(JSONObject.parseObject(jsonObject.getJSONObject("data").toJSONString(), ResidentServiceRecordVo.class));
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("服务评价列表")
|
||||
@GetMapping("/evaluateRecord/{identity}")
|
||||
public R<List<OrderEvaluateVo>> performanceEvaluateRecord(@PathVariable String identity) {
|
||||
PatientInfo patientInfo = residentPatientInfoService.getByCardNo(identity);
|
||||
if (patientInfo != null && !StringUtils.isBlank(patientInfo.getCityCode())) {
|
||||
String result = (String) httpService.get(SpringUtils.getFdUrl(patientInfo.getCityCode()) + "/performance/recordV2/" + identity, null, String.class);
|
||||
JSONObject jsonObject = JSONObject.parseObject(result);
|
||||
if (jsonObject.getInteger("code") == 1) {
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@ package com.xinelu.web.controller.applet;
|
||||
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.xinelu.applet.service.messagepush.MessagePushService;
|
||||
import com.xinelu.common.core.controller.BaseController;
|
||||
import com.xinelu.common.core.domain.R;
|
||||
import com.xinelu.common.core.page.TableDataInfo;
|
||||
@ -13,6 +14,7 @@ import com.xinelu.familydoctor.applet.pojo.query.NearbyOrgQuery;
|
||||
import com.xinelu.familydoctor.applet.pojo.query.PackageQuery;
|
||||
import com.xinelu.familydoctor.applet.pojo.query.TeamListQuery;
|
||||
import com.xinelu.familydoctor.applet.pojo.vo.*;
|
||||
import com.xinelu.framework.config.AsyncExecutorConfig;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@ -280,4 +282,5 @@ public class SignInfoController extends BaseController {
|
||||
}
|
||||
return R.ok(JSONObject.parseObject(jsonObject.getJSONObject("data").toJSONString(), SignInfoDataVo.class));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
package com.xinelu.web.controller.familydoctor;
|
||||
|
||||
import com.xinelu.common.core.controller.BaseController;
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.common.core.domain.R;
|
||||
import com.xinelu.familydoctor.entity.DeviceBindResident;
|
||||
import com.xinelu.familydoctor.service.DeviceBindResidentService;
|
||||
import io.swagger.annotations.Api;
|
||||
@ -26,38 +26,34 @@ public class DeviceBindResidentController extends BaseController {
|
||||
|
||||
@ApiOperation("绑定设备")
|
||||
@PostMapping("binding")
|
||||
public AjaxResult bind(@RequestBody DeviceBindResident entity) {
|
||||
public R<?> bind(@RequestBody DeviceBindResident entity) {
|
||||
if (deviceBindResidentService.repeatBind(entity)) {
|
||||
return AjaxResult.error("设备【" + entity.getSn() + "】已绑定");
|
||||
return R.fail("设备【" + entity.getSn() + "】已绑定");
|
||||
}
|
||||
AjaxResult ajaxResult;
|
||||
int row = deviceBindResidentService.bindDevice(entity);
|
||||
if (row > 0) {
|
||||
ajaxResult = AjaxResult.success();
|
||||
return R.ok();
|
||||
} else {
|
||||
ajaxResult = AjaxResult.error("绑定失败");
|
||||
return R.fail("绑定失败");
|
||||
}
|
||||
return ajaxResult;
|
||||
}
|
||||
|
||||
@ApiOperation("已绑定的设备")
|
||||
@GetMapping("bound/{identity}")
|
||||
@ApiImplicitParam(name = "identity", value = "身份证号", required = true)
|
||||
public AjaxResult boundDevice(@PathVariable String identity) {
|
||||
public R<List<DeviceBindResident>> boundDevice(@PathVariable String identity) {
|
||||
List<DeviceBindResident> list = deviceBindResidentService.boundDevice(identity);
|
||||
return AjaxResult.success(list);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
@ApiOperation("解绑设备")
|
||||
@PostMapping("unbind")
|
||||
public AjaxResult unbindDevice(@RequestBody DeviceBindResident entity) {
|
||||
AjaxResult ajaxResult;
|
||||
public R<?> unbindDevice(@RequestBody DeviceBindResident entity) {
|
||||
int row = deviceBindResidentService.unbindDevice(entity);
|
||||
if (row > 0) {
|
||||
ajaxResult = AjaxResult.success();
|
||||
return R.ok();
|
||||
} else {
|
||||
ajaxResult = AjaxResult.error("解绑失败");
|
||||
return R.fail("解绑失败");
|
||||
}
|
||||
return ajaxResult;
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,65 @@
|
||||
package com.xinelu.web.controller.familydoctor;
|
||||
|
||||
import com.xinelu.common.core.controller.BaseController;
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.common.core.page.TableDataInfo;
|
||||
import com.xinelu.familydoctor.entity.EvaluateAdviceTemplate;
|
||||
import com.xinelu.familydoctor.service.EvaluateAdviceTemplateService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author gaoyu
|
||||
* @description 自我评估处方模板接口控制器
|
||||
* @date 2023-10-16 16:59
|
||||
*/
|
||||
@Api(tags = {"自我评估处方模板接口控制器"})
|
||||
@RestController
|
||||
@RequestMapping("/evaluate/advice/template")
|
||||
public class EvaluateAdviceTemplateController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private EvaluateAdviceTemplateService evaluateAdviceTemplateService;
|
||||
|
||||
@ApiOperation("模板列表")
|
||||
@GetMapping("list")
|
||||
public TableDataInfo list(EvaluateAdviceTemplate entity) {
|
||||
startPage();
|
||||
List<EvaluateAdviceTemplate> list = evaluateAdviceTemplateService.findList(entity);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ApiOperation("新增/编辑模板")
|
||||
@PostMapping("save")
|
||||
public AjaxResult save(@RequestBody EvaluateAdviceTemplate entity) {
|
||||
evaluateAdviceTemplateService.save(entity);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation("修改模板状态")
|
||||
@PostMapping("change/status")
|
||||
public AjaxResult changeStatus(@RequestBody EvaluateAdviceTemplate entity) {
|
||||
evaluateAdviceTemplateService.changeStatus(entity);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation("逻辑删除模板")
|
||||
@PostMapping("del/{id}")
|
||||
@ApiImplicitParam(name = "id", value = "模板ID", required = true)
|
||||
public AjaxResult del(@PathVariable Long id) {
|
||||
evaluateAdviceTemplateService.delTemplate(id);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation("根据自评结果获取处方模板")
|
||||
@GetMapping("get/{templateType}")
|
||||
@ApiImplicitParam(name = "templateType", value = "处方模板类型", required = true)
|
||||
public AjaxResult getTemplate(@PathVariable String templateType) {
|
||||
return AjaxResult.success(evaluateAdviceTemplateService.getTemplate(templateType));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,88 @@
|
||||
package com.xinelu.web.controller.familydoctor;
|
||||
|
||||
import com.xinelu.common.core.controller.BaseController;
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.common.core.page.TableDataInfo;
|
||||
import com.xinelu.familydoctor.entity.EvaluateRecord;
|
||||
import com.xinelu.familydoctor.entity.EvaluateSurvey;
|
||||
import com.xinelu.familydoctor.service.EvaluateRecordService;
|
||||
import com.xinelu.familydoctor.service.EvaluateSurveyService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author gaoyu
|
||||
* @description 自我评估问卷控制器
|
||||
* @date 2023-10-10 11:02
|
||||
*/
|
||||
@Api(tags = {"自我评估问卷控制器"})
|
||||
@RestController
|
||||
@RequestMapping("/evaluate")
|
||||
public class EvaluateSurveyController extends BaseController {
|
||||
@Resource
|
||||
private EvaluateSurveyService evaluateSurveyService;
|
||||
@Resource
|
||||
private EvaluateRecordService evaluateRecordService;
|
||||
|
||||
@ApiOperation("问卷列表")
|
||||
@GetMapping("survey/list")
|
||||
public TableDataInfo surveyList(EvaluateSurvey entity) {
|
||||
startPage();
|
||||
List<EvaluateSurvey> list = evaluateSurveyService.findList(entity);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ApiOperation("问卷新增")
|
||||
@PostMapping("survey/save")
|
||||
public AjaxResult surveySave(@RequestBody EvaluateSurvey entity) {
|
||||
evaluateSurveyService.insert(entity);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation("问卷编辑")
|
||||
@PostMapping("survey/update")
|
||||
public AjaxResult surveyUpdate(@RequestBody EvaluateSurvey entity) {
|
||||
evaluateSurveyService.update(entity);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation("修改问卷状态(启用/停用)")
|
||||
@PostMapping("survey/change/state")
|
||||
public AjaxResult changeState() {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation("获取问卷")
|
||||
@GetMapping("survey/get/{subject}")
|
||||
@ApiImplicitParam(name = "subject", value = "问卷主题", required = true)
|
||||
public AjaxResult getSurvey(@PathVariable String subject) {
|
||||
EvaluateSurvey survey = evaluateSurveyService.getSurvey(subject);
|
||||
return AjaxResult.success(survey);
|
||||
}
|
||||
|
||||
@ApiOperation("问卷提交")
|
||||
@PostMapping("survey/submit")
|
||||
public AjaxResult surveySubmit(@RequestBody EvaluateRecord evaluateRecord) {
|
||||
evaluateRecordService.submit(evaluateRecord);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation("获取评估记录")
|
||||
@GetMapping("record/timeline/{userId}")
|
||||
@ApiImplicitParam(name = "userId", value = "用户ID", required = true)
|
||||
public AjaxResult record(@PathVariable Long userId) {
|
||||
return AjaxResult.success(evaluateRecordService.getEvaluateTimeline(userId));
|
||||
}
|
||||
|
||||
@ApiOperation("获取评估问卷答案")
|
||||
@GetMapping("survey/answer/{recordId}")
|
||||
@ApiImplicitParam(name = "recordId", value = "评估记录ID", required = true)
|
||||
public AjaxResult detail(@PathVariable Long recordId) {
|
||||
return AjaxResult.success(evaluateRecordService.getAnswers(recordId));
|
||||
}
|
||||
}
|
||||
@ -1,9 +1,10 @@
|
||||
package com.xinelu.web.controller.familydoctor;
|
||||
|
||||
import com.xinelu.common.core.controller.BaseController;
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.common.core.domain.R;
|
||||
import com.xinelu.familydoctor.entity.*;
|
||||
import com.xinelu.familydoctor.service.PhysicalSignService;
|
||||
import com.xinelu.familydoctor.vo.PhysicalLastRecordVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
@ -11,6 +12,7 @@ import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@ -27,51 +29,51 @@ public class PhysicalSignController extends BaseController {
|
||||
|
||||
@ApiOperation("上传血糖")
|
||||
@PostMapping("bg/save")
|
||||
public AjaxResult saveBg(@RequestBody DeviceBgRecord record) {
|
||||
public R<?> saveBg(@RequestBody DeviceBgRecord record) {
|
||||
physicalSignService.saveBg(record);
|
||||
return AjaxResult.success();
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("上传血压")
|
||||
@PostMapping("bp/save")
|
||||
public AjaxResult saveBp(@RequestBody DeviceBpRecord record) {
|
||||
public R<?> saveBp(@RequestBody DeviceBpRecord record) {
|
||||
physicalSignService.saveBp(record);
|
||||
return AjaxResult.success();
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("上传血脂")
|
||||
@PostMapping("bf/save")
|
||||
public AjaxResult saveBf(@RequestBody DeviceBfRecord record) {
|
||||
public R<?> saveBf(@RequestBody DeviceBfRecord record) {
|
||||
physicalSignService.saveBf(record);
|
||||
return AjaxResult.success();
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("上传BMI")
|
||||
@PostMapping("bmi/save")
|
||||
public AjaxResult saveBmi(@RequestBody DeviceBmiRecord record) {
|
||||
public R<?> saveBmi(@RequestBody DeviceBmiRecord record) {
|
||||
physicalSignService.saveBmi(record);
|
||||
return AjaxResult.success();
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("上传血氧")
|
||||
@PostMapping("bo/save")
|
||||
public AjaxResult saveBo(@RequestBody DeviceBoRecord record) {
|
||||
public R<?> saveBo(@RequestBody DeviceBoRecord record) {
|
||||
physicalSignService.saveBo(record);
|
||||
return AjaxResult.success();
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("上传心率")
|
||||
@PostMapping("hr/save")
|
||||
public AjaxResult saveHr(@RequestBody DeviceHrRecord record) {
|
||||
public R<?> saveHr(@RequestBody DeviceHrRecord record) {
|
||||
physicalSignService.saveHr(record);
|
||||
return AjaxResult.success();
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("上传体温")
|
||||
@PostMapping("temp/save")
|
||||
public AjaxResult saveTemp(@RequestBody DeviceTempRecord record) {
|
||||
public R<?> saveTemp(@RequestBody DeviceTempRecord record) {
|
||||
physicalSignService.saveTemp(record);
|
||||
return AjaxResult.success();
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("获取体征记录")
|
||||
@ -79,8 +81,15 @@ public class PhysicalSignController extends BaseController {
|
||||
@ApiImplicitParams({@ApiImplicitParam(name = "identity", value = "身份证号", required = true),
|
||||
@ApiImplicitParam(name = "type", value = "时间类型0:全部1:周2:月3:年", required = true),
|
||||
@ApiImplicitParam(name = "label", value = "查询标识1:血糖2:血压3:血脂4:bmi5:血氧6:心率7:体温", required = true)})
|
||||
public AjaxResult record(String identity, String type, String label) {
|
||||
public R<?> record(String identity, String type, String label) {
|
||||
Map<String, Object> map = physicalSignService.record(identity, type, label);
|
||||
return AjaxResult.success(map);
|
||||
return R.ok(map);
|
||||
}
|
||||
|
||||
@ApiOperation("获取最后一次体征记录")
|
||||
@GetMapping("record/last/{identity}")
|
||||
@ApiImplicitParam(name = "identity", value = "身份证号", required = true)
|
||||
public R<List<PhysicalLastRecordVO>> lastRecord(@PathVariable String identity) {
|
||||
return R.ok(physicalSignService.getLastRecord(identity));
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,352 @@
|
||||
package com.xinelu.web.controller.fd;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.xinelu.common.core.controller.BaseController;
|
||||
import com.xinelu.common.core.domain.R;
|
||||
import com.xinelu.common.exception.ServiceException;
|
||||
import com.xinelu.common.utils.DateUtils;
|
||||
import com.xinelu.common.utils.http.HttpService;
|
||||
import com.xinelu.common.utils.http.SslUtils;
|
||||
import com.xinelu.familydoctor.applet.pojo.body.DzsCodeBody;
|
||||
import com.xinelu.familydoctor.applet.pojo.query.DzsCodeQuery;
|
||||
import com.xinelu.web.controller.fd.utils.DzsCodeSign;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Api(tags = "德州市居民码控制器(爱山东APP)")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/applet/fd/dzs/code")
|
||||
public class DzsCodeController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private HttpService httpService;
|
||||
@Value("${dzsCode.appid}")
|
||||
private String appid;
|
||||
@Value("${dzsCode.appSecret}")
|
||||
private String appSecret;
|
||||
@Value("${dzsCode.url}")
|
||||
private String url;
|
||||
@Value("${dzsCode.mutualUrl}")
|
||||
private String mutualUrl;
|
||||
@Value("${dzsCode.isSecret}")
|
||||
private String isSecret;
|
||||
@Value("${dzsCode.isWhole}")
|
||||
private String isWhole;
|
||||
@Value("${dzsCode.institutionCode}")
|
||||
private String institutionCode;
|
||||
@Value("${dzsCode.useCityCode}")
|
||||
private String useCityCode;
|
||||
@Value("${dzsCode.businessStepCode}")
|
||||
private String businessStepCode;
|
||||
|
||||
@ApiOperation(value = "居民码注册接口")
|
||||
@GetMapping("/register")
|
||||
public R<?> register(DzsCodeBody body) {
|
||||
try {
|
||||
JSONObject bodyParams = registerBody(body);
|
||||
String message = "";
|
||||
// 0:明文 1:加密
|
||||
if (isSecret.equals("1")) {
|
||||
message = DzsCodeSign.makeSign(appSecret, bodyParams.toJSONString());
|
||||
} else {
|
||||
message = bodyParams.toJSONString();
|
||||
}
|
||||
Map<String, Object> headerMap = headerParams(message);
|
||||
// 0:明文 1:加密
|
||||
JSONObject requestBody = new JSONObject();
|
||||
requestBody.put("message", message);
|
||||
SslUtils.ignoreSsl();
|
||||
JSONObject resultObj = httpService.post(url + "/register", headerMap, requestBody);
|
||||
log.info("居民码注册接口响应:{}", resultObj);
|
||||
if (!resultObj.containsKey("code") || !resultObj.getString("code").equals("200")) {
|
||||
if (resultObj.containsKey("msg") && !StringUtils.isBlank(resultObj.getString("msg"))) {
|
||||
return R.fail(resultObj.getString("msg"));
|
||||
}
|
||||
return R.fail("接口异常");
|
||||
}
|
||||
if (resultObj.containsKey("data")) {
|
||||
return R.ok(resultObj.get("data"));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new ServiceException(e.getMessage());
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "居民码查询接口")
|
||||
@GetMapping("/analysis")
|
||||
public R<?> query(DzsCodeQuery queryBody) {
|
||||
try {
|
||||
JSONObject bodyParams;
|
||||
switch (queryBody.getInterfaceName()) {
|
||||
// 是否已注册
|
||||
case "isReg":
|
||||
bodyParams = isRegBody(queryBody.getCardType(), queryBody.getCardNo());
|
||||
break;
|
||||
// 根据UID获取码值
|
||||
case "getCodeByUid":
|
||||
bodyParams = getCodeByUidBody(queryBody.getUid());
|
||||
break;
|
||||
// 根据证件获取居民码
|
||||
case "getCodeByCard":
|
||||
bodyParams = getCodeByCardBody(queryBody.getCardType(), queryBody.getCardNo());
|
||||
break;
|
||||
// 解析二维码
|
||||
case "parsingCode":
|
||||
bodyParams = parsingCodeBody(queryBody.getQrCode());
|
||||
break;
|
||||
// 获取用户信息
|
||||
case "getUserInfo":
|
||||
bodyParams = getUserInfoBody(queryBody.getJmmCode());
|
||||
break;
|
||||
default:
|
||||
return R.fail("参数无效");
|
||||
}
|
||||
String message = "";
|
||||
// 0:明文 1:加密
|
||||
if (isSecret.equals("1")) {
|
||||
message = DzsCodeSign.makeSign(appSecret, bodyParams.toJSONString());
|
||||
} else {
|
||||
message = bodyParams.toJSONString();
|
||||
}
|
||||
Map<String, Object> headerMap = headerParams(message);
|
||||
// 0:明文 1:加密
|
||||
JSONObject requestBody = new JSONObject();
|
||||
requestBody.put("message", message);
|
||||
SslUtils.ignoreSsl();
|
||||
JSONObject resultObj = httpService.post(url + "/" + queryBody.getInterfaceName(), headerMap, requestBody);
|
||||
log.info("居民码{}接口响应:{}", queryBody.getInterfaceName(), resultObj);
|
||||
if (!resultObj.containsKey("code") || !resultObj.getString("code").equals("200")) {
|
||||
if (resultObj.containsKey("msg") && !StringUtils.isBlank(resultObj.getString("msg"))) {
|
||||
return R.fail(resultObj.getString("msg"));
|
||||
}
|
||||
return R.fail("接口异常");
|
||||
}
|
||||
if (resultObj.containsKey("data")) {
|
||||
return R.ok(resultObj.getJSONObject("data"));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new ServiceException(e.getMessage());
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "多码互认接口")
|
||||
@PostMapping("/mutualDiscern")
|
||||
public R<?> mutualDiscern(@RequestBody DzsCodeBody body) {
|
||||
// 请求参数示例:
|
||||
// {
|
||||
// "qrCode":"SDQR0000001A00010001371400011667058654613299203000169828216216982822221410ff8de0b234bdf8a92932e36173578789c4099bf3606c4c1e3e175a91a5ac754434bd767e4155ffdf095dc8a096714d4b86e535231efbb5383e9fd4cd13f2"
|
||||
// }
|
||||
if(body == null || StringUtils.isBlank(body.getQrCode())) {
|
||||
return R.fail("请求参数无效");
|
||||
}
|
||||
try {
|
||||
JSONObject bodyParams = mutualDiscernBody(body.getQrCode());
|
||||
Map<String, Object> headerMap;
|
||||
SslUtils.ignoreSsl();
|
||||
String message = "";
|
||||
JSONObject resultObj;
|
||||
// 0:明文 1:加密
|
||||
if (isSecret.equals("1")) {
|
||||
message = DzsCodeSign.makeSign(appSecret, bodyParams.toJSONString());
|
||||
headerMap = headerParams(message);
|
||||
resultObj = httpService.post(mutualUrl + "/mutualDiscern", headerMap, message);
|
||||
} else {
|
||||
headerMap = headerParams(bodyParams.toJSONString());
|
||||
resultObj = httpService.post(mutualUrl + "/mutualDiscern", headerMap, bodyParams);
|
||||
}
|
||||
log.info("居民码多码互认接口响应:{}", resultObj);
|
||||
if (!resultObj.containsKey("code") || !resultObj.getString("code").equals("200")) {
|
||||
if (resultObj.containsKey("msg") && !StringUtils.isBlank(resultObj.getString("msg"))) {
|
||||
if (resultObj.containsKey("detail") && !StringUtils.isBlank(resultObj.getString("detail"))) {
|
||||
return R.fail(resultObj.getString("msg") + "->" + resultObj.getString("detail"));
|
||||
} else {
|
||||
return R.fail(resultObj.getString("msg"));
|
||||
}
|
||||
}
|
||||
return R.fail("接口异常");
|
||||
}
|
||||
if (resultObj.containsKey("data")) {
|
||||
return R.ok(resultObj.getJSONObject("data"));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new ServiceException(e.getMessage());
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置请求header参数 参数都是必填的
|
||||
*/
|
||||
private Map<String, Object> headerParams(String message) {
|
||||
Map<String, Object> headMap = new HashMap<>();
|
||||
// 客户端生成的安全随机码
|
||||
String nonceStr = DzsCodeSign.getRandomString(10);
|
||||
// 当前时间(yyyyMMddHHmmss)
|
||||
String time = DateUtils.formatDate(new Date(), "yyyyMMddHHmmss");
|
||||
// 根据appid、nonceStr、time和(message),经过HMAC算法计算的值
|
||||
String str = appid + "&" + time + "&" + nonceStr;
|
||||
if (isWhole.equals("1")) {
|
||||
str += message;
|
||||
}
|
||||
System.out.println("签名字符串:" + str);
|
||||
|
||||
// 应用ID
|
||||
headMap.put("appid", appid);
|
||||
headMap.put("nonceStr", nonceStr);
|
||||
headMap.put("time", time);
|
||||
headMap.put("sign", DzsCodeSign.makeSign(appSecret, str));
|
||||
headMap.put("isSecret", isSecret);
|
||||
headMap.put("isWhole", isWhole);
|
||||
return headMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置body参数 - 判断是否已注册居民码
|
||||
*/
|
||||
private JSONObject isRegBody(String cardType, String cardNo) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
// 证件类型 必
|
||||
jsonObject.put("cardType", cardType);
|
||||
// 证件编号 必
|
||||
jsonObject.put("cardNo", cardNo);
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置body参数 - 用户注册
|
||||
*/
|
||||
private JSONObject registerBody(DzsCodeBody body) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置body参数 - 根据UID获取居民码
|
||||
*/
|
||||
private JSONObject getCodeByUidBody(String uid) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
// 居民码UID 必
|
||||
jsonObject.put("uid", uid);
|
||||
// 经度
|
||||
jsonObject.put("longitude", "");
|
||||
// 纬度
|
||||
jsonObject.put("latitude", "");
|
||||
// 县区编码
|
||||
jsonObject.put("county", "");
|
||||
// 街道
|
||||
jsonObject.put("subdistrict", "");
|
||||
// 地点
|
||||
jsonObject.put("position", "");
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置body参数 - 根据证件获取居民码
|
||||
*/
|
||||
private JSONObject getCodeByCardBody(String cardType, String cardNo) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
// 证件类型 必
|
||||
jsonObject.put("cardType", cardType);
|
||||
// 证件编号 必
|
||||
jsonObject.put("cardNo", cardNo);
|
||||
// 经度
|
||||
jsonObject.put("longitude", "");
|
||||
// 纬度
|
||||
jsonObject.put("latitude", "");
|
||||
// 县区编码
|
||||
jsonObject.put("county", "");
|
||||
// 街道
|
||||
jsonObject.put("subdistrict", "");
|
||||
// 地点
|
||||
jsonObject.put("position", "");
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置body参数 - 解析二维码
|
||||
*/
|
||||
private JSONObject parsingCodeBody(String qrCode) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
// 必
|
||||
jsonObject.put("QrCode", qrCode);
|
||||
// 机构编码 必
|
||||
jsonObject.put("institutionCode", institutionCode);
|
||||
// 终端类型(0人工、1自助)必
|
||||
jsonObject.put("channelCode", "0");
|
||||
// 业务环节 必
|
||||
jsonObject.put("businessStepCode", businessStepCode);
|
||||
// 用码时间 yyyy-MM-dd HH:mm:ss 必
|
||||
jsonObject.put("useTime", DateUtils.formatDate(new Date(), "yyyy-MM-dd HH:mm:ss"));
|
||||
// 返回值类型(对接时添加,后台的 二维码解析返回值类型)必
|
||||
jsonObject.put("returnValueType", "01");
|
||||
// 经度
|
||||
jsonObject.put("longitude", "");
|
||||
// 纬度
|
||||
jsonObject.put("latitude", "");
|
||||
// 县区编码
|
||||
jsonObject.put("county", "");
|
||||
// 街道
|
||||
jsonObject.put("subdistrict", "");
|
||||
// 地点
|
||||
jsonObject.put("position", "");
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置body参数 - 获取用户信息
|
||||
*/
|
||||
private JSONObject getUserInfoBody(String jmmCode) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
// 省居民码授权码 必
|
||||
jsonObject.put("jmmCode", jmmCode);
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置body参数 - 多码互认 二维码识读
|
||||
*/
|
||||
private JSONObject mutualDiscernBody(String qrCode) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
// 必
|
||||
jsonObject.put("QrCode", qrCode);
|
||||
// 城市编码 必
|
||||
jsonObject.put("useCityCode", useCityCode);
|
||||
// 机构编码 必
|
||||
jsonObject.put("institutionCode", institutionCode);
|
||||
// 终端类型(0人工、1自助)必
|
||||
jsonObject.put("channelCode", "0");
|
||||
// 业务环节(接口方提供) 必
|
||||
jsonObject.put("businessStepCode", businessStepCode);
|
||||
// 用卡时间 yyyy-MM-dd HH:mm:ss 必
|
||||
jsonObject.put("useTime", DateUtils.formatDate(new Date(), "yyyy-MM-dd HH:mm:ss"));
|
||||
// 返回值类型(对接时添加,后台的 二维码解析返回值类型)必
|
||||
jsonObject.put("returnValueType", "01");
|
||||
// 经度
|
||||
jsonObject.put("longitude", "");
|
||||
// 纬度
|
||||
jsonObject.put("latitude", "");
|
||||
// 县区编码 (市辖区:371401 德城区:371402 陵城区:371403 宁津县:371422 庆云县:371423 临邑县:371424 齐河县:371425 平原县:371426 夏津县:371427 武城县:371428 乐陵市:371481 禹城市:371482 天衢新区:371471)
|
||||
jsonObject.put("county", "");
|
||||
// 街道
|
||||
jsonObject.put("subdistrict", "");
|
||||
// 地点
|
||||
jsonObject.put("position", "");
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,9 +1,15 @@
|
||||
package com.xinelu.web.controller.fd;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.xinelu.applet.dto.chatrecord.ChatRecordDTO;
|
||||
import com.xinelu.applet.dto.chatrecord.MessageSearchDto;
|
||||
import com.xinelu.applet.service.chatRecord.IChatRecordService;
|
||||
import com.xinelu.applet.vo.chatrecord.MessageVo;
|
||||
import com.xinelu.common.core.domain.R;
|
||||
import com.xinelu.familydoctor.applet.pojo.body.ApprovalBody;
|
||||
import com.xinelu.familydoctor.applet.pojo.body.SyncHospitalPersonInfoBody;
|
||||
import com.xinelu.familydoctor.applet.pojo.query.ApplyQuery;
|
||||
import com.xinelu.familydoctor.applet.pojo.vo.ResidentRescindApplyVo;
|
||||
import com.xinelu.familydoctor.applet.pojo.vo.ResidentServiceApplyVo;
|
||||
@ -11,11 +17,20 @@ import com.xinelu.familydoctor.applet.pojo.vo.ResidentSignApplyVo;
|
||||
import com.xinelu.familydoctor.applet.service.IResidentRescindApplyService;
|
||||
import com.xinelu.familydoctor.applet.service.IResidentServiceAppletService;
|
||||
import com.xinelu.familydoctor.applet.service.IResidentSignAppletService;
|
||||
import com.xinelu.manage.domain.chatRecord.ChatRecord;
|
||||
import com.xinelu.manage.domain.hospitalinfo.HospitalInfo;
|
||||
import com.xinelu.manage.domain.hospitalpersoninfo.HospitalPersonInfo;
|
||||
import com.xinelu.manage.service.hospitalinfo.IHospitalInfoService;
|
||||
import com.xinelu.manage.service.hospitalpersoninfo.IHospitalPersonInfoService;
|
||||
import com.xinelu.manage.service.patientinfo.IPatientInfoService;
|
||||
import com.xinelu.manage.vo.patientinfo.PatientInfoVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@ -31,8 +46,13 @@ public class FDController {
|
||||
private IResidentSignAppletService residentSignAppletService;
|
||||
@Resource
|
||||
private IResidentServiceAppletService residentServiceAppletService;
|
||||
@Resource
|
||||
private IPatientInfoService patientInfoService;
|
||||
@Resource
|
||||
private IPatientInfoService patientInfoService;
|
||||
@Resource
|
||||
private IHospitalPersonInfoService hospitalPersonInfoService;
|
||||
@Resource
|
||||
private IHospitalInfoService hospitalInfoService;
|
||||
|
||||
|
||||
@ApiOperation("服务申请列表")
|
||||
@PostMapping("/performanceBooking/list")
|
||||
@ -40,6 +60,7 @@ public class FDController {
|
||||
PageHelper.startPage(query.getPageNum(), query.getPageSize());
|
||||
return R.ok(PageInfo.of(residentServiceAppletService.findList(query)));
|
||||
}
|
||||
|
||||
@ApiOperation("服务申请详情")
|
||||
@GetMapping("/performanceBooking/detail/{bookingNo}")
|
||||
public R<ResidentServiceApplyVo> performanceBookingDetail(@PathVariable String bookingNo) {
|
||||
@ -66,13 +87,14 @@ public class FDController {
|
||||
@ApiOperation("解约申请列表")
|
||||
@PostMapping("/rescindApply/list")
|
||||
public R<PageInfo<ResidentRescindApplyVo>> rescindApplyList(@RequestBody ApplyQuery query) {
|
||||
if(StringUtils.isBlank(query.getUserNo())) {
|
||||
if (StringUtils.isBlank(query.getUserNo())) {
|
||||
return R.fail("医生编号不能为空");
|
||||
}
|
||||
PageHelper.startPage(query.getPageNum(), query.getPageSize());
|
||||
query.setBookingStatus("0");
|
||||
return R.ok(PageInfo.of(residentRescindApplyService.findList(query)));
|
||||
}
|
||||
|
||||
@ApiOperation("解约申请详情")
|
||||
@GetMapping("/rescindApply/detail/{applyNo}")
|
||||
public R<ResidentRescindApplyVo> rescindApplyDetail(@PathVariable String applyNo) {
|
||||
@ -92,7 +114,7 @@ public class FDController {
|
||||
@ApiOperation("签约申请列表")
|
||||
@PostMapping("/signBooking/list")
|
||||
public R<PageInfo<ResidentSignApplyVo>> signBookingList(@RequestBody ApplyQuery query) {
|
||||
if(StringUtils.isBlank(query.getUserNo())) {
|
||||
if (StringUtils.isBlank(query.getUserNo())) {
|
||||
return R.fail("医生编号不能为空");
|
||||
}
|
||||
PageHelper.startPage(query.getPageNum(), query.getPageSize());
|
||||
@ -116,15 +138,66 @@ public class FDController {
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("根据签约主键查询绑定编号")
|
||||
@GetMapping("/signBooking/getBySignNo/{cardNo}")
|
||||
public R<JSONObject> getBySignNo(@PathVariable String cardNo) {
|
||||
JSONObject retObj = new JSONObject();
|
||||
@ApiOperation("根据签约主键查询绑定编号")
|
||||
@GetMapping("/signBooking/getBySignNo/{cardNo}")
|
||||
public R<JSONObject> getBySignNo(@PathVariable String cardNo) {
|
||||
JSONObject retObj = new JSONObject();
|
||||
PatientInfoVO patientInfo = patientInfoService.selectPatientInfoByCardNo(cardNo);
|
||||
if (patientInfo != null) {
|
||||
retObj.fluentPut("bindingNo", patientInfo.getPatientCode())
|
||||
.fluentPut("openid", patientInfo.getOpenid());
|
||||
}
|
||||
return R.ok(retObj);
|
||||
}
|
||||
if (patientInfo != null) {
|
||||
retObj.fluentPut("bindingNo", patientInfo.getPatientCode())
|
||||
.fluentPut("openid", patientInfo.getOpenid());
|
||||
}
|
||||
return R.ok(retObj);
|
||||
}
|
||||
|
||||
@ApiOperation("家医医生同步科室人员信息")
|
||||
@PostMapping("/synHospatialPersonInfo")
|
||||
public R<?> synHospatialPersonInfo(@RequestBody SyncHospitalPersonInfoBody body) {
|
||||
if (body == null) {
|
||||
return R.fail("请求参数不能为空");
|
||||
}
|
||||
if (StringUtils.isBlank(body.getPersonCode())) {
|
||||
return R.fail("科室人员编号不能为空");
|
||||
}
|
||||
if (StringUtils.isBlank(body.getOrgCode())) {
|
||||
return R.fail("家医机构编号不能为空");
|
||||
}
|
||||
// 判断是否已存在
|
||||
HospitalPersonInfo hospitalPersonInfo = hospitalPersonInfoService.getByPersonCode(body.getPersonCode(), body.getStatus());
|
||||
// 根据家医机构查询医院信息
|
||||
HospitalInfo hospital = hospitalInfoService.getHosptalByOrgCode(body.getOrgCode());
|
||||
// 新增
|
||||
if (hospitalPersonInfo == null) {
|
||||
hospitalPersonInfo = new HospitalPersonInfo();
|
||||
BeanUtils.copyProperties(body, hospitalPersonInfo);
|
||||
hospitalPersonInfo.setCreateBy(body.getPersonCode());
|
||||
hospitalPersonInfo.setStatus("1");
|
||||
if (hospital != null) {
|
||||
hospitalPersonInfo.setHospitalId(hospital.getId());
|
||||
}
|
||||
hospitalPersonInfoService.insert(hospitalPersonInfo);
|
||||
|
||||
// 修改
|
||||
} else {
|
||||
if (!String.valueOf(hospitalPersonInfo.getPersonAccount()).equals(String.valueOf(body.getPersonAccount()))
|
||||
|| !String.valueOf(hospitalPersonInfo.getPersonPhone()).equals(String.valueOf(body.getPersonPhone()))
|
||||
|| !String.valueOf(hospitalPersonInfo.getPersonName()).equals(String.valueOf(body.getPersonName()))
|
||||
|| !String.valueOf(hospitalPersonInfo.getPersonIntroduce()).equals(String.valueOf(body.getPersonIntroduce()))
|
||||
|| !String.valueOf(hospitalPersonInfo.getCardNo()).equals(String.valueOf(body.getCardNo()))
|
||||
) {
|
||||
hospitalPersonInfo.setPersonName(body.getPersonName());
|
||||
hospitalPersonInfo.setPersonPhone(body.getPersonPhone());
|
||||
hospitalPersonInfo.setPersonAddress(body.getPersonAddress());
|
||||
hospitalPersonInfo.setPersonAccount(body.getPersonAccount());
|
||||
hospitalPersonInfo.setPersonIntroduce(body.getPersonIntroduce());
|
||||
hospitalPersonInfo.setCardNo(body.getCardNo());
|
||||
if (hospital != null) {
|
||||
hospitalPersonInfo.setHospitalId(hospital.getId());
|
||||
}
|
||||
hospitalPersonInfo.setUpdateBy(body.getPersonCode());
|
||||
hospitalPersonInfoService.updateByPersonCode(hospitalPersonInfo);
|
||||
}
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,98 @@
|
||||
package com.xinelu.web.controller.fd.utils;
|
||||
|
||||
import cn.hutool.core.codec.Base64;
|
||||
import cn.hutool.core.util.HexUtil;
|
||||
import com.tzwy.hmac.sm3.utils.Sm3HmacUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* @Author mengkuiliang
|
||||
* @Description 德州市居民码签名工具类
|
||||
* @Date 2023-06-08 16:45
|
||||
* @Param
|
||||
* @return
|
||||
**/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class DzsCodeSign {
|
||||
|
||||
/**
|
||||
* @return java.lang.String
|
||||
* @Author mengkuiliang
|
||||
* @Description 生成签名
|
||||
* @Date 2023-06-08 16:40
|
||||
* @Param [appId, appSecret, isWhole]
|
||||
**/
|
||||
public static String createSign(String appId, String appSecret, String isWhole, String message) {
|
||||
SimpleDateFormat formater = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
String str;
|
||||
if(isWhole.equals("0")) {
|
||||
str = appId + "&" + formater.format(new Date()) + "&" + getRandomString(10);
|
||||
} else {
|
||||
// message前边没有 &
|
||||
str = appId + "&" + formater.format(new Date()) + "&" + getRandomString(10) + message;
|
||||
}
|
||||
System.out.println("签名字符串:" + str);
|
||||
return makeSign(appSecret, str);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return boolean
|
||||
* @Author mengkuiliang
|
||||
* @Description 验证签名
|
||||
* @Date 2023-06-08 16:43
|
||||
* @Param [str, appSecret, sign]
|
||||
**/
|
||||
public static boolean verifySign(String str, String appSecret, String sign) {
|
||||
String signS = makeSign(appSecret, str);
|
||||
return signS.equals(sign);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成指定长度的随机字符串
|
||||
*/
|
||||
public static String getRandomString(int length) {
|
||||
String str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
||||
Random random = new Random();
|
||||
StringBuffer sb = new StringBuffer();
|
||||
for (int i = 0; i < length; i++) {
|
||||
int number = random.nextInt(62);
|
||||
sb.append(str.charAt(number));
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成签名
|
||||
*/
|
||||
public static String makeSign(String appSecret, String str) {
|
||||
try {
|
||||
byte[] sm3Sign = Sm3HmacUtils.calcMac(HexUtil.decodeHex(appSecret), str.getBytes("UTF-8"));
|
||||
return Base64.encode(sm3Sign);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws UnsupportedEncodingException {
|
||||
|
||||
String appSecret = "74cb380c19b5448da4d7a1ef505089c4";
|
||||
String appid = "lhw8570wl9zojyou6zv6";
|
||||
// String time = DateUtils.formatDate(new Date(), "yyyyMMddHHmmss");
|
||||
String time = "20230609165045";
|
||||
// String nonceStr = DzsCodeSign.getRandomString(10);
|
||||
String nonceStr = "8EqtkddxC2";
|
||||
String str = appid + "&" + time + "&" + nonceStr;
|
||||
String signS = makeSign(appSecret, str);
|
||||
System.out.println(signS);
|
||||
|
||||
// JAlMiqpak3hwtTa+OzlWPcTuE2sSwn+F/I0j5/Cu3Mg=
|
||||
}
|
||||
}
|
||||
@ -163,7 +163,7 @@ token:
|
||||
# 令牌有效期(默认30分钟)
|
||||
expireTime: 1440
|
||||
#请求拦截白名单
|
||||
ant-matchers: /nurseApplet/**,/nurseApp/**,/applet/**,webSocket/**
|
||||
ant-matchers: /nurseApplet/**,/nurseApp/**,/applet/**,webSocket/**,/message/**
|
||||
|
||||
# MyBatis-Plus配置
|
||||
mybatis-plus:
|
||||
@ -249,8 +249,8 @@ xss:
|
||||
|
||||
# 家医配置
|
||||
fd:
|
||||
dy: http://192.168.124.6:8001/fd/mp
|
||||
dz: http://192.168.124.6:8001/fd/mp
|
||||
dz: http://8.131.93.145:54089/fd/mp
|
||||
dy: http://8.131.93.145:54089/fd/mp
|
||||
# 签约附近的机构多少公里内 <=0时不限制
|
||||
distance: 0
|
||||
|
||||
@ -315,4 +315,23 @@ we-chat-payment-url-config:
|
||||
logistics-config:
|
||||
e-business-id: 1781371
|
||||
api-key: 998b273d-c926-4659-a9d5-ae0613782d70
|
||||
express-bird-url: https://api.kdniao.com/Ebusiness/EbusinessOrderHandle.aspx
|
||||
express-bird-url: https://api.kdniao.com/Ebusiness/EbusinessOrderHandle.aspx
|
||||
|
||||
# 德州市鲁通码接口配置
|
||||
dzsCode:
|
||||
appid: lhw8570wl9zojyou6zv6
|
||||
appSecret: 74cb380c19b5448da4d7a1ef505089c4
|
||||
# 接口服务
|
||||
url: https://dsjj.dezhou.gov.cn/dzjmm/code
|
||||
# 多码互认
|
||||
mutualUrl: https://dsjj.dezhou.gov.cn/dzjmm/mutual
|
||||
# 传输数据是否要加密(0:否1:是)
|
||||
isSecret: 0
|
||||
# 是否校验完整性(0:否1:是) 当为1时:sign的生成入参包括message
|
||||
isWhole: 0
|
||||
# 机构编码
|
||||
institutionCode: 1137140000440159XP
|
||||
# 城市编码 德州市
|
||||
useCityCode: 371400
|
||||
# 业务场景
|
||||
businessStepCode: 302
|
||||
|
||||
BIN
xinelu-admin/src/main/resources/lib/hmac-1.0.jar
Normal file
BIN
xinelu-admin/src/main/resources/lib/hmac-1.0.jar
Normal file
Binary file not shown.
@ -64,4 +64,5 @@ public class AppletChatConfig {
|
||||
* 签到通知模板
|
||||
*/
|
||||
private String signTemplateId;
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,79 @@
|
||||
package com.xinelu.common.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @Author mengkuiliang
|
||||
* @Description 订阅消息枚举
|
||||
* @Date 2023-01-11 17:32
|
||||
* @Param
|
||||
* @return
|
||||
**/
|
||||
@Getter
|
||||
public enum MessageTemplateType {
|
||||
|
||||
JTYSXXTZ("1", "家庭医生消息通知", "8InV9jXDT5sMj9OWfXEvlLQGlw2UaWfZ9OBMFxufmfk", "默认通知模版"),
|
||||
|
||||
YYTX_1("9", "用药提醒", "2wn1BssReKjZasxKKZRWxBN0VqSmGmkuhc3AhTr18I0", "提醒居民用药"),
|
||||
|
||||
YYCGTZ("10", "预约成功", "MSSKCxOdtMUkY1ACu-u3itz8Vh_w5xDkO2llAOGwElU", "筛查项目预约成功");
|
||||
|
||||
|
||||
/**
|
||||
* 模版类型
|
||||
*/
|
||||
private final String type;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
private final String title;
|
||||
/**
|
||||
* 模版ID
|
||||
*/
|
||||
private final String templateId;
|
||||
/**
|
||||
* 说明
|
||||
*/
|
||||
private final String description;
|
||||
|
||||
MessageTemplateType(String type,String title, String templateId, String description) {
|
||||
this.type = type;
|
||||
this.title = title;
|
||||
this.templateId = templateId;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public static MessageTemplateType getFolllowupTypeByCode(String type) {
|
||||
for (MessageTemplateType templateType : MessageTemplateType.values()) {
|
||||
if (type.equals(templateType.getType())) {
|
||||
return templateType;
|
||||
}
|
||||
}
|
||||
return MessageTemplateType.JTYSXXTZ;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获得所有枚举类型到list
|
||||
*/
|
||||
public static List<MessageTemplateType> getAllToList() {
|
||||
List<MessageTemplateType> list = new ArrayList<>();
|
||||
MessageTemplateType[] values = values();
|
||||
Collections.addAll(list, values);
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得所有枚举类型到map
|
||||
*/
|
||||
public static Map<String, MessageTemplateType> getAllToMap() {
|
||||
Map<String, MessageTemplateType> map = new HashMap<>();
|
||||
for (MessageTemplateType templateType : values()) {
|
||||
map.put(templateType.getType(), templateType);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,45 @@
|
||||
package com.xinelu.common.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
/**
|
||||
* @Author haown
|
||||
* @Description 订阅消息跳转路径枚举类
|
||||
* @Date 2023-05-11 17:32
|
||||
* @return
|
||||
**/
|
||||
@Getter
|
||||
public enum MessageTypePath {
|
||||
//消息类型,1:健康推送,2:日常提醒, 3:风险评估完成, 4:推送筛查项目,5:预约筛查成功, 6:筛查完成,
|
||||
// 7:康复处方,8:随访提醒,9:纳入管理,10:申请转诊,11:转诊申请通过,12:申请会诊,13:会诊申请通过,14:处理异常"
|
||||
JKTS("1", "pages/index/index"),
|
||||
RCTX("2", "pages/dailyhealth/dailyhealth"),
|
||||
FXPG("3", "pages/index/index"),
|
||||
SCXM("4", "pagesB/screeningUserInfo/screeningUserInfo?assessRecordId="),
|
||||
YYCG("5", "pages/index/index"),
|
||||
SCWC("6", "pages/screeningResult/screeningResult?screeningId="),
|
||||
KFCF("7", "pages/boughtRecoveryPrescription/boughtRecoveryPrescription?prescriptionRecordId="),
|
||||
DEFAULT("0", "pages/index/index");
|
||||
|
||||
private final String messageType;
|
||||
|
||||
private final String path;
|
||||
|
||||
MessageTypePath(String messageType, String path) {
|
||||
this.messageType = messageType;
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
public static MessageTypePath getPathByType(String type) {
|
||||
if(StringUtils.isBlank(type)) {
|
||||
return MessageTypePath.DEFAULT;
|
||||
}
|
||||
for (MessageTypePath typePath : MessageTypePath.values()) {
|
||||
if (type.equals(typePath.getMessageType())) {
|
||||
return typePath;
|
||||
}
|
||||
}
|
||||
return MessageTypePath.DEFAULT;
|
||||
}
|
||||
}
|
||||
@ -35,6 +35,6 @@ public enum RegionKeyType {
|
||||
return uploadType;
|
||||
}
|
||||
}
|
||||
throw new ServiceException("获取区域配置出错");
|
||||
throw new ServiceException("未查询到区域配置");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,32 @@
|
||||
package com.xinelu.common.enums;
|
||||
/**
|
||||
* @description: 问卷主题枚举
|
||||
* @author gaoyu
|
||||
* @date 2023-10-11 10:44
|
||||
*/
|
||||
public enum SurveySubjectEnum {
|
||||
HBP_EVALUATE("1001", "高血压评估问卷"),
|
||||
BG_EVALUATE("1002", "糖尿病评估问卷"),
|
||||
STOKE_EVALUATE("1003", "脑卒中评估问卷"),
|
||||
COPD_EVALUATE("1004", "慢阻肺评估问卷"),
|
||||
CHRONIC_EVALUATE("1005", "慢病评估问卷"),
|
||||
NS_EVALUATE("1006", "糖尿病肾病评估问卷"),
|
||||
ED_EVALUATE("1007", "糖尿病眼病评估问卷"),
|
||||
FD_EVALUATE("1008", "糖尿病足病评估问卷");
|
||||
|
||||
private final String code;
|
||||
private final String label;
|
||||
|
||||
SurveySubjectEnum(String code, String label) {
|
||||
this.code = code;
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
}
|
||||
@ -79,7 +79,7 @@ public class HttpUtils {
|
||||
while ((line = in.readLine()) != null) {
|
||||
result.append(line);
|
||||
}
|
||||
log.info("recv - {}", result);
|
||||
// log.info("recv - {}", result);
|
||||
} catch (ConnectException e) {
|
||||
log.error("调用HttpUtils.sendGet ConnectException, url=" + url + ",param=" + param, e);
|
||||
} catch (SocketTimeoutException e) {
|
||||
@ -130,7 +130,7 @@ public class HttpUtils {
|
||||
while ((line = in.readLine()) != null) {
|
||||
result.append(line);
|
||||
}
|
||||
log.info("recv - {}", result);
|
||||
// log.info("recv - {}", result);
|
||||
} catch (ConnectException e) {
|
||||
log.error("调用HttpUtils.sendPost ConnectException, url=" + url + ",param=" + param, e);
|
||||
} catch (SocketTimeoutException e) {
|
||||
@ -182,7 +182,7 @@ public class HttpUtils {
|
||||
result.append(new String(ret.getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8));
|
||||
}
|
||||
}
|
||||
log.info("recv - {}", result);
|
||||
// log.info("recv - {}", result);
|
||||
conn.disconnect();
|
||||
br.close();
|
||||
} catch (ConnectException e) {
|
||||
|
||||
@ -0,0 +1,72 @@
|
||||
package com.xinelu.common.utils.map;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author mengkuiliang
|
||||
* @Description Obj转Map
|
||||
* @Date 2022-04-27 13:39
|
||||
* @Param
|
||||
* @return
|
||||
**/
|
||||
public class MapUtil {
|
||||
/**
|
||||
* Pojo -> Map<String, Object>
|
||||
*
|
||||
* @param obj
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public static Map<String, Object> object2Map(Object obj) throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
Field[] fields = obj.getClass().getDeclaredFields();
|
||||
for (Field field : fields) {
|
||||
field.setAccessible(true);
|
||||
map.put(field.getName(), field.get(obj));
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* List<T> --> List<Map<String, Object>>
|
||||
*
|
||||
* @param objectList
|
||||
* @param <T>
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public static <T> List<Map<String, Object>> objectList2ListMap(List<T> objectList) throws Exception {
|
||||
ArrayList<Map<String, Object>> resultList = new ArrayList<>();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
for (T t : objectList) {
|
||||
resultList.add(object2Map(t));
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
/**
|
||||
* List<T> --> Map<String, List<Object>>
|
||||
*
|
||||
* @param objectList
|
||||
* @param keyName
|
||||
* @param <T>
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public static <T> Map<String, List<Object>> objectList2MapList(List<T> objectList, String[] keyName) throws Exception {
|
||||
Map<String, List<Object>> resultMap = new HashMap<>();
|
||||
for (int i = 0; i < keyName.length; i++) {
|
||||
List<Object> arrayList = new ArrayList<>();
|
||||
// List有序,所以对每个对象依次变为map,然后得到对应的值,存入arrayList
|
||||
for (T t : objectList) {
|
||||
arrayList.add(object2Map(t).get(keyName[i]));
|
||||
}
|
||||
resultMap.put(keyName[i], arrayList);//将keyName和对应List集合存入resultMap
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
}
|
||||
@ -39,6 +39,10 @@
|
||||
<groupId>com.xinelu</groupId>
|
||||
<artifactId>xinelu-nurse-manage</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.xinelu</groupId>
|
||||
<artifactId>xinelu-nurse-applet</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.xinelu</groupId>
|
||||
<artifactId>xinelu-nurse-applet</artifactId>
|
||||
|
||||
@ -103,4 +103,5 @@ public interface ResidentPatientInfoMapper {
|
||||
*@return PatientInfo
|
||||
**/
|
||||
PatientInfo getPatientInfoByPatientCode(String patientCode);
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,66 @@
|
||||
package com.xinelu.familydoctor.applet.pojo.body;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author mengkuiliang
|
||||
* @Description 德州市居民码请求对象
|
||||
* @Date 2023-06-09 9:45
|
||||
* @Param
|
||||
* @return
|
||||
**/
|
||||
@Data
|
||||
@ApiModel("德州市居民码请求对象")
|
||||
public class DzsCodeBody {
|
||||
|
||||
@ApiModelProperty(value = "二维码信息")
|
||||
private String qrCode;
|
||||
|
||||
@ApiModelProperty(value = "姓名", required = true)
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "证件类型", required = true)
|
||||
private String cardType;
|
||||
|
||||
@ApiModelProperty(value = "证件号码", required = true)
|
||||
private String cardNo;
|
||||
|
||||
@ApiModelProperty(value = "电话号码", required = true)
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty(value = "民族 (01:汉族 02:蒙古族 03:回族 04:藏族 05:维吾尔族 06:苗族 07:彝族 08:壮族 09:布依族 10:朝鲜族 11:满族 12:侗族 13:瑶族 14:白族 15:土家族 16:哈尼族 17:哈萨克族 18:傣族 19:黎族 20:傈僳族 21:佤族 22:畲族 23:高山族 24:拉祜族 25:水族 26:东乡族 27:纳西族 28:景颇族 29:柯尔柯孜族 30:土族 31:达尔族 32:仫佬族 33:羌族 34:布朗族 35:撒拉族 36:毛南族 37:仡佬族 38:锡伯族 39:阿昌族 40:普米族 41:塔吉克族 42:怒族 43:乌孜别克族 44:俄罗斯族 45:鄂温克族 46:德昂族 47:保安族 48:裕固族 49:京族 50:塔塔尔族 51:独龙族 52:鄂伦春族 53:赫哲族 54:门巴族 55:珞巴族 56:基诺族 97:其他未识别的民族)", required = true)
|
||||
private String nation;
|
||||
|
||||
@ApiModelProperty(value = "性别 (1:男 2:女 9:未说明性别 )", required = true)
|
||||
private String sex;
|
||||
|
||||
@ApiModelProperty(value = "注册途径(11:APP 12:微信公众帐号 13:支付宝服务号 21:自助机 31:窗口 41:批量处理)", required = true)
|
||||
private String regChannel;
|
||||
|
||||
@ApiModelProperty(value = "注册模式(1线上、2线下)", required = true)
|
||||
private String regMode;
|
||||
|
||||
@ApiModelProperty(value = "个人审核材料上传地址(身份证时可空;非身份证时必填)")
|
||||
private String path;
|
||||
|
||||
@ApiModelProperty(value = "绑卡类型(对接时添加,后台字典的 证件类型--可绑定证)")
|
||||
private String bindCardType;
|
||||
|
||||
@ApiModelProperty(value = "绑卡卡号")
|
||||
private String bindCardNo;
|
||||
|
||||
@ApiModelProperty(value = "出生年月(yyyyMM 证件类型是身份证时可空,非身份证时必填)")
|
||||
private String birthday;
|
||||
|
||||
@ApiModelProperty(value = "地区编码")
|
||||
private String addressAreaCode;
|
||||
|
||||
@ApiModelProperty(value = "用户uid(调用省居民码接口返回)", required = true)
|
||||
private String uid;
|
||||
|
||||
@ApiModelProperty(value = "用户id(调用省居民码接口返回)", required = true)
|
||||
private String qcUserId;
|
||||
|
||||
}
|
||||
@ -0,0 +1,90 @@
|
||||
package com.xinelu.familydoctor.applet.pojo.body;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author mengkuiliang
|
||||
* @Description 消息推送请求对象
|
||||
* @Date 2023-10-18 018 14:26
|
||||
* @Param
|
||||
* @return
|
||||
**/
|
||||
@Data
|
||||
@ApiModel(value = "消息推送请求对象")
|
||||
public class MessagePushBody {
|
||||
|
||||
/**
|
||||
* 消息类别 1:通知公告,2:健康推送,3:在线咨询 4:消息通知
|
||||
*/
|
||||
@ApiModelProperty(value = "消息类别 1:通知公告,2:健康推送,3:在线咨询 4:消息通知")
|
||||
private String messageCategory;
|
||||
|
||||
/**
|
||||
* 业务类型(1: 默认 9:申请 10:用药提醒通知)
|
||||
*/
|
||||
@ApiModelProperty(value = "务类型(1: 家医默认通知 10:申请通知 9:用药提醒通知)")
|
||||
private String busType;
|
||||
|
||||
/**
|
||||
* 身份证号
|
||||
*/
|
||||
@ApiModelProperty(value = "cardNo")
|
||||
private String cardNo;
|
||||
|
||||
/**
|
||||
* openid
|
||||
*/
|
||||
@ApiModelProperty(value = "openid")
|
||||
private String openid;
|
||||
|
||||
/**
|
||||
* 发送人
|
||||
*/
|
||||
@ApiModelProperty(value = "发送人")
|
||||
private String senderName;
|
||||
|
||||
/**
|
||||
* 发送标题
|
||||
*/
|
||||
@ApiModelProperty(value = "发送标题")
|
||||
private String sendTitle;
|
||||
|
||||
/**
|
||||
* 发送内容
|
||||
*/
|
||||
@ApiModelProperty(value = "发送内容")
|
||||
private String sendContent;
|
||||
|
||||
/**
|
||||
* 发送时间(yyyy-MM-dd HH:mm:ss)
|
||||
*/
|
||||
@ApiModelProperty(value = "发送时间(yyyy-MM-dd HH:mm:ss)")
|
||||
private String sendTime;
|
||||
|
||||
/**
|
||||
* 接收人
|
||||
*/
|
||||
@ApiModelProperty(value = "接收人")
|
||||
private String receiveName;
|
||||
|
||||
/**
|
||||
* 发送内容1
|
||||
*/
|
||||
@ApiModelProperty(value = "发送内容1")
|
||||
private String text1;
|
||||
|
||||
/**
|
||||
* 发送内容2
|
||||
*/
|
||||
@ApiModelProperty(value = "发送内容2")
|
||||
private String text2;
|
||||
|
||||
/**
|
||||
* 发送内容3
|
||||
*/
|
||||
@ApiModelProperty(value = "发送内容3")
|
||||
private String text3;
|
||||
|
||||
}
|
||||
@ -250,4 +250,21 @@ public class PatientInfoBody extends BaseEntity {
|
||||
@ApiModelProperty(value = "当前是否选中(0: 否 1:是)", hidden = true)
|
||||
private String isChecked;
|
||||
|
||||
/**
|
||||
* 与户主关系 (1.户主本人;2.配偶;3.子女;4.(外)孙子女;5.父母;6.(外)祖父母;7.兄弟姐妹;8.儿媳;9.女婿;10.孙子女;11.侄子女;12.曾孙子女;13.祖父母;99.其他;与户主关系 1.户主本人;2.配偶;3.子女;4.(外)孙子女;5.父母;6.(外)祖父母;7.兄弟姐妹;8.儿媳;9.女婿;10.孙子女;11.侄子女;12.曾孙子女;13.祖父母;99.其他;)
|
||||
*/
|
||||
@ApiModelProperty(value = "与户主关系 (1.户主本人;2.配偶;3.子女;4.(外)孙子女;5.父母;6.(外)祖父母;7.兄弟姐妹;8.儿媳;9.女婿;10.孙子女;11.侄子女;12.曾孙子女;13.祖父母;99.其他;与户主关系 1.户主本人;2.配偶;3.子女;4.(外)孙子女;5.父母;6.(外)祖父母;7.兄弟姐妹;8.儿媳;9.女婿;10.孙子女;11.侄子女;12.曾孙子女;13.祖父母;99.其他;)")
|
||||
private String householdRelationship;
|
||||
|
||||
/**
|
||||
* 户主身份证号
|
||||
*/
|
||||
@ApiModelProperty(value = "户主身份证号")
|
||||
private String householdCardNo;
|
||||
|
||||
/**
|
||||
* 签约编号
|
||||
*/
|
||||
@ApiModelProperty(value = "签约编号")
|
||||
private String signNo;
|
||||
}
|
||||
|
||||
@ -0,0 +1,115 @@
|
||||
package com.xinelu.familydoctor.applet.pojo.body;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @Author mengkuiliang
|
||||
* @Description 同步科室人员信息请求对象
|
||||
* @Date 2023-10-20 020 14:18
|
||||
* @Param
|
||||
* @return
|
||||
**/
|
||||
@Data
|
||||
@ApiModel(value = "同步科室人员信息请求对象")
|
||||
public class SyncHospitalPersonInfoBody {
|
||||
|
||||
/**
|
||||
* 所属医院id
|
||||
*/
|
||||
@ApiModelProperty(value = "所属医院id")
|
||||
private Long hospitalId;
|
||||
|
||||
/**
|
||||
* 所属部门id
|
||||
*/
|
||||
@ApiModelProperty(value = "所属部门id")
|
||||
private Long departmentId;
|
||||
|
||||
/**
|
||||
* 科室人员编码
|
||||
*/
|
||||
@ApiModelProperty(value = "科室人员编码")
|
||||
private String personCode;
|
||||
|
||||
/**
|
||||
* 科室人员名称
|
||||
*/
|
||||
@ApiModelProperty(value = "科室人员名称")
|
||||
private String personName;
|
||||
|
||||
/**
|
||||
* 科室人员联系电话
|
||||
*/
|
||||
@ApiModelProperty(value = "科室人员联系电话")
|
||||
private String personPhone;
|
||||
|
||||
/**
|
||||
* 科室人员地址
|
||||
*/
|
||||
@ApiModelProperty(value = "科室人员地址")
|
||||
private String personAddress;
|
||||
|
||||
/**
|
||||
* 身份证号
|
||||
*/
|
||||
@ApiModelProperty(value = "身份证号")
|
||||
private String cardNo;
|
||||
|
||||
/**
|
||||
* 人员职称,主任医师:CHIEF_PHYSICIAN,副主任医师:DEPUTY_CHIEF_PHYSICIAN,主治医师:ATTENDING_DOCTOR,医师:PHYSICIAN,医士:HEALER,住院医师:RESIDENT_PHYSICIAN
|
||||
*/
|
||||
@ApiModelProperty(value = "人员职称,主任医师:CHIEF_PHYSICIAN,副主任医师:DEPUTY_CHIEF_PHYSICIAN,主治医师:ATTENDING_DOCTOR,医师:PHYSICIAN,医士:HEALER,住院医师:RESIDENT_PHYSICIAN")
|
||||
private String academicTitle;
|
||||
|
||||
/**
|
||||
* 咨询费用
|
||||
*/
|
||||
@ApiModelProperty(value = "咨询费用")
|
||||
private BigDecimal consultingFee;
|
||||
|
||||
/**
|
||||
* 个人简介
|
||||
*/
|
||||
@ApiModelProperty(value = "个人简介")
|
||||
private String personIntroduce;
|
||||
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
@ApiModelProperty(value = "显示顺序")
|
||||
private Integer personSort;
|
||||
|
||||
/**
|
||||
* 科室人员头像地址
|
||||
*/
|
||||
@ApiModelProperty(value = "科室人员头像地址")
|
||||
private String personPictureUrl;
|
||||
|
||||
/**
|
||||
* 科室人员账号
|
||||
*/
|
||||
@ApiModelProperty(value = "科室人员账号")
|
||||
private String personAccount;
|
||||
|
||||
/**
|
||||
* 科室人员密码
|
||||
*/
|
||||
@ApiModelProperty(value = "科室人员密码")
|
||||
private String personPassword;
|
||||
|
||||
/**
|
||||
*1:家医医生 2:泉医医生 3:专病医生
|
||||
*/
|
||||
@ApiModelProperty(value = "1:家医医生 2:泉医医生 3:专病医生")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
*1:家医机构编号
|
||||
*/
|
||||
@ApiModelProperty(value = "家医机构编号")
|
||||
private String orgCode;
|
||||
}
|
||||
@ -0,0 +1,66 @@
|
||||
package com.xinelu.familydoctor.applet.pojo.dto;
|
||||
|
||||
import com.xinelu.applet.dto.chatrecord.ChatRecordDTO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author mengkuiliang
|
||||
* @Description 发家医送订阅消息传输对象
|
||||
* @Date 2023-10-19 019 10:14
|
||||
* @Param
|
||||
* @return
|
||||
**/
|
||||
@ApiModel("发家医送订阅消息传输对象")
|
||||
@Data
|
||||
public class FDMessageDto extends FDMessageExtentDto {
|
||||
|
||||
@ApiModelProperty("消息类别 1:通知公告,2:健康推送,3:在线咨询 4:消息通知")
|
||||
private String messageCategory;
|
||||
|
||||
@ApiModelProperty("通知适用人群(0:全部人群)")
|
||||
private String crowds;
|
||||
|
||||
@ApiModelProperty(value = "发送人编号", required = true)
|
||||
private String senderNo;
|
||||
|
||||
@ApiModelProperty("发送人身份证号")
|
||||
private String senderIdentity;
|
||||
|
||||
@ApiModelProperty("发送人姓名")
|
||||
private String senderName;
|
||||
|
||||
@ApiModelProperty(value = "发送时间(yyyy-MM-dd HH:mm:ss)", hidden = true)
|
||||
private String sendTime;
|
||||
|
||||
@ApiModelProperty(value = "接收人编号")
|
||||
private String recipientNo;
|
||||
|
||||
@ApiModelProperty("接收人身份证号")
|
||||
private String recipientIdentity;
|
||||
|
||||
@ApiModelProperty("接收人姓名")
|
||||
private String recipientName;
|
||||
|
||||
@ApiModelProperty("消息类型,1:健康推送,2:日常提醒, 3:风险评估完成, 4:推送筛查项目,5:预约筛查成功, 6:筛查完成,7:康复处方,8:随访提醒,9:纳入管理,10:申请转诊,11:转诊申请通过,12:申请会诊,13:会诊申请通过,14:处理异常")
|
||||
private String messageType;
|
||||
|
||||
@ApiModelProperty("标题")
|
||||
private String title;
|
||||
|
||||
@ApiModelProperty("消息内容")
|
||||
private String content;
|
||||
|
||||
@ApiModelProperty("消息内容Id用于点击跳转")
|
||||
private String contentId;
|
||||
|
||||
@ApiModelProperty("消息来源")
|
||||
private String source;
|
||||
|
||||
@ApiModelProperty(value = "模版类型(MessageTemplateType枚举)", required = true)
|
||||
private String templateType;
|
||||
|
||||
@ApiModelProperty("消息记录对象")
|
||||
ChatRecordDTO chatRecord;
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
package com.xinelu.familydoctor.applet.pojo.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author mengkuiliang
|
||||
* @Description 家医订阅消息请求参数扩展类
|
||||
* @Date 2023-10-19 019 10:15
|
||||
* @Param
|
||||
* @return
|
||||
**/
|
||||
@Data
|
||||
public class FDMessageExtentDto {
|
||||
|
||||
@ApiModelProperty("居民姓名")
|
||||
private String residentName;
|
||||
|
||||
@ApiModelProperty("医院名称")
|
||||
private String hospitalName;
|
||||
|
||||
@ApiModelProperty("医生名称")
|
||||
private String doctorName;
|
||||
|
||||
@ApiModelProperty("团队名称")
|
||||
private String teamName;
|
||||
|
||||
@ApiModelProperty("申请内容(比如:申请签约、申请随访、申请转诊等)")
|
||||
private String applyContent;
|
||||
|
||||
@ApiModelProperty("申请结果(比如:成功、失败、处理中等)")
|
||||
private String applyResult;
|
||||
|
||||
@ApiModelProperty("处理时间")
|
||||
private String handleDate;
|
||||
|
||||
@ApiModelProperty("药品名称")
|
||||
private String drugName;
|
||||
|
||||
@ApiModelProperty("药品用法")
|
||||
private String drugUsage;
|
||||
|
||||
}
|
||||
@ -288,6 +288,23 @@ public class PatientInfo extends BaseEntity {
|
||||
@Excel(name = "当前是否选中(0: 否 1:是)")
|
||||
private String isChecked;
|
||||
|
||||
/**
|
||||
* 与户主关系 (1.户主本人;2.配偶;3.子女;4.(外)孙子女;5.父母;6.(外)祖父母;7.兄弟姐妹;8.儿媳;9.女婿;10.孙子女;11.侄子女;12.曾孙子女;13.祖父母;99.其他;与户主关系 1.户主本人;2.配偶;3.子女;4.(外)孙子女;5.父母;6.(外)祖父母;7.兄弟姐妹;8.儿媳;9.女婿;10.孙子女;11.侄子女;12.曾孙子女;13.祖父母;99.其他;)
|
||||
*/
|
||||
@ApiModelProperty(value = "与户主关系 (1.户主本人;2.配偶;3.子女;4.(外)孙子女;5.父母;6.(外)祖父母;7.兄弟姐妹;8.儿媳;9.女婿;10.孙子女;11.侄子女;12.曾孙子女;13.祖父母;99.其他;与户主关系 1.户主本人;2.配偶;3.子女;4.(外)孙子女;5.父母;6.(外)祖父母;7.兄弟姐妹;8.儿媳;9.女婿;10.孙子女;11.侄子女;12.曾孙子女;13.祖父母;99.其他;)")
|
||||
private String householdRelationship;
|
||||
|
||||
/**
|
||||
* 户主身份证号
|
||||
*/
|
||||
@ApiModelProperty(value = "户主身份证号")
|
||||
private String householdCardNo;
|
||||
|
||||
/**
|
||||
* 签约编号
|
||||
*/
|
||||
@ApiModelProperty(value = "签约编号")
|
||||
private String signNo;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
@ -331,6 +348,8 @@ public class PatientInfo extends BaseEntity {
|
||||
.append("cityCode", getCityCode())
|
||||
.append("bindingTime", getBindingTime())
|
||||
.append("isChecked", getIsChecked())
|
||||
.append("householdRelationship", getHouseholdRelationship())
|
||||
.append("householdCardNo", getHouseholdCardNo())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,36 @@
|
||||
package com.xinelu.familydoctor.applet.pojo.query;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author mengkuiliang
|
||||
* @Description 德州市居民码查询对象
|
||||
* @Date 2023-06-09 9:45
|
||||
* @Param
|
||||
* @return
|
||||
**/
|
||||
@Data
|
||||
@ApiModel("德州市居民码查询对象")
|
||||
public class DzsCodeQuery {
|
||||
|
||||
@ApiModelProperty(value = "接口名称(判断是否已注册居民码:isReg; 居民码用户注册:register; 根据UID获取居民码:getCodeByUid; 解析居民码二维码:parsingCode; 根据证件获取居民码:getCodeByCard; 获取用户信息:getUserInfo;)", required = true)
|
||||
String interfaceName;
|
||||
|
||||
@ApiModelProperty("省居民码授权码")
|
||||
String jmmCode;
|
||||
|
||||
@ApiModelProperty("用户标识")
|
||||
String uid;
|
||||
|
||||
@ApiModelProperty("证件类型(01:居民身份证; 03: 外国护照; 06: 港澳居民来往内地通行证; 07: 台湾居民来往内地通行证;)")
|
||||
String cardType;
|
||||
|
||||
@ApiModelProperty("证件号")
|
||||
String cardNo;
|
||||
|
||||
@ApiModelProperty("二维码")
|
||||
String qrCode;
|
||||
|
||||
}
|
||||
@ -71,4 +71,9 @@ public class PatientInfoQuery extends BaseEntity {
|
||||
@ApiModelProperty(value = "当前是否选中(0: 否 1:是)")
|
||||
private String isChecked;
|
||||
|
||||
/**
|
||||
* 户主身份证号
|
||||
*/
|
||||
@ApiModelProperty(value = "户主身份证号")
|
||||
private String householdCardNo;
|
||||
}
|
||||
|
||||
@ -0,0 +1,74 @@
|
||||
package com.xinelu.familydoctor.applet.pojo.query;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author mengkuiliang
|
||||
* @Description 服务记录查询类
|
||||
* @Date 2023-10-17 017 14:50
|
||||
* @Param
|
||||
* @return
|
||||
**/
|
||||
@Data
|
||||
@ApiModel("服务记录查询类")
|
||||
public class ServiceRecordQuery {
|
||||
|
||||
/**
|
||||
* 身份证号
|
||||
*/
|
||||
@ApiModelProperty(value = "身份证号", hidden = true)
|
||||
private String identity;
|
||||
|
||||
/**
|
||||
* 服务包编号
|
||||
*/
|
||||
@ApiModelProperty(value = "服务包编号")
|
||||
private String packageNo;
|
||||
|
||||
/**
|
||||
* 服务包名称
|
||||
*/
|
||||
@ApiModelProperty(value = "服务包名称")
|
||||
private String packageName;
|
||||
|
||||
/**
|
||||
* 服务项编号
|
||||
*/
|
||||
@ApiModelProperty(value = "服务项编号")
|
||||
private String formNo;
|
||||
|
||||
/**
|
||||
* 服务项名称
|
||||
*/
|
||||
@ApiModelProperty(value = "服务项名称")
|
||||
private String formName;
|
||||
|
||||
/**
|
||||
* 开始日期(yyyy-MM-dd)
|
||||
*/
|
||||
@ApiModelProperty(value = "开始日期(yyyy-MM-dd)")
|
||||
private Date startDate;
|
||||
|
||||
/**
|
||||
* 结束日期(yyyy-MM-dd)
|
||||
*/
|
||||
@ApiModelProperty(value = "结束日期(yyyy-MM-dd)")
|
||||
private Date endDate;
|
||||
|
||||
/**
|
||||
* 页码
|
||||
*/
|
||||
@ApiModelProperty("页码")
|
||||
private Integer pageNum;
|
||||
|
||||
/**
|
||||
* 页面大小
|
||||
*/
|
||||
@ApiModelProperty("页面大小")
|
||||
private Integer pageSize;
|
||||
|
||||
}
|
||||
@ -149,10 +149,10 @@ public class DoctorDetailVo {
|
||||
private String phOrgId;
|
||||
|
||||
/**
|
||||
* 公卫机构编号
|
||||
* 家医机构编号
|
||||
*/
|
||||
@ApiModelProperty("公卫机构编号")
|
||||
private String phOrgCode;
|
||||
@ApiModelProperty("家医机构编号")
|
||||
private String orgCode;
|
||||
|
||||
/**
|
||||
* 个人简介
|
||||
|
||||
@ -0,0 +1,56 @@
|
||||
package com.xinelu.familydoctor.applet.pojo.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author mengkuiliang
|
||||
* @Description 履约记录-小程序评价列表展示类
|
||||
* @Date 2023-10-18 16:43
|
||||
* @Param
|
||||
* @return
|
||||
**/
|
||||
@ApiModel("履约记录-小程序评价列表展示类")
|
||||
@Data
|
||||
public class OrderEvaluateVo {
|
||||
|
||||
/**
|
||||
* 居民身份证号
|
||||
*/
|
||||
@ApiModelProperty(value = "居民身份证号")
|
||||
private String cardNo;
|
||||
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
@ApiModelProperty(value = "订单编号")
|
||||
private String orderNo;
|
||||
|
||||
/**
|
||||
* 订单状态
|
||||
*/
|
||||
@ApiModelProperty(value = "订单状态")
|
||||
private String orderStatus;
|
||||
|
||||
/**
|
||||
* 订单名称
|
||||
*/
|
||||
@ApiModelProperty(value = "订单名称")
|
||||
private String orderName;
|
||||
|
||||
/**
|
||||
* 订单类型
|
||||
*/
|
||||
@ApiModelProperty(value = "订单类型")
|
||||
private String orderType;
|
||||
|
||||
/**
|
||||
* 下单时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@ApiModelProperty(value = "下单时间")
|
||||
private String createTime;
|
||||
|
||||
}
|
||||
@ -59,10 +59,10 @@ public class OrgDetailVo {
|
||||
private String phOrgId;
|
||||
|
||||
/**
|
||||
* 公卫机构编码
|
||||
* 家医机构编码
|
||||
*/
|
||||
@ApiModelProperty("公卫机构编码")
|
||||
private String phOrgCode;
|
||||
@ApiModelProperty("家医机构编码")
|
||||
private String orgCode;
|
||||
|
||||
/**
|
||||
* 机构类型(0:卫健委,1:卫健局,2:医院,3:乡镇卫生院,4:街道卫生服务中心,5:社区服务站,6:村卫生室)
|
||||
|
||||
@ -156,15 +156,38 @@ public class ResidentServiceApplyVo {
|
||||
private String signNo;
|
||||
|
||||
/**
|
||||
* 评价编号
|
||||
* 预约机构编号
|
||||
*/
|
||||
@ApiModelProperty("评价编号")
|
||||
private String evaluateNo;
|
||||
@ApiModelProperty(value = "预约机构编号", required = true)
|
||||
private String orgNo;
|
||||
|
||||
/**
|
||||
* 服务评价对象
|
||||
* 预约机构名称
|
||||
*/
|
||||
@ApiModelProperty("服务评价对象")
|
||||
OrderEvaluateInfoVo orderEvaluateInfo;
|
||||
@ApiModelProperty(value = "预约机构名称", required = true)
|
||||
private String orgName;
|
||||
|
||||
/**
|
||||
* 预约团队编号
|
||||
*/
|
||||
@ApiModelProperty(value = "预约团队编号", required = true)
|
||||
private String teamNo;
|
||||
|
||||
/**
|
||||
* 预约团队名称
|
||||
*/
|
||||
@ApiModelProperty(value = "预约团队名称", required = true)
|
||||
private String teamName;
|
||||
|
||||
/**
|
||||
* 预约医生编号
|
||||
*/
|
||||
@ApiModelProperty(value = "预约医生编号", required = true)
|
||||
private String userNo;
|
||||
|
||||
/**
|
||||
* 预约医生姓名
|
||||
*/
|
||||
@ApiModelProperty(value = "预约医生姓名", required = true)
|
||||
private String userName;
|
||||
}
|
||||
|
||||
@ -0,0 +1,194 @@
|
||||
package com.xinelu.familydoctor.applet.pojo.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.xinelu.manage.domain.orderevaluateinfo.OrderEvaluateInfo;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author mengkuiliang
|
||||
* @Description 服务记录展示类
|
||||
* @Date 2023-10-17 017 11:32
|
||||
* @Param
|
||||
* @return
|
||||
**/
|
||||
@ApiModel("服务记录展示类")
|
||||
@Data
|
||||
public class ResidentServiceRecordVo {
|
||||
|
||||
/**
|
||||
* 履约业务主键
|
||||
*/
|
||||
@ApiModelProperty(value = "履约业务主键")
|
||||
private String performanceNo;
|
||||
|
||||
/**
|
||||
* 签约编号
|
||||
*/
|
||||
@ApiModelProperty(value = "签约编号")
|
||||
private String signNo;
|
||||
|
||||
/**
|
||||
* 居民编号
|
||||
*/
|
||||
@ApiModelProperty(value = "居民编号")
|
||||
private String residentNo;
|
||||
|
||||
/**
|
||||
* 居民身份证号
|
||||
*/
|
||||
@ApiModelProperty(value = "居民身份证号")
|
||||
private String identity;
|
||||
|
||||
/**
|
||||
* 居民姓名
|
||||
*/
|
||||
@ApiModelProperty(value = "居民姓名")
|
||||
private String residentName;
|
||||
|
||||
|
||||
/**
|
||||
* 履约明细业务主键
|
||||
*/
|
||||
@ApiModelProperty(value = "履约明细业务主键")
|
||||
private String performanceDetailNo;
|
||||
|
||||
/**
|
||||
* 服务包明细业务主键
|
||||
*/
|
||||
@ApiModelProperty(value = "服务包明细业务主键")
|
||||
private String packageDetailNo;
|
||||
|
||||
/**
|
||||
* 服务包编号
|
||||
*/
|
||||
@ApiModelProperty(value = "服务包编号", required = true)
|
||||
private String packageNo;
|
||||
|
||||
/**
|
||||
* 服务包名称
|
||||
*/
|
||||
@ApiModelProperty(value = "服务包名称", required = true)
|
||||
private String packageName;
|
||||
|
||||
/**
|
||||
* 服务项表单编号
|
||||
*/
|
||||
@ApiModelProperty(value = "服务项表单编号")
|
||||
private String formNo;
|
||||
|
||||
/**
|
||||
* 服务项表单名称
|
||||
*/
|
||||
@ApiModelProperty(value = "服务项表单名称")
|
||||
private String formName;
|
||||
|
||||
/**
|
||||
* 履约时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@ApiModelProperty(value = "履约时间")
|
||||
private Date performanceTime;
|
||||
|
||||
/**
|
||||
* 随访时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@ApiModelProperty(value = "随访时间")
|
||||
private Date followupTime;
|
||||
|
||||
/**
|
||||
* 下次履约时间
|
||||
*/
|
||||
@ApiModelProperty(value = "下次履约时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date performanceNextTime;
|
||||
|
||||
/**
|
||||
* 机构业务编号
|
||||
*/
|
||||
@ApiModelProperty(value = "机构业务编号")
|
||||
private String orgNo;
|
||||
|
||||
/**
|
||||
* 机构名称
|
||||
*/
|
||||
@ApiModelProperty(value = "机构名称", required = true)
|
||||
private String orgName;
|
||||
|
||||
/**
|
||||
* 团队业务编号
|
||||
*/
|
||||
@ApiModelProperty(value = "团队业务编号", required = true)
|
||||
private String teamNo;
|
||||
|
||||
/**
|
||||
* 团队名称
|
||||
*/
|
||||
@ApiModelProperty(value = "团队名称", required = true)
|
||||
private String teamName;
|
||||
|
||||
/**
|
||||
* 履约医生
|
||||
*/
|
||||
@ApiModelProperty(value = "履约医生")
|
||||
private String userNo;
|
||||
|
||||
/**
|
||||
* 履约医生名称
|
||||
*/
|
||||
@ApiModelProperty(value = "履约医生名称")
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 下次随访日期
|
||||
*/
|
||||
@ApiModelProperty(value = "下次随访日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private Date followupNextTime;
|
||||
|
||||
/**
|
||||
* 履约方式(1:家庭,2:门诊,3:电话,99:其他)
|
||||
*/
|
||||
@ApiModelProperty(value = "履约方式(1:家庭,2:门诊,3:电话,99:其他)")
|
||||
private String performanceWay;
|
||||
|
||||
/**
|
||||
* 履约方式名称(1:家庭,2:门诊,3:电话,99:其他)
|
||||
*/
|
||||
@ApiModelProperty(value = "履约方式(1:家庭,2:门诊,3:电话,99:其他)")
|
||||
private String performanceWayName;
|
||||
|
||||
/**
|
||||
* 生成方式(1:手动添加 2:随访自动同步)
|
||||
*/
|
||||
@ApiModelProperty(value = "生成方式(1:手动添加 2:随访自动同步)")
|
||||
private String generateWay;
|
||||
|
||||
/**
|
||||
* 生成方式名称(1:手动添加 2:随访自动同步)
|
||||
*/
|
||||
@ApiModelProperty(value = "生成方式(1:手动添加 2:随访自动同步)")
|
||||
private String generateWayName;
|
||||
|
||||
/**
|
||||
* 应服务次数
|
||||
*/
|
||||
@ApiModelProperty(value = "应服务次数")
|
||||
private Integer serviceFreq;
|
||||
|
||||
/**
|
||||
* 已履约次数
|
||||
*/
|
||||
@ApiModelProperty(value = "已履约次数")
|
||||
private Integer performanceCount;
|
||||
|
||||
/**
|
||||
* 服务评价对象
|
||||
*/
|
||||
@ApiModelProperty("服务评价对象")
|
||||
OrderEvaluateInfo orderEvaluateInfo;
|
||||
}
|
||||
@ -3,6 +3,7 @@ package com.xinelu.familydoctor.applet.service;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.xinelu.familydoctor.applet.pojo.body.ApprovalBody;
|
||||
import com.xinelu.familydoctor.applet.pojo.body.ResidentSignApplyBody;
|
||||
import com.xinelu.familydoctor.applet.pojo.body.SyncHospitalPersonInfoBody;
|
||||
import com.xinelu.familydoctor.applet.pojo.query.ApplyQuery;
|
||||
import com.xinelu.familydoctor.applet.pojo.vo.ResidentSignApplyVo;
|
||||
|
||||
|
||||
@ -8,16 +8,19 @@ import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.xinelu.applet.dto.appletlogin.AppletUserInfoDTO;
|
||||
import com.xinelu.common.config.AppletChatConfig;
|
||||
import com.xinelu.common.core.domain.R;
|
||||
import com.xinelu.common.entity.AppletPhoneVO;
|
||||
import com.xinelu.common.exception.ServiceException;
|
||||
import com.xinelu.common.utils.bean.BeanUtils;
|
||||
import com.xinelu.common.utils.http.HttpService;
|
||||
import com.xinelu.common.utils.http.HttpUtils;
|
||||
import com.xinelu.common.utils.http.SslUtils;
|
||||
import com.xinelu.common.utils.spring.SpringUtils;
|
||||
import com.xinelu.common.utils.uuid.IdUtils;
|
||||
import com.xinelu.familydoctor.applet.mapper.ResidentPatientInfoMapper;
|
||||
import com.xinelu.familydoctor.applet.pojo.body.PatientInfoBody;
|
||||
import com.xinelu.familydoctor.applet.pojo.entity.PatientInfo;
|
||||
import com.xinelu.familydoctor.applet.pojo.vo.SignInfoDetailVo;
|
||||
import com.xinelu.familydoctor.applet.service.IResidentPatientInfoService;
|
||||
import com.xinelu.familydoctor.applet.utils.AppletAccessTokenUtils;
|
||||
import com.xinelu.manage.domain.receiveAddressInfo.ReceiveAddressInfo;
|
||||
@ -114,27 +117,27 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi
|
||||
**/
|
||||
@Override
|
||||
public AppletPhoneVO getPhone(String code) throws Exception {
|
||||
JSONObject result;
|
||||
// 获取token
|
||||
String token_url = String.format("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=%s&secret=%s", appletChatConfig.getAppletId(), appletChatConfig.getSecret());
|
||||
SslUtils.ignoreSsl();
|
||||
String tokenResult = HttpUtils.sendGet(token_url);
|
||||
if (tokenResult == null) {
|
||||
return null;
|
||||
}
|
||||
result = JSON.parseObject(tokenResult);
|
||||
log.info("获取小程序token : {}", result.toJSONString());
|
||||
String accessToken = result.getString("access_token");
|
||||
if (StringUtils.isEmpty(accessToken)) {
|
||||
return null;
|
||||
}
|
||||
//获取手机号 https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/user-info/phone-number/getPhoneNumber.html
|
||||
String url = "https://api.weixin.qq.com/wxa/business/getuserphonenumber" + "?access_token=" + accessToken;
|
||||
JSONObject params = new JSONObject();
|
||||
params.put("code", code);
|
||||
SslUtils.ignoreSsl();
|
||||
result = httpService.post(url, null, params);
|
||||
return JSON.parseObject(result.toString(), AppletPhoneVO.class);
|
||||
JSONObject result;
|
||||
// 获取token
|
||||
String token_url = String.format("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=%s&secret=%s", appletChatConfig.getAppletId(), appletChatConfig.getSecret());
|
||||
SslUtils.ignoreSsl();
|
||||
String tokenResult = HttpUtils.sendGet(token_url);
|
||||
if (tokenResult == null) {
|
||||
return null;
|
||||
}
|
||||
result = JSON.parseObject(tokenResult);
|
||||
log.info("获取小程序token : {}", result.toJSONString());
|
||||
String accessToken = result.getString("access_token");
|
||||
if (StringUtils.isEmpty(accessToken)) {
|
||||
return null;
|
||||
}
|
||||
//获取手机号 https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/user-info/phone-number/getPhoneNumber.html
|
||||
String url = "https://api.weixin.qq.com/wxa/business/getuserphonenumber" + "?access_token=" + accessToken;
|
||||
JSONObject params = new JSONObject();
|
||||
params.put("code", code);
|
||||
SslUtils.ignoreSsl();
|
||||
result = httpService.post(url, null, params);
|
||||
return JSON.parseObject(result.toString(), AppletPhoneVO.class);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -161,12 +164,16 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi
|
||||
if (ObjectUtils.isNotEmpty(body.getCardNo())) {
|
||||
PatientInfo patientInfo;
|
||||
// 修改
|
||||
if (!StringUtils.isBlank(body.getPatientCode())) {
|
||||
PatientInfo patientInfo = residentPatientInfoMapper.getPatientInfoByPatientCode(body.getPatientCode());
|
||||
if(!StringUtils.isBlank(body.getPatientCode())) {
|
||||
patientInfo = residentPatientInfoMapper.getPatientInfoByPatientCode(body.getPatientCode());
|
||||
if (ObjectUtils.isNotEmpty(patientInfo)) {
|
||||
BeanUtils.copyBeanProp(patientInfo, body);
|
||||
if (body.getDiseaseList() != null) {
|
||||
patientInfo.setDisease(body.getDiseaseList().stream().collect(Collectors.joining(",")));
|
||||
} else {
|
||||
patientInfo.setDisease("0");
|
||||
}
|
||||
patientInfo.setLoginFlag(Long.valueOf(1));
|
||||
updatePatientInfo(patientInfo);
|
||||
@ -174,13 +181,17 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi
|
||||
// 注册
|
||||
} else {
|
||||
// 获取当前微信绑定的居民
|
||||
List<PatientInfo> list = residentPatientInfoMapper.getList(body.getOpenid(), null);
|
||||
PatientInfo patientInfo = residentPatientInfoMapper.isRegisterByCardNo(body.getCardNo());
|
||||
List<PatientInfo> list = residentPatientInfoMapper.getList(body.getOpenid(), body.getCityCode());
|
||||
patientInfo = residentPatientInfoMapper.isRegisterByCardNo(body.getCardNo());
|
||||
if (patientInfo == null) {
|
||||
PatientInfo entity = new PatientInfo();
|
||||
BeanUtils.copyBeanProp(entity, body);
|
||||
if(body.getDiseaseList() != null) {
|
||||
if (body.getDiseaseList() != null) {
|
||||
entity.setDisease(body.getDiseaseList().stream().collect(Collectors.joining(",")));
|
||||
} else {
|
||||
entity.setDisease("0");
|
||||
}
|
||||
entity.setPatientCode(IdUtils.fastSimpleUUID());
|
||||
entity.setBindingTime(new Date());
|
||||
@ -208,8 +219,10 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi
|
||||
patientInfo.setHeadPictureUrl(body.getHeadPictureUrl());
|
||||
patientInfo.setDelFlag(0);
|
||||
patientInfo.setLoginFlag(Long.valueOf(1));
|
||||
if(body.getDiseaseList() != null) {
|
||||
if (body.getDiseaseList() != null) {
|
||||
patientInfo.setDisease(body.getDiseaseList().stream().collect(Collectors.joining(",")));
|
||||
} else {
|
||||
patientInfo.setDisease("0");
|
||||
}
|
||||
residentPatientInfoMapper.updatePatientInfo(patientInfo);
|
||||
}
|
||||
@ -245,6 +258,28 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi
|
||||
}
|
||||
}
|
||||
|
||||
// 获取签约信息
|
||||
private String getSignInfo(String region, String identity) {
|
||||
if (!StringUtils.isBlank(region)) {
|
||||
try {
|
||||
// 查询签约信息
|
||||
String result = (String) httpService.get(SpringUtils.getFdUrl(region) + "/resident/signinfo/detail/" + identity, null, String.class);
|
||||
JSONObject jsonObject = JSONObject.parseObject(result);
|
||||
if ("1".equals(jsonObject.get("code"))) {
|
||||
if (jsonObject.getJSONObject("data") != null) {
|
||||
SignInfoDetailVo signInfo = JSONObject.parseObject(jsonObject.getJSONObject("data").toJSONString(), SignInfoDetailVo.class);
|
||||
if (signInfo != null) {
|
||||
return signInfo.getSignNo();
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("注册完善信息-更新签约标识出错:{}", e.getMessage());
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
* @Author mengkuiliang
|
||||
@ -285,6 +320,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) {
|
||||
@ -301,6 +337,8 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi
|
||||
return residentPatientInfoMapper.selectPatientInfoByCode(patientCode);
|
||||
}
|
||||
|
||||
/** 判断2个参数是否一样 */
|
||||
|
||||
/**
|
||||
* @return java.lang.String
|
||||
* @Author mengkuiliang
|
||||
@ -310,29 +348,31 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi
|
||||
**/
|
||||
@Override
|
||||
public PatientInfo getCurrentResident(String openid, String cityCode) {
|
||||
List<PatientInfo> list = residentPatientInfoMapper.getList(openid, cityCode);
|
||||
List<PatientInfo> list = residentPatientInfoMapper.getList(openid, null);
|
||||
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())) {
|
||||
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");
|
||||
|
||||
if(!StringUtils.isBlank(list.get(0).getDisease())) {
|
||||
if (!StringUtils.isBlank(list.get(0).getDisease())) {
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -360,7 +400,7 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi
|
||||
}*/
|
||||
|
||||
@Override
|
||||
public HashMap<String, String> login(String loginCode,String phoneCode) throws Exception {
|
||||
public HashMap<String, String> login(String loginCode, String phoneCode) throws Exception {
|
||||
HashMap<String, String> HashMap = new HashMap<>();
|
||||
try {
|
||||
SslUtils.ignoreSsl();
|
||||
@ -374,7 +414,7 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi
|
||||
throw new ServiceException(json.getString("errmsg"));
|
||||
}
|
||||
String openid = json.getString("openid");
|
||||
HashMap.put("openid",openid);
|
||||
HashMap.put("openid", openid);
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException(e.getMessage());
|
||||
}
|
||||
@ -383,17 +423,17 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi
|
||||
String cityCode = "";
|
||||
AppletPhoneVO phone = getPhone(phoneCode);
|
||||
String phoneNumber = phone.getPhoneInfo().getPhoneNumber();
|
||||
HashMap.put("phone",phoneNumber);
|
||||
HashMap.put("phone", phoneNumber);
|
||||
List<PatientInfo> infoList = residentPatientInfoMapper.selectPatientInfoByPhone(phoneNumber);
|
||||
code = infoList.size()== 0 ? "0" : "1";
|
||||
code = infoList.size() == 0 ? "0" : "1";
|
||||
//返回绑定城市
|
||||
if ("1".equals(code)){
|
||||
if ("1".equals(code)) {
|
||||
for (PatientInfo patientInfo : infoList) {
|
||||
cityCode = patientInfo.getCityCode();
|
||||
}
|
||||
}
|
||||
HashMap.put("code",code);
|
||||
HashMap.put("cityCode",cityCode);
|
||||
HashMap.put("code", code);
|
||||
HashMap.put("cityCode", cityCode);
|
||||
return HashMap;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,11 +1,14 @@
|
||||
package com.xinelu.familydoctor.applet.service.impl;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.xinelu.applet.service.messagepush.MessagePushService;
|
||||
import com.xinelu.common.exception.ServiceException;
|
||||
import com.xinelu.common.utils.DateUtils;
|
||||
import com.xinelu.common.utils.StringUtils;
|
||||
import com.xinelu.common.utils.uuid.IdUtils;
|
||||
import com.xinelu.familydoctor.applet.mapper.ResidentRescindApplyMapper;
|
||||
import com.xinelu.familydoctor.applet.pojo.body.ApprovalBody;
|
||||
import com.xinelu.familydoctor.applet.pojo.body.MessagePushBody;
|
||||
import com.xinelu.familydoctor.applet.pojo.body.ResidentRescindApplyBody;
|
||||
import com.xinelu.familydoctor.applet.pojo.entity.PatientInfo;
|
||||
import com.xinelu.familydoctor.applet.pojo.entity.ResidentRescindApplyEntity;
|
||||
@ -34,6 +37,8 @@ public class ResidentRescindApplyServiceImpl implements IResidentRescindApplySer
|
||||
private ResidentRescindApplyMapper residentRescindApplyMapper;
|
||||
@Resource
|
||||
private IResidentPatientInfoService patientInfoService;
|
||||
@Resource
|
||||
private MessagePushService messagePushService;
|
||||
|
||||
@Override
|
||||
public List<ResidentRescindApplyVo> findList(ApplyQuery query) {
|
||||
@ -61,11 +66,11 @@ public class ResidentRescindApplyServiceImpl implements IResidentRescindApplySer
|
||||
ResidentRescindApplyEntity entity = new ResidentRescindApplyEntity();
|
||||
BeanUtils.copyProperties(body, entity);
|
||||
|
||||
PatientInfo patientInfo = patientInfoService.getByCardNo(body.getIdentity());
|
||||
if (patientInfo == null) {
|
||||
throw new ServiceException("未查询到注册信息");
|
||||
}
|
||||
if(StringUtils.isBlank(body.getPatientId())) {
|
||||
PatientInfo patientInfo = patientInfoService.getByCardNo(body.getIdentity());
|
||||
if (patientInfo == null) {
|
||||
throw new ServiceException("未查询到注册信息");
|
||||
}
|
||||
entity.setPatientId(patientInfo.getPatientCode());
|
||||
}
|
||||
|
||||
@ -74,6 +79,19 @@ public class ResidentRescindApplyServiceImpl implements IResidentRescindApplySer
|
||||
entity.setBookingStatus("0");
|
||||
entity.setApprovalStatus("0");
|
||||
residentRescindApplyMapper.insert(entity);
|
||||
|
||||
MessagePushBody messagePushBody = new MessagePushBody();
|
||||
messagePushBody.setMessageCategory("4");
|
||||
messagePushBody.setBusType("10");
|
||||
messagePushBody.setOpenid(patientInfo.getOpenid());
|
||||
messagePushBody.setReceiveName(patientInfo.getPatientName());
|
||||
messagePushBody.setText1(body.getOrgName());
|
||||
messagePushBody.setText2("解约申请");
|
||||
messagePushBody.setSendTitle("解约申请");
|
||||
messagePushBody.setSendTime(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", new Date()));
|
||||
messagePushBody.setSendContent(patientInfo.getPatientName() + "已提交申请");
|
||||
messagePushBody.setCardNo(body.getIdentity());
|
||||
messagePushService.fdApprovePush(JSONObject.parseObject(JSONObject.toJSONString(messagePushBody)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -2,6 +2,7 @@ package com.xinelu.familydoctor.applet.service.impl;
|
||||
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.xinelu.applet.service.messagepush.MessagePushService;
|
||||
import com.xinelu.common.core.domain.R;
|
||||
import com.xinelu.common.exception.ServiceException;
|
||||
import com.xinelu.common.utils.DateUtils;
|
||||
@ -11,6 +12,7 @@ import com.xinelu.common.utils.spring.SpringUtils;
|
||||
import com.xinelu.common.utils.uuid.IdUtils;
|
||||
import com.xinelu.familydoctor.applet.mapper.ResidentServiceApplyMapper;
|
||||
import com.xinelu.familydoctor.applet.pojo.body.ApprovalBody;
|
||||
import com.xinelu.familydoctor.applet.pojo.body.MessagePushBody;
|
||||
import com.xinelu.familydoctor.applet.pojo.body.ResidentServiceApplyBody;
|
||||
import com.xinelu.familydoctor.applet.pojo.dto.ResidentServiceFormApplyDto;
|
||||
import com.xinelu.familydoctor.applet.pojo.entity.PatientInfo;
|
||||
@ -49,6 +51,8 @@ public class ResidentServiceApplyServiceImpl implements IResidentServiceAppletSe
|
||||
private IHospitalInfoService hospitalInfoService;
|
||||
@Resource
|
||||
private IScreeningProjectService screeningProjectService;
|
||||
@Resource
|
||||
private MessagePushService messagePushService;
|
||||
|
||||
/**
|
||||
* 新增服务申请
|
||||
@ -64,22 +68,20 @@ public class ResidentServiceApplyServiceImpl implements IResidentServiceAppletSe
|
||||
applyQuery.setIdentity(body.getIdentity());
|
||||
applyQuery.setBookingStatus("0");
|
||||
applyQuery.setApprovalStatus("0");
|
||||
applyQuery.setFormNo(body.getFormNo());
|
||||
List<ResidentServiceApplyVo> serviceBookingInfoVoList = residentServiceApplyMapper.findByBody(applyQuery);
|
||||
if (serviceBookingInfoVoList != null && serviceBookingInfoVoList.size() > 0) {
|
||||
throw new ServiceException("已经提交服务申请,不能重复提交");
|
||||
throw new ServiceException("已提交该服务申请,不能重复提交");
|
||||
}
|
||||
ResidentServiceApplyEntity entity;
|
||||
PatientInfo patientInfo = null;
|
||||
if (StringUtils.isBlank(body.getPatientId())) {
|
||||
patientInfo = patientInfoService.getByCardNo(body.getIdentity());
|
||||
if (patientInfo == null) {
|
||||
throw new ServiceException("未查询到注册信息");
|
||||
}
|
||||
PatientInfo patientInfo = patientInfoService.getByCardNo(body.getIdentity());
|
||||
if (patientInfo == null) {
|
||||
throw new ServiceException("未查询到注册信息");
|
||||
}
|
||||
|
||||
entity = new ResidentServiceApplyEntity();
|
||||
BeanUtils.copyProperties(body, entity);
|
||||
if (patientInfo != null) {
|
||||
if (StringUtils.isBlank(entity.getPatientId())) {
|
||||
entity.setPatientId(patientInfo.getPatientCode());
|
||||
}
|
||||
entity.setApplyTime(new Date());
|
||||
@ -92,6 +94,20 @@ public class ResidentServiceApplyServiceImpl implements IResidentServiceAppletSe
|
||||
entity.setServiceWay("2");
|
||||
}
|
||||
residentServiceApplyMapper.insert(entity);
|
||||
|
||||
MessagePushBody messagePushBody = new MessagePushBody();
|
||||
messagePushBody.setMessageCategory("4");
|
||||
messagePushBody.setBusType("10");
|
||||
messagePushBody.setOpenid(patientInfo.getOpenid());
|
||||
messagePushBody.setReceiveName(patientInfo.getPatientName());
|
||||
messagePushBody.setText1(body.getOrgName());
|
||||
messagePushBody.setText2(body.getFormName().length() >= 20? body.getFormName().substring(0,17) + "...": body.getFormName());
|
||||
messagePushBody.setText3(body.getFormName());
|
||||
messagePushBody.setSendTitle("服务预约");
|
||||
messagePushBody.setSendTime(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", new Date()));
|
||||
messagePushBody.setSendContent(patientInfo.getPatientName() + "已提交服务申请");
|
||||
messagePushBody.setCardNo(body.getIdentity());
|
||||
messagePushService.fdApprovePush(JSONObject.parseObject(JSONObject.toJSONString(messagePushBody)));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -263,7 +279,7 @@ public class ResidentServiceApplyServiceImpl implements IResidentServiceAppletSe
|
||||
if (signInfo == null) {
|
||||
throw new ServiceException("未查询到签约信息!");
|
||||
}
|
||||
// 获取家医个性服务包
|
||||
// 1、获取家医个性服务包
|
||||
result = (String) httpService.get(SpringUtils.getFdUrl(region) + "/package/getPackageOfGX/" + identity + (!StringUtils.isBlank(projectName) ? ("?formName=" + projectName) : "?formName=null"), null, String.class);
|
||||
jsonObject = JSONObject.parseObject(result);
|
||||
if (!"1".equals(jsonObject.get("code"))) {
|
||||
@ -286,46 +302,40 @@ public class ResidentServiceApplyServiceImpl implements IResidentServiceAppletSe
|
||||
sp.setDiscountPrice(per.getPackSignCost());
|
||||
sp.setServiceFreq(per.getServiceFreq());
|
||||
sp.setPerformanceCount(per.getPerformanceCount());
|
||||
sp.setTeamNo(per.getTeamNo());
|
||||
sp.setTeamName(per.getTeamName());
|
||||
sp.setUserNo(per.getUserNo());
|
||||
sp.setUserName(per.getUserName());
|
||||
projectList.add(sp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 获取签约机构下的筛查项目
|
||||
// 获取家医机构详情
|
||||
result = (String) httpService.get(SpringUtils.getFdUrl(region) + "/org/getOrgDetail/" + signInfo.getOrgNo(), null, String.class);
|
||||
jsonObject = JSONObject.parseObject(result);
|
||||
if ("1".equals(jsonObject.get("code"))) {
|
||||
if (jsonObject.containsKey("data") && jsonObject.get("data") != null) {
|
||||
OrgDetailVo org = JSONObject.parseObject(jsonObject.getJSONObject("data").toJSONString(), OrgDetailVo.class);
|
||||
if (org != null && !StringUtils.isBlank(org.getPhOrgId())) {
|
||||
// 根据机构编码获取筛查机构
|
||||
HospitalInfo Hospital = hospitalInfoService.getHosptalByOrgCode(org.getPhOrgId());
|
||||
if (Hospital != null) {
|
||||
// 获取筛查项目
|
||||
ScreeningProject query = new ScreeningProject();
|
||||
query.setHospitalId(Hospital.getId());
|
||||
query.setProjectName(projectName);
|
||||
List<ScreeningProject> screeningProjectList = screeningProjectService.findList(query);
|
||||
if (screeningProjectList != null && screeningProjectList.size() > 0) {
|
||||
ScreeningProjectVo sp;
|
||||
for (ScreeningProject project : screeningProjectList) {
|
||||
sp = new ScreeningProjectVo();
|
||||
sp.setSourceType("2");
|
||||
sp.setHospitalId(String.valueOf(project.getHospitalId()));
|
||||
sp.setHospitalName(project.getHospitalName());
|
||||
sp.setProjectId(project.getProjectId());
|
||||
sp.setProjectName(project.getProjectName());
|
||||
sp.setPrice(project.getPrice());
|
||||
sp.setDiscountPrice(project.getDiscountPrice());
|
||||
projectList.add(sp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 2、获取签约机构下的筛查项目
|
||||
// 根据机构编码获取筛查机构
|
||||
HospitalInfo Hospital = hospitalInfoService.getHosptalByOrgCode(signInfo.getOrgNo());
|
||||
if (Hospital != null) {
|
||||
// 获取筛查项目
|
||||
ScreeningProject query = new ScreeningProject();
|
||||
query.setHospitalId(Hospital.getId());
|
||||
query.setProjectName(projectName);
|
||||
List<ScreeningProject> screeningProjectList = screeningProjectService.findList(query);
|
||||
if (screeningProjectList != null && screeningProjectList.size() > 0) {
|
||||
ScreeningProjectVo sp;
|
||||
for (ScreeningProject project : screeningProjectList) {
|
||||
sp = new ScreeningProjectVo();
|
||||
sp.setSourceType("2");
|
||||
sp.setHospitalId(String.valueOf(project.getHospitalId()));
|
||||
sp.setHospitalName(project.getHospitalName());
|
||||
sp.setProjectId(project.getProjectId());
|
||||
sp.setProjectName(project.getProjectName());
|
||||
sp.setPrice(project.getPrice());
|
||||
sp.setDiscountPrice(project.getDiscountPrice());
|
||||
projectList.add(sp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return projectList;
|
||||
}
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.xinelu.familydoctor.applet.service.impl;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.xinelu.applet.service.messagepush.MessagePushService;
|
||||
import com.xinelu.common.exception.ServiceException;
|
||||
import com.xinelu.common.utils.DateUtils;
|
||||
import com.xinelu.common.utils.StringUtils;
|
||||
@ -9,6 +10,7 @@ import com.xinelu.common.utils.spring.SpringUtils;
|
||||
import com.xinelu.common.utils.uuid.IdUtils;
|
||||
import com.xinelu.familydoctor.applet.mapper.ResidentSignApplyMapper;
|
||||
import com.xinelu.familydoctor.applet.pojo.body.ApprovalBody;
|
||||
import com.xinelu.familydoctor.applet.pojo.body.MessagePushBody;
|
||||
import com.xinelu.familydoctor.applet.pojo.body.ResidentSignApplyBody;
|
||||
import com.xinelu.familydoctor.applet.pojo.dto.CrowdDto;
|
||||
import com.xinelu.familydoctor.applet.pojo.dto.PackageDto;
|
||||
@ -45,6 +47,8 @@ public class ResidentSignApplyServiceImpl implements IResidentSignAppletService
|
||||
private HttpService httpService;
|
||||
@Resource
|
||||
private IResidentPatientInfoService patientInfoService;
|
||||
@Resource
|
||||
private MessagePushService messagePushService;
|
||||
|
||||
/**
|
||||
* 新增签约申请
|
||||
@ -67,11 +71,11 @@ public class ResidentSignApplyServiceImpl implements IResidentSignAppletService
|
||||
ResidentSignApplyEntity entity = new ResidentSignApplyEntity();
|
||||
BeanUtils.copyProperties(body, entity);
|
||||
|
||||
if(StringUtils.isBlank(body.getPatientId())) {
|
||||
PatientInfo patientInfo = patientInfoService.getByCardNo(body.getIdentity());
|
||||
if (patientInfo == null) {
|
||||
throw new ServiceException("未查询到注册信息");
|
||||
}
|
||||
PatientInfo patientInfo = patientInfoService.getByCardNo(body.getIdentity());
|
||||
if (patientInfo == null) {
|
||||
throw new ServiceException("未查询到注册信息");
|
||||
}
|
||||
if (StringUtils.isBlank(body.getPatientId())) {
|
||||
entity.setPatientId(patientInfo.getPatientCode());
|
||||
}
|
||||
|
||||
@ -81,10 +85,10 @@ public class ResidentSignApplyServiceImpl implements IResidentSignAppletService
|
||||
// 审批状态0:待批准 1:已同意 2:已拒绝
|
||||
entity.setApprovalStatus("0");
|
||||
entity.setBookingNo(IdUtils.simpleUUID());
|
||||
if(StringUtils.isBlank(entity.getNation())) {
|
||||
if (StringUtils.isBlank(entity.getNation())) {
|
||||
entity.setNation("1");
|
||||
}
|
||||
if(entity.getSignYears() == null || entity.getSignYears() <= 0) {
|
||||
if (entity.getSignYears() == null || entity.getSignYears() <= 0) {
|
||||
entity.setSignYears(1);
|
||||
}
|
||||
entity.setCrowdsNo(body.getCrowdList().stream().map(CrowdDto::getCrowdNo).collect(Collectors.joining(",")));
|
||||
@ -92,6 +96,19 @@ public class ResidentSignApplyServiceImpl implements IResidentSignAppletService
|
||||
entity.setPackagesNo(body.getPackageList().stream().map(PackageDto::getPackageNo).collect(Collectors.joining(",")));
|
||||
entity.setPackagesName(body.getPackageList().stream().map(PackageDto::getPackageName).collect(Collectors.joining(",")));
|
||||
residentSignApplyMapper.insert(entity);
|
||||
|
||||
MessagePushBody messagePushBody = new MessagePushBody();
|
||||
messagePushBody.setMessageCategory("4");
|
||||
messagePushBody.setBusType("10");
|
||||
messagePushBody.setOpenid(patientInfo.getOpenid());
|
||||
messagePushBody.setReceiveName(body.getResidentName());
|
||||
messagePushBody.setText1(body.getOrgName());
|
||||
messagePushBody.setText2("签约申请");
|
||||
messagePushBody.setSendTitle("签约申请");
|
||||
messagePushBody.setSendTime(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", new Date()));
|
||||
messagePushBody.setSendContent(body.getResidentName() + "已提交申请");
|
||||
messagePushBody.setCardNo(body.getIdentity());
|
||||
messagePushService.fdApprovePush(JSONObject.parseObject(JSONObject.toJSONString(messagePushBody)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -3,48 +3,61 @@ package com.xinelu.familydoctor.entity;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 血脂记录表
|
||||
* @TableName device_bf_record
|
||||
*/
|
||||
@ApiModel("血脂记录表")
|
||||
@Data
|
||||
public class DeviceBfRecord implements Serializable {
|
||||
/**
|
||||
* 自增主键
|
||||
*/
|
||||
@ApiModelProperty("自增主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 居民身份证号
|
||||
*/
|
||||
@ApiModelProperty("居民身份证号")
|
||||
private String identity;
|
||||
|
||||
/**
|
||||
* 血清总胆固醇(单位:mmol/L)
|
||||
*/
|
||||
@ApiModelProperty("血清总胆固醇(单位:mmol/L)")
|
||||
private BigDecimal tc;
|
||||
|
||||
/**
|
||||
* 甘油三酯(单位:mmol/L)
|
||||
*/
|
||||
@ApiModelProperty("甘油三酯(单位:mmol/L)")
|
||||
private BigDecimal tg;
|
||||
|
||||
/**
|
||||
* 高密度脂蛋白胆固醇(单位:mmol/L)
|
||||
*/
|
||||
@ApiModelProperty("高密度脂蛋白胆固醇(单位:mmol/L)")
|
||||
private BigDecimal hdl;
|
||||
|
||||
/**
|
||||
* 低密度脂蛋白胆固醇(单位:mmol/L)
|
||||
*/
|
||||
@ApiModelProperty("低密度脂蛋白胆固醇(单位:mmol/L)")
|
||||
private BigDecimal ldl;
|
||||
|
||||
/**
|
||||
* 测量时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
|
||||
@ApiModelProperty("测量时间")
|
||||
private Date measureTime;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,43 +3,55 @@ package com.xinelu.familydoctor.entity;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 血糖记录表
|
||||
* @TableName device_bg_record
|
||||
*/
|
||||
@ApiModel("血糖记录表")
|
||||
@Data
|
||||
public class DeviceBgRecord implements Serializable {
|
||||
/**
|
||||
* 自增主键
|
||||
*/
|
||||
@ApiModelProperty("自增主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 居民身份证号
|
||||
*/
|
||||
@ApiModelProperty("居民身份证号")
|
||||
private String identity;
|
||||
|
||||
/**
|
||||
* 血糖值(单位:mmol/L)
|
||||
*/
|
||||
@ApiModelProperty("血糖值(单位:mmol/L)")
|
||||
private BigDecimal bg;
|
||||
|
||||
/**
|
||||
* 时间段1:凌晨2:早餐前3:早晨后4:午餐前5:午餐后6:晚餐前7:晚餐后8:睡前
|
||||
*/
|
||||
@ApiModelProperty("时间段1:凌晨2:早餐前3:早晨后4:午餐前5:午餐后6:晚餐前7:晚餐后8:睡前")
|
||||
private String bucket;
|
||||
|
||||
/**
|
||||
* 测量时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
|
||||
@ApiModelProperty("测量时间")
|
||||
private Date measureTime;
|
||||
|
||||
/**
|
||||
* 上传方式1:手动2:自动
|
||||
*/
|
||||
@ApiModelProperty("上传方式1:手动2:自动")
|
||||
private String uploadType;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
}
|
||||
|
||||
@ -34,9 +34,9 @@ public class DeviceBindResident implements Serializable {
|
||||
private String sn;
|
||||
|
||||
/**
|
||||
* 设备类型(0: 其他 1:血压计 2:血糖仪 3:血脂仪 4:血氧仪 5:体重秤 6:体温计)
|
||||
* 设备类型(1:血压计 2:血糖仪 3:动态血压仪)
|
||||
*/
|
||||
@ApiModelProperty("设备类型(0: 其他 1:血压计 2:血糖仪 3:血脂仪 4:血氧仪 5:体重秤 6:体温计)")
|
||||
@ApiModelProperty("设备类型(1:血压计 2:血糖仪 3:动态血压仪)")
|
||||
private String deviceType;
|
||||
|
||||
/**
|
||||
|
||||
@ -3,33 +3,55 @@ package com.xinelu.familydoctor.entity;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* BMI记录表
|
||||
* @TableName device_bmi_record
|
||||
*/
|
||||
@ApiModel("BMI记录表")
|
||||
@Data
|
||||
public class DeviceBmiRecord implements Serializable {
|
||||
/**
|
||||
* 自增主键
|
||||
*/
|
||||
@ApiModelProperty("自增主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 居民身份证号
|
||||
*/
|
||||
@ApiModelProperty("居民身份证号")
|
||||
private String identity;
|
||||
|
||||
/**
|
||||
* 身高(cm)
|
||||
*/
|
||||
@ApiModelProperty("身高(cm)")
|
||||
private BigDecimal height;
|
||||
|
||||
/**
|
||||
* 体重(kg)
|
||||
*/
|
||||
@ApiModelProperty("体重(kg)")
|
||||
private BigDecimal weight;
|
||||
|
||||
/**
|
||||
* BMI(单位:kg/m^2)
|
||||
*/
|
||||
@ApiModelProperty("BMI(单位:kg/m^2)")
|
||||
private BigDecimal bmi;
|
||||
|
||||
/**
|
||||
* 测量时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
|
||||
@ApiModelProperty("测量时间")
|
||||
private Date measureTime;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,38 +2,49 @@ package com.xinelu.familydoctor.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 血氧记录表
|
||||
* @TableName device_bo_record
|
||||
*/
|
||||
@ApiModel("血氧记录表")
|
||||
@Data
|
||||
public class DeviceBoRecord implements Serializable {
|
||||
/**
|
||||
* 自增主键
|
||||
*/
|
||||
@ApiModelProperty("自增主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 居民身份证号
|
||||
*/
|
||||
@ApiModelProperty("居民身份证号")
|
||||
private String identity;
|
||||
|
||||
/**
|
||||
* 血氧(单位:%)
|
||||
*/
|
||||
@ApiModelProperty("血氧(单位:%)")
|
||||
private Integer spo2;
|
||||
|
||||
/**
|
||||
* 脉搏(单位:次/分)
|
||||
*/
|
||||
@ApiModelProperty("脉搏(单位:次/分)")
|
||||
private Integer pulse;
|
||||
|
||||
/**
|
||||
* 测量时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
|
||||
@ApiModelProperty("测量时间")
|
||||
private Date measureTime;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,48 +2,61 @@ package com.xinelu.familydoctor.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 血压记录表
|
||||
* @TableName device_bp_record
|
||||
*/
|
||||
@ApiModel("血压记录表")
|
||||
@Data
|
||||
public class DeviceBpRecord implements Serializable {
|
||||
/**
|
||||
* 自增主键
|
||||
*/
|
||||
@ApiModelProperty("自增主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 居民身份证号
|
||||
*/
|
||||
@ApiModelProperty("居民身份证号")
|
||||
private String identity;
|
||||
|
||||
/**
|
||||
* 收缩压(单位:mmHg)
|
||||
*/
|
||||
@ApiModelProperty("收缩压(单位:mmHg)")
|
||||
private Integer sbp;
|
||||
|
||||
/**
|
||||
* 舒张压(单位:mmHg)
|
||||
*/
|
||||
@ApiModelProperty("舒张压(单位:mmHg)")
|
||||
private Integer dbp;
|
||||
|
||||
/**
|
||||
* 心率(单位:次/分)
|
||||
*/
|
||||
@ApiModelProperty("心率(单位:次/分)")
|
||||
private Integer hr;
|
||||
|
||||
/**
|
||||
* 测量时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
|
||||
@ApiModelProperty("测量时间")
|
||||
private Date measureTime;
|
||||
|
||||
/**
|
||||
* 上传方式1:手动2:自动
|
||||
*/
|
||||
@ApiModelProperty("上传方式1:手动2:自动")
|
||||
private String uploadType;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,38 +2,49 @@ package com.xinelu.familydoctor.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 心率记录表
|
||||
* @TableName device_hr_record
|
||||
*/
|
||||
@ApiModel("心率记录表")
|
||||
@Data
|
||||
public class DeviceHrRecord implements Serializable {
|
||||
/**
|
||||
* 自增主键
|
||||
*/
|
||||
@ApiModelProperty("自增主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 居民身份证号
|
||||
*/
|
||||
@ApiModelProperty("居民身份证号")
|
||||
private String identity;
|
||||
|
||||
/**
|
||||
* 心率(单位:次/分)
|
||||
*/
|
||||
@ApiModelProperty("心率(单位:次/分)")
|
||||
private Integer hr;
|
||||
|
||||
/**
|
||||
* 测量时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
|
||||
@ApiModelProperty("测量时间")
|
||||
private Date measureTime;
|
||||
|
||||
/**
|
||||
* 上传方式1:手动2:自动
|
||||
*/
|
||||
@ApiModelProperty("上传方式1:手动2:自动")
|
||||
private String uploadType;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,33 +3,43 @@ package com.xinelu.familydoctor.entity;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 体温记录表
|
||||
* @TableName device_temp_record
|
||||
*/
|
||||
@ApiModel("体温记录表")
|
||||
@Data
|
||||
public class DeviceTempRecord implements Serializable {
|
||||
/**
|
||||
* 自增主键
|
||||
*/
|
||||
@ApiModelProperty("自增主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 居民身份证号
|
||||
*/
|
||||
@ApiModelProperty("居民身份证号")
|
||||
private String identity;
|
||||
|
||||
/**
|
||||
* 体温(单位:℃)
|
||||
*/
|
||||
@ApiModelProperty("体温(单位:℃)")
|
||||
private BigDecimal temp;
|
||||
|
||||
/**
|
||||
* 测量时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
|
||||
@ApiModelProperty("测量时间")
|
||||
private Date measureTime;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,71 @@
|
||||
package com.xinelu.familydoctor.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 自我评估健康处方模板表
|
||||
* @TableName evaluate_advice_template
|
||||
*/
|
||||
@Data
|
||||
public class EvaluateAdviceTemplate implements Serializable {
|
||||
/**
|
||||
* 自增主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 模板类型
|
||||
*/
|
||||
private String templateType;
|
||||
|
||||
/**
|
||||
* 模板内容
|
||||
*/
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 模板状态1:启用2:停用
|
||||
*/
|
||||
private String useFlag;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private Long createBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
private Long updateBy;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 删除标识1:正常2:删除
|
||||
*/
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 请求参数
|
||||
*/
|
||||
private Map<String, Object> params;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
package com.xinelu.familydoctor.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 自评问卷答案表
|
||||
* @TableName evaluate_answer
|
||||
*/
|
||||
@Data
|
||||
public class EvaluateAnswer implements Serializable {
|
||||
/**
|
||||
* 自增主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 自评记录ID
|
||||
*/
|
||||
private Long recordId;
|
||||
|
||||
/**
|
||||
* 问题ID
|
||||
*/
|
||||
private Long questionId;
|
||||
|
||||
/**
|
||||
* 选项ID
|
||||
*/
|
||||
private Long optionId;
|
||||
|
||||
/**
|
||||
* 选项内容
|
||||
*/
|
||||
private String optionContent;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
package com.xinelu.familydoctor.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 自评问题选项表
|
||||
* @TableName evaluate_option
|
||||
*/
|
||||
@Data
|
||||
public class EvaluateOption implements Serializable {
|
||||
/**
|
||||
* 自增主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 问题ID
|
||||
*/
|
||||
private Long questionId;
|
||||
|
||||
/**
|
||||
* 问卷ID
|
||||
*/
|
||||
private Long surveyId;
|
||||
|
||||
/**
|
||||
* 选项名称
|
||||
*/
|
||||
private String optionName;
|
||||
|
||||
/**
|
||||
* 选项排序
|
||||
*/
|
||||
private Integer optionSort;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@ -0,0 +1,47 @@
|
||||
package com.xinelu.familydoctor.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 自评问题表
|
||||
* @TableName evaluate_question
|
||||
*/
|
||||
@Data
|
||||
public class EvaluateQuestion implements Serializable {
|
||||
/**
|
||||
* 自增主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 问卷ID
|
||||
*/
|
||||
private Long surveyId;
|
||||
|
||||
/**
|
||||
* 问题主题
|
||||
*/
|
||||
private String questionName;
|
||||
|
||||
/**
|
||||
* 问题类型1:单选2:多选3:填空
|
||||
*/
|
||||
private String questionType;
|
||||
|
||||
/**
|
||||
* 问题排序
|
||||
*/
|
||||
private Integer questionSort;
|
||||
|
||||
/**
|
||||
* 是否必填1:必填2:非必填
|
||||
*/
|
||||
private String requiredFlag;
|
||||
|
||||
private List<EvaluateOption> options;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@ -0,0 +1,53 @@
|
||||
package com.xinelu.familydoctor.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 自评记录表
|
||||
* @TableName evaluate_record
|
||||
*/
|
||||
@Data
|
||||
public class EvaluateRecord implements Serializable {
|
||||
/**
|
||||
* 自增主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 问卷ID
|
||||
*/
|
||||
private Long surveyId;
|
||||
|
||||
/**
|
||||
* 问卷主题
|
||||
*/
|
||||
private String surveySubject;
|
||||
|
||||
/**
|
||||
* 评估结果
|
||||
*/
|
||||
private String evaluateResult;
|
||||
|
||||
/**
|
||||
* 健康处方
|
||||
*/
|
||||
private String advice;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
private List<EvaluateAnswer> answers;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@ -0,0 +1,70 @@
|
||||
package com.xinelu.familydoctor.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 自评问卷表
|
||||
* @TableName evaluate_survey
|
||||
*/
|
||||
@Data
|
||||
public class EvaluateSurvey implements Serializable {
|
||||
/**
|
||||
* 自增主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 问卷主题1001:高血压评估问卷,1002:糖尿病评估问卷,1003:脑卒中评估问卷,1004:慢阻肺评估问卷,1005:慢病评估问卷,
|
||||
* 1006:糖尿病肾病评估问卷,1007:糖尿病眼病评估问卷,1008:糖尿病足病评估问卷
|
||||
*/
|
||||
private String surveySubject;
|
||||
|
||||
/**
|
||||
* 问卷状态1:启用2:停用
|
||||
*/
|
||||
private String useFlag;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private Long createBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
private Long updateBy;
|
||||
|
||||
/**
|
||||
* 删除标识1:正常2:删除
|
||||
*/
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
private List<EvaluateQuestion> questions;
|
||||
|
||||
/**
|
||||
* 请求参数
|
||||
*/
|
||||
private Map<String, Object> params;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@ -2,6 +2,7 @@ package com.xinelu.familydoctor.mapper;
|
||||
|
||||
import com.xinelu.familydoctor.entity.DeviceBgRecord;
|
||||
import com.xinelu.familydoctor.vo.BgCalcVO;
|
||||
import com.xinelu.familydoctor.vo.PhysicalLastRecordVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
@ -38,4 +39,5 @@ public interface DeviceBgRecordMapper {
|
||||
|
||||
int update(DeviceBgRecord record);
|
||||
|
||||
List<PhysicalLastRecordVO> getLastRecord(String identity);
|
||||
}
|
||||
|
||||
@ -0,0 +1,23 @@
|
||||
package com.xinelu.familydoctor.mapper;
|
||||
|
||||
import com.xinelu.familydoctor.entity.EvaluateAdviceTemplate;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author gaoyu
|
||||
* @description 针对表【evaluate_advice_template(自我评估健康处方模板表)】的数据库操作Mapper
|
||||
* @createDate 2023-10-16 16:51:09
|
||||
* @Entity com.xinelu.familydoctor.entity.EvaluateAdviceTemplate
|
||||
*/
|
||||
public interface EvaluateAdviceTemplateMapper {
|
||||
|
||||
List<EvaluateAdviceTemplate> findList(EvaluateAdviceTemplate record);
|
||||
|
||||
EvaluateAdviceTemplate getTemplateByType(String templateType);
|
||||
|
||||
int insert(EvaluateAdviceTemplate record);
|
||||
|
||||
int update(EvaluateAdviceTemplate record);
|
||||
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
package com.xinelu.familydoctor.mapper;
|
||||
|
||||
import com.xinelu.familydoctor.entity.EvaluateAnswer;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author gaoyu
|
||||
* @description 针对表【evaluate_answer(自评问卷答案表)】的数据库操作Mapper
|
||||
* @createDate 2023-10-11 09:51:39
|
||||
* @Entity com.xinelu.familydoctor.entity.EvaluateAnswer
|
||||
*/
|
||||
public interface EvaluateAnswerMapper {
|
||||
|
||||
List<EvaluateAnswer> getAnswers(Long recordId);
|
||||
|
||||
int insert(EvaluateAnswer record);
|
||||
|
||||
int update(EvaluateAnswer recordId);
|
||||
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
package com.xinelu.familydoctor.mapper;
|
||||
|
||||
import com.xinelu.familydoctor.entity.EvaluateOption;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author gaoyu
|
||||
* @description 针对表【evaluate_option(自评问题选项表)】的数据库操作Mapper
|
||||
* @createDate 2023-10-11 09:51:26
|
||||
* @Entity com.xinelu.familydoctor.entity.EvaluateOption
|
||||
*/
|
||||
public interface EvaluateOptionMapper {
|
||||
|
||||
List<EvaluateOption> getOptions(Long questionId);
|
||||
|
||||
int insert(EvaluateOption record);
|
||||
|
||||
int update(EvaluateOption record);
|
||||
|
||||
/**
|
||||
* 清空问卷ID与wentiID
|
||||
* @param questionId 问题ID
|
||||
* @param surveyId 问卷ID
|
||||
* @return {@link int}
|
||||
* @author gaoyu
|
||||
* @date 2023-10-11 17:31
|
||||
*/
|
||||
int clearRelationId(@Param("questionId") Long questionId, @Param("surveyId") Long surveyId);
|
||||
|
||||
}
|
||||
@ -0,0 +1,31 @@
|
||||
package com.xinelu.familydoctor.mapper;
|
||||
|
||||
import com.xinelu.familydoctor.entity.EvaluateQuestion;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author gaoyu
|
||||
* @description 针对表【evaluate_question(自评问题表)】的数据库操作Mapper
|
||||
* @createDate 2023-10-11 09:51:20
|
||||
* @Entity com.xinelu.familydoctor.entity.EvaluateQuestion
|
||||
*/
|
||||
public interface EvaluateQuestionMapper {
|
||||
|
||||
List<EvaluateQuestion> getQuestions(Long surveyId);
|
||||
|
||||
int insert(EvaluateQuestion record);
|
||||
|
||||
int update(EvaluateQuestion record);
|
||||
|
||||
/**
|
||||
* 清空问卷ID
|
||||
* @param surveyId 问卷ID
|
||||
* @return {@link int}
|
||||
* @author gaoyu
|
||||
* @date 2023-10-11 17:33
|
||||
*/
|
||||
int clearSurveyId(@Param("surveyId") Long surveyId);
|
||||
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package com.xinelu.familydoctor.mapper;
|
||||
|
||||
import com.xinelu.familydoctor.entity.EvaluateRecord;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author gaoyu
|
||||
* @description 针对表【evaluate_record(自评记录表)】的数据库操作Mapper
|
||||
* @createDate 2023-10-11 09:51:34
|
||||
* @Entity com.xinelu.familydoctor.entity.EvaluateRecord
|
||||
*/
|
||||
public interface EvaluateRecordMapper {
|
||||
|
||||
List<EvaluateRecord> getTimeline(Long userId);
|
||||
|
||||
int insert(EvaluateRecord record);
|
||||
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
package com.xinelu.familydoctor.mapper;
|
||||
|
||||
import com.xinelu.familydoctor.entity.EvaluateSurvey;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author gaoyu
|
||||
* @description 针对表【evaluate_survey(自评问卷表)】的数据库操作Mapper
|
||||
* @createDate 2023-10-11 09:51:11
|
||||
* @Entity com.xinelu.familydoctor.entity.EvaluateSurvey
|
||||
*/
|
||||
public interface EvaluateSurveyMapper {
|
||||
|
||||
List<EvaluateSurvey> findList(EvaluateSurvey entity);
|
||||
|
||||
/**
|
||||
* 获取问卷
|
||||
* @param surveySubject 问卷主题
|
||||
* @return {@link com.xinelu.familydoctor.entity.EvaluateSurvey}
|
||||
* @author gaoyu
|
||||
* @date 2023-10-12 17:22
|
||||
*/
|
||||
EvaluateSurvey getSurvey(String surveySubject);
|
||||
|
||||
int insert(EvaluateSurvey record);
|
||||
|
||||
int update(EvaluateSurvey record);
|
||||
|
||||
}
|
||||
@ -0,0 +1,13 @@
|
||||
package com.xinelu.familydoctor.service;
|
||||
|
||||
import com.xinelu.familydoctor.entity.EvaluateAdviceTemplate;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface EvaluateAdviceTemplateService {
|
||||
List<EvaluateAdviceTemplate> findList(EvaluateAdviceTemplate entity);
|
||||
EvaluateAdviceTemplate getTemplate(String templateType);
|
||||
void save(EvaluateAdviceTemplate entity);
|
||||
void changeStatus(EvaluateAdviceTemplate entity);
|
||||
void delTemplate(Long id);
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package com.xinelu.familydoctor.service;
|
||||
|
||||
import com.xinelu.familydoctor.entity.EvaluateAnswer;
|
||||
import com.xinelu.familydoctor.entity.EvaluateRecord;
|
||||
import com.xinelu.familydoctor.vo.EvaluateRecordTimelineVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface EvaluateRecordService {
|
||||
void submit(EvaluateRecord entity);
|
||||
|
||||
List<EvaluateRecordTimelineVO> getEvaluateTimeline(Long userId);
|
||||
|
||||
List<EvaluateAnswer> getAnswers(Long recordId);
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
package com.xinelu.familydoctor.service;
|
||||
|
||||
import com.xinelu.familydoctor.entity.EvaluateSurvey;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface EvaluateSurveyService {
|
||||
List<EvaluateSurvey> findList(EvaluateSurvey entity);
|
||||
|
||||
/**
|
||||
* 获取问卷
|
||||
* @param surveySubject 问卷主题
|
||||
* @return {@link com.xinelu.familydoctor.entity.EvaluateSurvey}
|
||||
* @author gaoyu
|
||||
* @date 2023-10-12 17:23
|
||||
*/
|
||||
EvaluateSurvey getSurvey(String surveySubject);
|
||||
|
||||
void insert(EvaluateSurvey entity);
|
||||
|
||||
void update(EvaluateSurvey entity);
|
||||
}
|
||||
@ -1,7 +1,9 @@
|
||||
package com.xinelu.familydoctor.service;
|
||||
|
||||
import com.xinelu.familydoctor.entity.*;
|
||||
import com.xinelu.familydoctor.vo.PhysicalLastRecordVO;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface PhysicalSignService {
|
||||
@ -22,4 +24,13 @@ public interface PhysicalSignService {
|
||||
* @date 2023-10-9 10:10
|
||||
*/
|
||||
Map<String, Object> record(String identity, String type, String label);
|
||||
|
||||
/**
|
||||
* 获取最后一次记录
|
||||
* @param identity 身份证号
|
||||
* @return {@link java.util.List<com.xinelu.familydoctor.vo.PhysicalLastRecordVO>}
|
||||
* @author gaoyu
|
||||
* @date 2023-10-20 14:56
|
||||
*/
|
||||
List<PhysicalLastRecordVO> getLastRecord(String identity);
|
||||
}
|
||||
|
||||
@ -0,0 +1,63 @@
|
||||
package com.xinelu.familydoctor.service.impl;
|
||||
|
||||
import com.xinelu.common.utils.SecurityUtils;
|
||||
import com.xinelu.familydoctor.entity.EvaluateAdviceTemplate;
|
||||
import com.xinelu.familydoctor.mapper.EvaluateAdviceTemplateMapper;
|
||||
import com.xinelu.familydoctor.service.EvaluateAdviceTemplateService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author gaoyu
|
||||
* @description 自我评估处方模板实现类
|
||||
* @date 2023-10-16 16:58
|
||||
*/
|
||||
@Service
|
||||
public class EvaluateAdviceTemplateServiceImpl implements EvaluateAdviceTemplateService {
|
||||
@Resource
|
||||
private EvaluateAdviceTemplateMapper evaluateAdviceTemplateMapper;
|
||||
|
||||
@Override
|
||||
public List<EvaluateAdviceTemplate> findList(EvaluateAdviceTemplate entity) {
|
||||
return evaluateAdviceTemplateMapper.findList(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EvaluateAdviceTemplate getTemplate(String templateType) {
|
||||
return evaluateAdviceTemplateMapper.getTemplateByType(templateType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save(EvaluateAdviceTemplate entity) {
|
||||
if (entity.getId() == null) {
|
||||
entity.setCreateTime(new Date());
|
||||
entity.setCreateBy(SecurityUtils.getUserId());
|
||||
entity.setDelFlag("1");
|
||||
evaluateAdviceTemplateMapper.insert(entity);
|
||||
} else {
|
||||
entity.setUpdateBy(SecurityUtils.getUserId());
|
||||
entity.setUpdateTime(new Date());
|
||||
evaluateAdviceTemplateMapper.update(entity);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeStatus(EvaluateAdviceTemplate entity) {
|
||||
entity.setUpdateBy(SecurityUtils.getUserId());
|
||||
entity.setUpdateTime(new Date());
|
||||
evaluateAdviceTemplateMapper.update(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delTemplate(Long id) {
|
||||
EvaluateAdviceTemplate entity = new EvaluateAdviceTemplate();
|
||||
entity.setId(id);
|
||||
entity.setDelFlag("2");
|
||||
entity.setUpdateBy(SecurityUtils.getUserId());
|
||||
entity.setUpdateTime(new Date());
|
||||
evaluateAdviceTemplateMapper.update(entity);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,79 @@
|
||||
package com.xinelu.familydoctor.service.impl;
|
||||
|
||||
import com.xinelu.common.utils.DateUtils;
|
||||
import com.xinelu.familydoctor.entity.EvaluateAnswer;
|
||||
import com.xinelu.familydoctor.entity.EvaluateRecord;
|
||||
import com.xinelu.familydoctor.mapper.EvaluateAnswerMapper;
|
||||
import com.xinelu.familydoctor.mapper.EvaluateRecordMapper;
|
||||
import com.xinelu.familydoctor.service.EvaluateRecordService;
|
||||
import com.xinelu.familydoctor.vo.EvaluateRecordResultVO;
|
||||
import com.xinelu.familydoctor.vo.EvaluateRecordTimelineVO;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author gaoyu
|
||||
* @description 自评记录
|
||||
* @date 2023-10-16 9:23
|
||||
*/
|
||||
@Service
|
||||
public class EvaluateRecordServiceImpl implements EvaluateRecordService {
|
||||
@Resource
|
||||
private EvaluateRecordMapper evaluateRecordMapper;
|
||||
@Resource
|
||||
private EvaluateAnswerMapper evaluateAnswerMapper;
|
||||
|
||||
@Override
|
||||
public void submit(EvaluateRecord entity) {
|
||||
entity.setCreateTime(new Date());
|
||||
evaluateRecordMapper.insert(entity);
|
||||
List<EvaluateAnswer> answers = entity.getAnswers();
|
||||
if (CollectionUtils.isNotEmpty(answers)) {
|
||||
for (EvaluateAnswer answer : answers) {
|
||||
answer.setRecordId(entity.getId());
|
||||
evaluateAnswerMapper.insert(answer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EvaluateRecordTimelineVO> getEvaluateTimeline(Long userId) {
|
||||
List<EvaluateRecord> records = evaluateRecordMapper.getTimeline(userId);
|
||||
List<EvaluateRecordTimelineVO> timeline = new ArrayList<>();
|
||||
Map<String, List<EvaluateRecordResultVO>> map = new HashMap<>();
|
||||
if (CollectionUtils.isNotEmpty(records)) {
|
||||
records.forEach(r -> {
|
||||
List<EvaluateRecordResultVO> resultList;
|
||||
if (!map.containsKey(DateUtils.formatDate(r.getCreateTime(), "yyyy-MM-dd"))) {
|
||||
resultList = new ArrayList<>();
|
||||
} else {
|
||||
resultList = map.get(DateUtils.formatDate(r.getCreateTime(), "yyyy-MM-dd"));
|
||||
}
|
||||
EvaluateRecordResultVO resultVO = new EvaluateRecordResultVO();
|
||||
resultVO.setRecordId(r.getId());
|
||||
resultVO.setEvaluateResult(r.getEvaluateResult());
|
||||
resultVO.setSurveySubject(r.getSurveySubject());
|
||||
resultVO.setAdvice(r.getAdvice());
|
||||
resultVO.setTime(DateUtils.formatDate(r.getCreateTime(), "HH:mm:ss"));
|
||||
resultVO.setDate(DateUtils.formatDate(r.getCreateTime(), "yyyy-MM-dd"));
|
||||
resultList.add(resultVO);
|
||||
map.put(DateUtils.formatDate(r.getCreateTime(), "yyyy-MM-dd"), resultList);
|
||||
});
|
||||
map.forEach((k, v) -> {
|
||||
EvaluateRecordTimelineVO recordLine = new EvaluateRecordTimelineVO();
|
||||
recordLine.setDate(k);
|
||||
recordLine.setRecords(v);
|
||||
timeline.add(recordLine);
|
||||
});
|
||||
}
|
||||
return timeline;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EvaluateAnswer> getAnswers(Long recordId) {
|
||||
return evaluateAnswerMapper.getAnswers(recordId);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,106 @@
|
||||
package com.xinelu.familydoctor.service.impl;
|
||||
|
||||
import com.xinelu.common.utils.SecurityUtils;
|
||||
import com.xinelu.familydoctor.entity.EvaluateOption;
|
||||
import com.xinelu.familydoctor.entity.EvaluateQuestion;
|
||||
import com.xinelu.familydoctor.entity.EvaluateSurvey;
|
||||
import com.xinelu.familydoctor.mapper.EvaluateOptionMapper;
|
||||
import com.xinelu.familydoctor.mapper.EvaluateQuestionMapper;
|
||||
import com.xinelu.familydoctor.mapper.EvaluateSurveyMapper;
|
||||
import com.xinelu.familydoctor.service.EvaluateSurveyService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author gaoyu
|
||||
* @description 自评问卷业务实现类
|
||||
* @date 2023-10-11 13:24
|
||||
*/
|
||||
@Service
|
||||
public class EvaluateSurveyServiceImpl implements EvaluateSurveyService {
|
||||
@Resource
|
||||
private EvaluateSurveyMapper evaluateSurveyMapper;
|
||||
@Resource
|
||||
private EvaluateQuestionMapper evaluateQuestionMapper;
|
||||
@Resource
|
||||
private EvaluateOptionMapper evaluateOptionMapper;
|
||||
|
||||
@Override
|
||||
public List<EvaluateSurvey> findList(EvaluateSurvey entity) {
|
||||
return evaluateSurveyMapper.findList(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EvaluateSurvey getSurvey(String surveySubject) {
|
||||
return evaluateSurveyMapper.getSurvey(surveySubject);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insert(EvaluateSurvey entity) {
|
||||
entity.setCreateBy(SecurityUtils.getUserId());
|
||||
entity.setCreateTime(new Date());
|
||||
entity.setDelFlag("1");
|
||||
int row = evaluateSurveyMapper.insert(entity);
|
||||
if (row > 0) {
|
||||
List<EvaluateQuestion> questions = entity.getQuestions();
|
||||
if (!CollectionUtils.isEmpty(questions)) {
|
||||
for (EvaluateQuestion question : questions) {
|
||||
question.setSurveyId(entity.getId());
|
||||
row = evaluateQuestionMapper.insert(question);
|
||||
if (row > 0) {
|
||||
List<EvaluateOption> options = question.getOptions();
|
||||
if (!CollectionUtils.isEmpty(options)) {
|
||||
for (EvaluateOption option : options) {
|
||||
option.setSurveyId(entity.getId());
|
||||
option.setQuestionId(question.getId());
|
||||
evaluateOptionMapper.insert(option);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(EvaluateSurvey entity) {
|
||||
entity.setUpdateBy(SecurityUtils.getUserId());
|
||||
entity.setUpdateTime(new Date());
|
||||
entity.setDelFlag("1");
|
||||
int row = evaluateSurveyMapper.update(entity);
|
||||
if (row > 0) {
|
||||
List<EvaluateQuestion> questions = entity.getQuestions();
|
||||
if (!CollectionUtils.isEmpty(questions)) {
|
||||
evaluateQuestionMapper.clearSurveyId(entity.getId());
|
||||
for (EvaluateQuestion question : questions) {
|
||||
question.setSurveyId(entity.getId());
|
||||
if (Objects.isNull(question.getId())) {
|
||||
row = evaluateQuestionMapper.insert(question);
|
||||
} else {
|
||||
row = evaluateQuestionMapper.update(question);
|
||||
}
|
||||
if (row > 0) {
|
||||
List<EvaluateOption> options = question.getOptions();
|
||||
if (!CollectionUtils.isEmpty(options)) {
|
||||
evaluateOptionMapper.clearRelationId(question.getId(), entity.getId());
|
||||
for (EvaluateOption option : options) {
|
||||
option.setSurveyId(entity.getId());
|
||||
option.setQuestionId(question.getId());
|
||||
if (Objects.isNull(option.getId())) {
|
||||
evaluateOptionMapper.insert(option);
|
||||
} else {
|
||||
evaluateOptionMapper.update(option);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -99,6 +99,11 @@ public class PhysicalSignServiceImpl implements PhysicalSignService {
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PhysicalLastRecordVO> getLastRecord(String identity) {
|
||||
return deviceBgRecordMapper.getLastRecord(identity);
|
||||
}
|
||||
|
||||
private Map<String, Object> bgRecord(String identity, String type) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
List<DeviceBgRecord> list = deviceBgRecordMapper.getBgRecord(identity, type);
|
||||
|
||||
@ -0,0 +1,20 @@
|
||||
package com.xinelu.familydoctor.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author gaoyu
|
||||
* @description 自评记录结果视图
|
||||
* @date 2023-10-16 11:38
|
||||
*/
|
||||
@ApiModel("自评记录结果视图")
|
||||
@Data
|
||||
public class EvaluateRecordResultVO {
|
||||
private Long recordId;
|
||||
private String surveySubject;
|
||||
private String evaluateResult;
|
||||
private String advice;
|
||||
private String time;
|
||||
private String date;
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package com.xinelu.familydoctor.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author gaoyu
|
||||
* @description 评估记录时间轴视图
|
||||
* @date 2023-10-16 11:30
|
||||
*/
|
||||
@ApiModel("评估记录时间轴视图")
|
||||
@Data
|
||||
public class EvaluateRecordTimelineVO {
|
||||
private String date;
|
||||
private List<EvaluateRecordResultVO> records;
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
package com.xinelu.familydoctor.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author gaoyu
|
||||
* @description 体征检测最后一次记录
|
||||
* @date 2023-10-20 14:28
|
||||
*/
|
||||
@ApiModel("体征检测最后一次记录")
|
||||
@Data
|
||||
public class PhysicalLastRecordVO {
|
||||
@ApiModelProperty("类型1:血糖2:血压3:血脂4:bmi5:血氧6:心率7:体温")
|
||||
private String type;
|
||||
@ApiModelProperty("日期")
|
||||
@JsonFormat(pattern = "yyyy/MM/dd", timezone = "GMT+8")
|
||||
private Date date;
|
||||
@ApiModelProperty("时间段1:凌晨2:早餐前3:早晨后4:午餐前5:午餐后6:晚餐前7:晚餐后8:睡前")
|
||||
private String bucket;
|
||||
@ApiModelProperty("值")
|
||||
private String val;
|
||||
}
|
||||
@ -105,4 +105,27 @@
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
|
||||
<select id="getLastRecord" resultType="com.xinelu.familydoctor.vo.PhysicalLastRecordVO">
|
||||
(select '1' AS "type", measure_time "date", bucket, bg "val" from device_bg_record
|
||||
where identity = #{identity} and measure_time >= date_add(now(), interval -30 day) order by id desc limit 1)
|
||||
union all
|
||||
(select '2' AS "type", measure_time "date", null "bucket", concat(sbp, '/', dbp) "val" from device_bp_record
|
||||
where identity = #{identity} and measure_time >= date_add(now(), interval -30 day) order by id desc limit 1)
|
||||
union all
|
||||
(select '3' AS "type", measure_time "date", null "bucket", concat(tc, '/', tg, '/', hdl, '/', ldl) "val" from device_bf_record
|
||||
where identity = #{identity} and measure_time >= date_add(now(), interval -30 day) order by id desc limit 1)
|
||||
union all
|
||||
(select '4' AS "type", measure_time "date", null "bucket", bmi "val" from device_bmi_record
|
||||
where identity = #{identity} and measure_time >= date_add(now(), interval -30 day) order by id desc limit 1)
|
||||
union all
|
||||
(select '5' AS "type", measure_time "date", null "bucket", spo2 "val" from device_bo_record
|
||||
where identity = #{identity} and measure_time >= date_add(now(), interval -30 day) order by id desc limit 1)
|
||||
union all
|
||||
(select '6' AS "type", measure_time "date", null "bucket", hr "val" from device_hr_record
|
||||
where identity = #{identity} and measure_time >= date_add(now(), interval -30 day) order by id desc limit 1)
|
||||
union all
|
||||
(select '7' AS "type", measure_time "date", null "bucket", temp "val" from device_temp_record
|
||||
where identity = #{identity} and measure_time >= date_add(now(), interval -30 day) order by id desc limit 1)
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@ -7,13 +7,15 @@
|
||||
<resultMap id="BaseResultMap" type="com.xinelu.familydoctor.entity.DeviceBmiRecord">
|
||||
<id property="id" column="id" jdbcType="BIGINT"/>
|
||||
<result property="identity" column="identity" jdbcType="VARCHAR"/>
|
||||
<result property="height" column="height" jdbcType="DECIMAL"/>
|
||||
<result property="weight" column="weight" jdbcType="DECIMAL"/>
|
||||
<result property="bmi" column="bmi" jdbcType="DECIMAL"/>
|
||||
<result property="measureTime" column="measure_time" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,identity,bmi,
|
||||
measure_time
|
||||
id,identity,height,
|
||||
weight,bmi,measure_time
|
||||
</sql>
|
||||
|
||||
<select id="getBmiRecord" resultMap="BaseResultMap">
|
||||
@ -46,10 +48,10 @@
|
||||
|
||||
<select id="getBmiCalc" resultType="com.xinelu.familydoctor.vo.BmiCalcVO">
|
||||
select ifnull(max(bmi), 0) "maxVal",
|
||||
ifnull(min(bmi), 0) "minVal",
|
||||
ifnull(avg(bmi), 0) "avgVal",
|
||||
count(case when bmi >= 18.5 and bmi <= 23.9 then 1 else null end) "normalNum",
|
||||
count(case when bmi < 18.5 or bmi >= 24 then 1 else null end) "overNum"
|
||||
ifnull(min(bmi), 0) "minVal",
|
||||
ifnull(avg(bmi), 0) "avgVal",
|
||||
count(case when bmi >= 18.5 and bmi <= 23.9 then 1 else null end) "normalNum",
|
||||
count(case when bmi < 18.5 or bmi >= 24 then 1 else null end) "overNum"
|
||||
from device_bmi_record
|
||||
where identity = #{identity}
|
||||
<choose>
|
||||
@ -73,26 +75,33 @@
|
||||
</otherwise>
|
||||
</choose>
|
||||
</select>
|
||||
|
||||
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.xinelu.familydoctor.entity.DeviceBmiRecord" useGeneratedKeys="true">
|
||||
insert into device_bmi_record
|
||||
(identity,bmi
|
||||
,measure_time)
|
||||
values (#{identity,jdbcType=VARCHAR},#{bmi,jdbcType=DECIMAL}
|
||||
,#{measureTime,jdbcType=TIMESTAMP})
|
||||
(identity,height
|
||||
,weight,bmi,measure_time
|
||||
)
|
||||
values (#{identity,jdbcType=VARCHAR},#{height,jdbcType=DECIMAL}
|
||||
,#{weight,jdbcType=DECIMAL},#{bmi,jdbcType=DECIMAL},#{measureTime,jdbcType=TIMESTAMP}
|
||||
)
|
||||
</insert>
|
||||
<update id="update" parameterType="com.xinelu.familydoctor.entity.DeviceBmiRecord">
|
||||
update device_bmi_record
|
||||
<set>
|
||||
<if test="identity != null">
|
||||
identity = #{identity,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="bmi != null">
|
||||
bmi = #{bmi,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="measureTime != null">
|
||||
measure_time = #{measureTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="identity != null">
|
||||
identity = #{identity,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="height != null">
|
||||
height = #{height,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="weight != null">
|
||||
weight = #{weight,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="bmi != null">
|
||||
bmi = #{bmi,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="measureTime != null">
|
||||
measure_time = #{measureTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
|
||||
@ -51,7 +51,7 @@
|
||||
<sql id="maxSbpSql">
|
||||
select concat(sbp, '/', dbp) "maxSbpVal" from device_bp_record
|
||||
where sbp = (select max(sbp) from device_bp_record
|
||||
and identity = #{identity}
|
||||
where identity = #{identity}
|
||||
<choose>
|
||||
<when test="type == '0'">
|
||||
|
||||
@ -99,7 +99,7 @@
|
||||
<sql id="maxDbpSql">
|
||||
select concat(sbp, '/', dbp) "maxDbpVal" from device_bp_record
|
||||
where dbp = (select max(dbp) from device_bp_record
|
||||
and identity = #{identity}
|
||||
where identity = #{identity}
|
||||
<choose>
|
||||
<when test="type == '0'">
|
||||
|
||||
@ -147,7 +147,7 @@
|
||||
<sql id="minSbpSql">
|
||||
select concat(sbp, '/', dbp) "minSbpVal" from device_bp_record
|
||||
where sbp = (select min(sbp) from device_bp_record
|
||||
and identity = #{identity}
|
||||
where identity = #{identity}
|
||||
<choose>
|
||||
<when test="type == '0'">
|
||||
|
||||
@ -195,7 +195,7 @@
|
||||
<sql id="minDbpSql">
|
||||
select concat(sbp, '/', dbp) "minDbpVal" from device_bp_record
|
||||
where dbp = (select min(dbp) from device_bp_record
|
||||
and identity = #{identity}
|
||||
where identity = #{identity}
|
||||
<choose>
|
||||
<when test="type == '0'">
|
||||
|
||||
|
||||
@ -0,0 +1,93 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.xinelu.familydoctor.mapper.EvaluateAdviceTemplateMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.xinelu.familydoctor.entity.EvaluateAdviceTemplate">
|
||||
<id property="id" column="id" jdbcType="BIGINT"/>
|
||||
<result property="templateType" column="template_type" jdbcType="VARCHAR"/>
|
||||
<result property="content" column="content" jdbcType="VARCHAR"/>
|
||||
<result property="useFlag" column="use_flag" jdbcType="VARCHAR"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="createBy" column="create_by" jdbcType="BIGINT"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateBy" column="update_by" jdbcType="BIGINT"/>
|
||||
<result property="remark" column="remark" jdbcType="VARCHAR"/>
|
||||
<result property="delFlag" column="del_flag" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,template_type,content,
|
||||
use_flag,create_time,create_by,
|
||||
update_time,update_by,remark,
|
||||
del_flag
|
||||
</sql>
|
||||
|
||||
<select id="findList" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from evaluate_advice_template
|
||||
where del_flag = '1'
|
||||
<if test="templateType != null and templateType != ''">
|
||||
and template_type = #{templateType}
|
||||
</if>
|
||||
<if test="useFlag != null and useFlag != ''">
|
||||
and use_flag = #{useFlag}
|
||||
</if>
|
||||
order by id desc
|
||||
</select>
|
||||
|
||||
<select id="getTemplateByType" resultMap="BaseResultMap">
|
||||
select <include refid="Base_Column_List" /> from evaluate_advice_template
|
||||
where del_flag = '1'
|
||||
and use_flag = '1'
|
||||
and template_type = #{templateType}
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.xinelu.familydoctor.entity.EvaluateAdviceTemplate" useGeneratedKeys="true">
|
||||
insert into evaluate_advice_template
|
||||
( id,template_type,content
|
||||
,use_flag,create_time,create_by
|
||||
,update_time,update_by,remark
|
||||
,del_flag)
|
||||
values (#{id,jdbcType=BIGINT},#{templateType,jdbcType=VARCHAR},#{content,jdbcType=VARCHAR}
|
||||
,#{useFlag,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{createBy,jdbcType=BIGINT}
|
||||
,#{updateTime,jdbcType=TIMESTAMP},#{updateBy,jdbcType=BIGINT},#{remark,jdbcType=VARCHAR}
|
||||
,#{delFlag,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
<update id="update" parameterType="com.xinelu.familydoctor.entity.EvaluateAdviceTemplate">
|
||||
update evaluate_advice_template
|
||||
<set>
|
||||
<if test="templateType != null">
|
||||
template_type = #{templateType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="content != null">
|
||||
content = #{content,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="useFlag != null">
|
||||
use_flag = #{useFlag,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="createBy != null">
|
||||
create_by = #{createBy,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updateBy != null">
|
||||
update_by = #{updateBy,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
remark = #{remark,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="delFlag != null">
|
||||
del_flag = #{delFlag,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.xinelu.familydoctor.mapper.EvaluateAnswerMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.xinelu.familydoctor.entity.EvaluateAnswer">
|
||||
<id property="id" column="id" jdbcType="BIGINT"/>
|
||||
<result property="recordId" column="record_id" jdbcType="BIGINT"/>
|
||||
<result property="questionId" column="question_id" jdbcType="BIGINT"/>
|
||||
<result property="optionId" column="option_id" jdbcType="BIGINT"/>
|
||||
<result property="optionContent" column="option_content" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,record_id,question_id,
|
||||
option_id,option_content
|
||||
</sql>
|
||||
|
||||
<select id="getAnswers" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
select <include refid="Base_Column_List" />
|
||||
from evaluate_answer
|
||||
where record_id = #{recordId,jdbcType=BIGINT}
|
||||
</select>
|
||||
|
||||
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.xinelu.familydoctor.entity.EvaluateAnswer" useGeneratedKeys="true">
|
||||
insert into evaluate_answer
|
||||
(record_id,question_id
|
||||
,option_id,option_content)
|
||||
values (#{recordId,jdbcType=BIGINT},#{questionId,jdbcType=BIGINT}
|
||||
,#{optionId,jdbcType=BIGINT},#{optionContent,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
<update id="update" parameterType="com.xinelu.familydoctor.entity.EvaluateAnswer">
|
||||
update evaluate_answer
|
||||
<set>
|
||||
<if test="recordId != null">
|
||||
record_id = #{recordId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="questionId != null">
|
||||
question_id = #{questionId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="optionId != null">
|
||||
option_id = #{optionId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="optionContent != null">
|
||||
option_content = #{optionContent,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.xinelu.familydoctor.mapper.EvaluateOptionMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.xinelu.familydoctor.entity.EvaluateOption">
|
||||
<id property="id" column="id" jdbcType="BIGINT"/>
|
||||
<result property="questionId" column="question_id" jdbcType="BIGINT"/>
|
||||
<result property="surveyId" column="survey_id" jdbcType="BIGINT"/>
|
||||
<result property="optionName" column="option_name" jdbcType="VARCHAR"/>
|
||||
<result property="optionSort" column="option_sort" jdbcType="INTEGER"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,question_id,survey_id,
|
||||
option_name,option_sort
|
||||
</sql>
|
||||
|
||||
<select id="getOptions" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from evaluate_option
|
||||
where question_id = #{questionId,jdbcType=BIGINT}
|
||||
</select>
|
||||
|
||||
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.xinelu.familydoctor.entity.EvaluateOption" useGeneratedKeys="true">
|
||||
insert into evaluate_option
|
||||
(question_id,survey_id
|
||||
,option_name,option_sort)
|
||||
values (#{questionId,jdbcType=BIGINT},#{surveyId,jdbcType=BIGINT}
|
||||
,#{optionName,jdbcType=VARCHAR},#{optionSort,jdbcType=INTEGER})
|
||||
</insert>
|
||||
<update id="update" parameterType="com.xinelu.familydoctor.entity.EvaluateOption">
|
||||
update evaluate_option
|
||||
<set>
|
||||
<if test="questionId != null">
|
||||
question_id = #{questionId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="surveyId != null">
|
||||
survey_id = #{surveyId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="optionName != null">
|
||||
option_name = #{optionName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="optionSort != null">
|
||||
option_sort = #{optionSort,jdbcType=INTEGER},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
|
||||
<update id="clearRelationId">
|
||||
update evaluate_option set question_id = null, survey_id = null
|
||||
where question_id = #{questionId,jdbcType=BIGINT} and survey_id = #{surveyId,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
@ -0,0 +1,64 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.xinelu.familydoctor.mapper.EvaluateQuestionMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.xinelu.familydoctor.entity.EvaluateQuestion">
|
||||
<id property="id" column="id" jdbcType="BIGINT"/>
|
||||
<result property="surveyId" column="survey_id" jdbcType="BIGINT"/>
|
||||
<result property="questionName" column="question_name" jdbcType="VARCHAR"/>
|
||||
<result property="questionType" column="question_type" jdbcType="VARCHAR"/>
|
||||
<result property="questionSort" column="question_sort" jdbcType="INTEGER"/>
|
||||
<result property="requiredFlag" column="required_flag" jdbcType="VARCHAR"/>
|
||||
<collection property="options" ofType="com.xinelu.familydoctor.entity.EvaluateOption"
|
||||
column="id" select="com.xinelu.familydoctor.mapper.EvaluateOptionMapper.getOptions">
|
||||
|
||||
</collection>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,survey_id,question_name,
|
||||
question_type,question_sort,required_flag
|
||||
</sql>
|
||||
|
||||
<select id="getQuestions" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from evaluate_question
|
||||
where survey_id = #{surveyId,jdbcType=BIGINT}
|
||||
</select>
|
||||
|
||||
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.xinelu.familydoctor.entity.EvaluateQuestion" useGeneratedKeys="true">
|
||||
insert into evaluate_question
|
||||
(survey_id,question_name
|
||||
,question_type,question_sort,required_flag)
|
||||
values (#{surveyId,jdbcType=BIGINT},#{questionName,jdbcType=VARCHAR}
|
||||
,#{questionType,jdbcType=VARCHAR},#{questionSort,jdbcType=INTEGER},#{requiredFlag,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
<update id="update" parameterType="com.xinelu.familydoctor.entity.EvaluateQuestion">
|
||||
update evaluate_question
|
||||
<set>
|
||||
<if test="surveyId != null">
|
||||
survey_id = #{surveyId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="questionName != null">
|
||||
question_name = #{questionName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="questionType != null">
|
||||
question_type = #{questionType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="questionSort != null">
|
||||
question_sort = #{questionSort,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="requiredFlag != null">
|
||||
required_flag = #{requiredFlag,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
|
||||
<update id="clearSurveyId">
|
||||
update evaluate_question set survey_id = null where survey_id = #{surveyId,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.xinelu.familydoctor.mapper.EvaluateRecordMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.xinelu.familydoctor.entity.EvaluateRecord">
|
||||
<id property="id" column="id" jdbcType="BIGINT"/>
|
||||
<result property="userId" column="user_id" jdbcType="BIGINT"/>
|
||||
<result property="surveyId" column="survey_id" jdbcType="BIGINT"/>
|
||||
<result property="surveySubject" column="survey_subject" jdbcType="VARCHAR"/>
|
||||
<result property="evaluateResult" column="evaluate_result" jdbcType="VARCHAR"/>
|
||||
<result property="advice" column="advice" jdbcType="VARCHAR"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,user_id,survey_id,survey_subject,
|
||||
evaluate_result,advice,create_time
|
||||
</sql>
|
||||
|
||||
<select id="getTimeline" resultMap="BaseResultMap">
|
||||
select <include refid="Base_Column_List" /> from evaluate_record
|
||||
where user_id = #{userId}
|
||||
order by id desc
|
||||
</select>
|
||||
|
||||
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.xinelu.familydoctor.entity.EvaluateRecord" useGeneratedKeys="true">
|
||||
insert into evaluate_record
|
||||
(user_id,survey_id,survey_subject
|
||||
,evaluate_result,advice,create_time
|
||||
)
|
||||
values (#{userId,jdbcType=BIGINT},#{surveyId,jdbcType=BIGINT},#{surveySubject,jdbcType=VARCHAR}
|
||||
,#{evaluateResult,jdbcType=VARCHAR},#{advice,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP}
|
||||
)
|
||||
</insert>
|
||||
</mapper>
|
||||
@ -0,0 +1,92 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.xinelu.familydoctor.mapper.EvaluateSurveyMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.xinelu.familydoctor.entity.EvaluateSurvey">
|
||||
<id property="id" column="id" jdbcType="BIGINT"/>
|
||||
<result property="surveySubject" column="survey_subject" jdbcType="VARCHAR"/>
|
||||
<result property="useFlag" column="use_flag" jdbcType="VARCHAR"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="createBy" column="create_by" jdbcType="BIGINT"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateBy" column="update_by" jdbcType="BIGINT"/>
|
||||
<result property="delFlag" column="del_flag" jdbcType="VARCHAR"/>
|
||||
<result property="remark" column="remark" jdbcType="VARCHAR"/>
|
||||
<collection property="questions" ofType="com.xinelu.familydoctor.entity.EvaluateQuestion"
|
||||
column="id" select="com.xinelu.familydoctor.mapper.EvaluateQuestionMapper.getQuestions">
|
||||
|
||||
</collection>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,survey_subject,use_flag,
|
||||
create_time,create_by,update_time,
|
||||
update_by,del_flag,remark
|
||||
</sql>
|
||||
|
||||
<select id="findList" resultMap="BaseResultMap">
|
||||
select <include refid="Base_Column_List" />
|
||||
from evaluate_survey
|
||||
where del_flag = '1'
|
||||
<if test="surveySubject != null and surveySubject != ''">
|
||||
and survey_subject = #{surveySubject}
|
||||
</if>
|
||||
<if test="useFlag != null and useFlag != ''">
|
||||
and use_flag = #{useFlag}
|
||||
</if>
|
||||
order by id
|
||||
</select>
|
||||
|
||||
<select id="getSurvey" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from evaluate_survey
|
||||
where survey_subject = #{surveySubject}
|
||||
and del_flag = '1'
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.xinelu.familydoctor.entity.EvaluateSurvey" useGeneratedKeys="true">
|
||||
insert into evaluate_survey
|
||||
(survey_subject,use_flag
|
||||
,create_time,create_by,update_time
|
||||
,update_by,del_flag,remark
|
||||
)
|
||||
values (#{surveySubject,jdbcType=VARCHAR},#{useFlag,jdbcType=VARCHAR}
|
||||
,#{createTime,jdbcType=TIMESTAMP},#{createBy,jdbcType=BIGINT},#{updateTime,jdbcType=TIMESTAMP}
|
||||
,#{updateBy,jdbcType=BIGINT},#{delFlag,jdbcType=VARCHAR},#{remark,jdbcType=VARCHAR}
|
||||
)
|
||||
</insert>
|
||||
<update id="update" parameterType="com.xinelu.familydoctor.entity.EvaluateSurvey">
|
||||
update evaluate_survey
|
||||
<set>
|
||||
<if test="surveyName != null">
|
||||
survey_subject = #{surveySubject,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="useFlag != null">
|
||||
use_flag = #{useFlag,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="createBy != null">
|
||||
create_by = #{createBy,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updateBy != null">
|
||||
update_by = #{updateBy,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="delFlag != null">
|
||||
del_flag = #{delFlag,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
remark = #{remark,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
@ -45,6 +45,9 @@
|
||||
<result property="cityCode" column="city_code"/>
|
||||
<result property="bindingTime" column="binding_time"/>
|
||||
<result property="isChecked" column="is_checked"/>
|
||||
<result property="householdRelationship" column="household_relationship"/>
|
||||
<result property="householdCardNo" column="household_card_no"/>
|
||||
<result property="signNo" column="sign_no"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectPatientInfoVo">
|
||||
@ -87,7 +90,10 @@
|
||||
disease,
|
||||
city_code,
|
||||
binding_time,
|
||||
is_checked
|
||||
is_checked,
|
||||
household_relationship,
|
||||
household_card_no,
|
||||
sign_no
|
||||
from patient_info
|
||||
</sql>
|
||||
|
||||
@ -119,6 +125,9 @@
|
||||
<if test="isChecked != null and isChecked != ''">
|
||||
and is_checked = #{isChecked}
|
||||
</if>
|
||||
<if test="householdCardNo">
|
||||
and household_card_no = #{householdCardNo}
|
||||
</if>
|
||||
</where>
|
||||
order by binding_time desc
|
||||
</select>
|
||||
@ -207,6 +216,15 @@
|
||||
</if>
|
||||
<if test="isChecked != null">is_checked,
|
||||
</if>
|
||||
<if test="householdRelationship != null">
|
||||
household_relationship,
|
||||
</if>
|
||||
<if test="householdCardNo != null">
|
||||
household_card_no,
|
||||
</if>
|
||||
<if test="signNo != null">
|
||||
sign_no,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="areaCode != null">#{areaCode},
|
||||
@ -286,6 +304,15 @@
|
||||
</if>
|
||||
<if test="isChecked != null">#{isChecked},
|
||||
</if>
|
||||
<if test="householdRelationship != null">
|
||||
#{householdRelationship},
|
||||
</if>
|
||||
<if test="householdCardNo != null">
|
||||
#{householdCardNo},
|
||||
</if>
|
||||
<if test="signNo != null">
|
||||
#{signNo},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@ -406,6 +433,15 @@
|
||||
<if test="isChecked != null">is_checked =
|
||||
#{isChecked},
|
||||
</if>
|
||||
<if test="householdRelationship != null">
|
||||
household_relationship = #{householdRelationship},
|
||||
</if>
|
||||
<if test="householdCardNo != null">
|
||||
household_card_no = #{householdCardNo},
|
||||
</if>
|
||||
<if test="signNo != null">
|
||||
sign_no = #{signNo},
|
||||
</if>
|
||||
</trim>
|
||||
where patient_code = #{patientCode}
|
||||
</update>
|
||||
@ -451,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"/>
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
approval_status,refuse_reason,approval_time
|
||||
</sql>
|
||||
<sql id="Base_Column_List_fd">
|
||||
p.id,p.apply_no,p.patient_id,sign_no,p.identity,
|
||||
p.id,p.apply_no,p.patient_id,p.sign_no,p.identity,
|
||||
p.org_no,p.org_name,p.team_no,
|
||||
p.team_name,p.user_no,p.user_name,
|
||||
p.apply_time,booking_status,cancel_time,p.rescind_type,p.rescind_reason,
|
||||
|
||||
@ -176,6 +176,8 @@
|
||||
</if>
|
||||
<if test="remark != null">remark,
|
||||
</if>
|
||||
<if test="serviceWay != null">service_way,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="bookingNo != null and bookingNo != ''">#{bookingNo},
|
||||
@ -186,9 +188,9 @@
|
||||
</if>
|
||||
<if test="identity != null and identity != ''">#{identity},
|
||||
</if>
|
||||
<if test="packagesNo != null">#{packagesNo},
|
||||
<if test="packageNo != null">#{packageNo},
|
||||
</if>
|
||||
<if test="packagesName != null">#{packagesName},
|
||||
<if test="packageName != null">#{packageName},
|
||||
</if>
|
||||
<if test="formNo != null">#{formNo},
|
||||
</if>
|
||||
@ -222,6 +224,8 @@
|
||||
</if>
|
||||
<if test="remark != null">#{remark},
|
||||
</if>
|
||||
<if test="serviceWay != null">#{serviceWay},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@ -252,7 +256,7 @@
|
||||
<select id="findByBody" resultType="com.xinelu.familydoctor.applet.pojo.vo.ResidentServiceApplyVo">
|
||||
select <include refid="Base_Column_Service_Apply"></include>,p.address,p.phone
|
||||
from resident_service_apply s
|
||||
left join patient_info p on p.patient_code = s.patient_id
|
||||
left join patient_info p on p.card_no = s.identity
|
||||
where 1=1
|
||||
<if test="identity != null and identity != ''">
|
||||
and s.identity = #{identity}
|
||||
@ -269,6 +273,9 @@
|
||||
<if test="userNo != null and userNo != ''">
|
||||
and s.user_no = #{userNo}
|
||||
</if>
|
||||
<if test="formNo != null and formNo != ''">
|
||||
and s.form_no = #{formNo}
|
||||
</if>
|
||||
<if test="startDate != null">
|
||||
and s.booking_time >= #{startDate}
|
||||
</if>
|
||||
|
||||
@ -53,4 +53,4 @@
|
||||
<artifactId>wechatpay-apache-httpclient</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
</project>
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.xinelu.applet.controller.appletscreeningrecord;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.xinelu.applet.service.messagepush.MessagePushService;
|
||||
import com.xinelu.common.annotation.RepeatSubmit;
|
||||
import com.xinelu.common.config.XinELuConfig;
|
||||
import com.xinelu.common.constant.ScreeningProjectConstants;
|
||||
@ -19,6 +20,7 @@ import com.xinelu.manage.vo.screeningrecord.ScreeningRecordVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import java.io.File;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@ -45,6 +47,9 @@ public class AppletScreeningRecordController extends BaseController {
|
||||
@Resource
|
||||
private IScreeningRecordService screeningRecordService;
|
||||
|
||||
@Resource
|
||||
private MessagePushService messagePushService;
|
||||
|
||||
@GetMapping("/record")
|
||||
@ApiOperation(value = "获取筛查结果记录")
|
||||
public TableDataInfo record(ScreeningRecordDTO query) {
|
||||
@ -83,7 +88,11 @@ public class AppletScreeningRecordController extends BaseController {
|
||||
if(!DateUtils.formatDate(body.getApplyStartTime(), "yyyy-MM-dd").equals(DateUtils.formatDate(body.getApplyEndTime(), "yyyy-MM-dd"))) {
|
||||
return R.fail("预约日期请选择在同一天");
|
||||
}
|
||||
return R.ok(screeningRecordService.save(body));
|
||||
JSONObject result = screeningRecordService.save(body);
|
||||
if(result != null && result.containsKey("openid")) {
|
||||
messagePushService.fdApprovePush(result);
|
||||
}
|
||||
return R.ok(result.getString("patientId"));
|
||||
} catch (Exception e) {
|
||||
return R.fail(e.getMessage());
|
||||
}
|
||||
|
||||
@ -4,12 +4,15 @@ import com.xinelu.applet.dto.chatrecord.ChatRecordDTO;
|
||||
import com.xinelu.applet.dto.chatrecord.MessageSearchDto;
|
||||
import com.xinelu.applet.service.chatRecord.IChatRecordService;
|
||||
import com.xinelu.applet.vo.chatrecord.MessageCenterVo;
|
||||
import com.xinelu.applet.vo.chatrecord.MessageVo;
|
||||
import com.xinelu.common.annotation.Log;
|
||||
import com.xinelu.common.constant.Constants;
|
||||
import com.xinelu.common.core.controller.BaseController;
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.common.core.domain.R;
|
||||
import com.xinelu.common.core.page.TableDataInfo;
|
||||
import com.xinelu.common.enums.BusinessType;
|
||||
import com.xinelu.common.exception.ServiceException;
|
||||
import com.xinelu.common.socket.WebSocketUtils;
|
||||
import com.xinelu.manage.domain.chatRecord.ChatRecord;
|
||||
import io.swagger.annotations.Api;
|
||||
@ -101,6 +104,19 @@ public class ChatRecordController extends BaseController {
|
||||
return R.ok(chatRecordService.getMegVoList(messageDto));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取指定类型的消息记录", notes = "1:通知公告 2:健康推送 4:消息通知")
|
||||
@GetMapping("/getMegList")
|
||||
public TableDataInfo getMegList(MessageSearchDto messageDto) {
|
||||
if (messageDto.getPatientId() == null) {
|
||||
throw new ServiceException("居民业务主键不能为空");
|
||||
}
|
||||
if (StringUtils.isBlank(messageDto.getMessageCategory())) {
|
||||
throw new ServiceException("消息类型不能为空");
|
||||
}
|
||||
startPage();
|
||||
return getDataTable(chatRecordService.getMegList(messageDto));
|
||||
}
|
||||
|
||||
@ApiOperation("删除消息")
|
||||
@GetMapping("/deleteMegs")
|
||||
public R<String> deleteMegs(@RequestBody List<Long> ids) {
|
||||
|
||||
@ -2,6 +2,7 @@ package com.xinelu.applet.dto.apporderevaluate;
|
||||
|
||||
import com.xinelu.common.custominterface.Insert;
|
||||
import com.xinelu.manage.domain.orderevaluatepictureinfo.OrderEvaluatePictureInfo;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
@ -47,6 +48,12 @@ public class OrderEvaluateAndPictureDTO implements Serializable {
|
||||
@NotBlank(message = "请选择订单编号", groups = {Insert.class})
|
||||
private String orderNo;
|
||||
|
||||
/**
|
||||
* 服务编号
|
||||
*/
|
||||
@ApiModelProperty(value = "服务编号")
|
||||
private String serviceCode;
|
||||
|
||||
/**
|
||||
* 评价内容
|
||||
*/
|
||||
@ -69,6 +76,12 @@ public class OrderEvaluateAndPictureDTO implements Serializable {
|
||||
@NotNull(message = "请选择评分", groups = {Insert.class})
|
||||
private Integer compositeScore;
|
||||
|
||||
/**
|
||||
* 订单来源,泉医模块:SPRING_DOCTOR,家医模块:FAMILY_DOCTOR
|
||||
*/
|
||||
@ApiModelProperty(value = "订单来源,泉医模块:SPRING_DOCTOR,家医模块:FAMILY_DOCTOR")
|
||||
private String orderSource;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ -84,8 +97,4 @@ public class OrderEvaluateAndPictureDTO implements Serializable {
|
||||
*/
|
||||
private List<OrderEvaluatePictureInfo> orderEvaluatePictureInfoList;
|
||||
|
||||
/**
|
||||
* 订单来源,泉医模块:SPRING_DOCTOR,家医模块:FAMILY_DOCTOR
|
||||
*/
|
||||
private String orderSource;
|
||||
}
|
||||
|
||||
@ -32,12 +32,23 @@ public class ChatRecordDTO extends BaseEntity implements Serializable {
|
||||
@NotNull(message = "聊天记录业务主键不能为空", groups = {Insert.class})
|
||||
private Long consultationId;
|
||||
|
||||
/**
|
||||
* 消息业务主键
|
||||
*/
|
||||
@NotNull(message = "消息业务主键", groups = {Insert.class})
|
||||
private String messageNo;
|
||||
|
||||
/**
|
||||
* 发送人
|
||||
*/
|
||||
@NotNull(message = "发送人信息不能为空", groups = {Insert.class})
|
||||
private Long senderId;
|
||||
|
||||
/**
|
||||
* 发送人(家医医生编号)
|
||||
*/
|
||||
private String senderNo;
|
||||
|
||||
/**
|
||||
* 发送人姓名
|
||||
*/
|
||||
@ -66,7 +77,6 @@ public class ChatRecordDTO extends BaseEntity implements Serializable {
|
||||
@NotNull(message = "消息类型不能为空", groups = {Insert.class})
|
||||
private String messageType;
|
||||
|
||||
|
||||
/**
|
||||
* 消息内容,图片内容时内容为:图片路径
|
||||
*/
|
||||
@ -74,5 +84,15 @@ public class ChatRecordDTO extends BaseEntity implements Serializable {
|
||||
@Length(max = 400, message = "消息内容不能超过18位", groups = {Insert.class, Update.class})
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
private String title;
|
||||
|
||||
@ApiModelProperty("通知适用人群(0:全部人群)")
|
||||
private String crowds;
|
||||
|
||||
@ApiModelProperty("通知适用人群名称")
|
||||
private String crowdsName;
|
||||
|
||||
}
|
||||
|
||||
@ -14,7 +14,7 @@ import lombok.Data;
|
||||
@ApiModel("标记为已读传输对象")
|
||||
public class MarkReadDto {
|
||||
|
||||
@ApiModelProperty("消息类别 1:通知公告,2:健康推送,3:在线咨询")
|
||||
@ApiModelProperty("消息类别 1:通知公告,2:健康推送,3:在线咨询 4:消息通知")
|
||||
private String messageCategory;
|
||||
|
||||
@ApiModelProperty("绑定编号")
|
||||
|
||||
@ -14,18 +14,21 @@ import lombok.Data;
|
||||
@Data
|
||||
public class MessageSearchDto {
|
||||
|
||||
@ApiModelProperty("消息类别 1:通知公告,2:健康推送,3:在线咨询")
|
||||
@ApiModelProperty("消息类别 1:通知公告,2:健康推送,3:在线咨询 4:消息通知")
|
||||
private String messageCategory;
|
||||
|
||||
@ApiModelProperty("通知适用人群(0:全部人群)")
|
||||
private String crowds;
|
||||
|
||||
@ApiModelProperty(value = "居民注册业务主键")
|
||||
private String bindingNo;
|
||||
private Long patientId;
|
||||
|
||||
@ApiModelProperty("发送人编号")
|
||||
private Long senderId;
|
||||
|
||||
@ApiModelProperty("发送人编号(家医医生编号)")
|
||||
private String senderNo;
|
||||
|
||||
@ApiModelProperty("接收人编号")
|
||||
private Long recipientId;
|
||||
|
||||
@ -47,6 +50,17 @@ public class MessageSearchDto {
|
||||
@ApiModelProperty(value = "居民绑定时间", hidden = true)
|
||||
private Date bindingTime;
|
||||
|
||||
/**
|
||||
* 页码
|
||||
*/
|
||||
@ApiModelProperty(value = "页码")
|
||||
private Integer pageNum = 1;
|
||||
/**
|
||||
* 每页大小
|
||||
*/
|
||||
@ApiModelProperty(value = "每页大小")
|
||||
private Integer pageSize = 15;
|
||||
|
||||
@ApiModelProperty(value = "通知适用人群编号集合", hidden = true)
|
||||
private List<String> crowdNoList;
|
||||
}
|
||||
|
||||
@ -0,0 +1,43 @@
|
||||
package com.xinelu.applet.dto.messagepush;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author mengkuiliang
|
||||
* @Description 家医订阅消息请求参数扩展类
|
||||
* @Date 2023-10-19 019 10:15
|
||||
* @Param
|
||||
* @return
|
||||
**/
|
||||
@Data
|
||||
public class FDMessageExtentDto {
|
||||
|
||||
@ApiModelProperty("居民姓名")
|
||||
private String residentName;
|
||||
|
||||
@ApiModelProperty("医院名称")
|
||||
private String hospitalName;
|
||||
|
||||
@ApiModelProperty("医生名称")
|
||||
private String doctorName;
|
||||
|
||||
@ApiModelProperty("团队名称")
|
||||
private String teamName;
|
||||
|
||||
@ApiModelProperty("申请内容(比如:申请签约、申请随访、申请转诊等)")
|
||||
private String applyContent;
|
||||
|
||||
@ApiModelProperty("申请结果(比如:成功、失败、处理中等)")
|
||||
private String applyResult;
|
||||
|
||||
@ApiModelProperty("处理时间")
|
||||
private String handleDate;
|
||||
|
||||
@ApiModelProperty("药品名称")
|
||||
private String drugName;
|
||||
|
||||
@ApiModelProperty("药品用法")
|
||||
private String drugUsage;
|
||||
|
||||
}
|
||||
@ -0,0 +1,66 @@
|
||||
package com.xinelu.applet.dto.messagepush;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author mengkuiliang
|
||||
* @Description 消息推送请求对象
|
||||
* @Date 2023-10-18 018 14:26
|
||||
* @Param
|
||||
* @return
|
||||
**/
|
||||
@Data
|
||||
@ApiModel(value = "消息推送请求对象")
|
||||
public class FDMessagePushDto extends FDMessageExtentDto{
|
||||
|
||||
@ApiModelProperty("业务主键")
|
||||
private String messageNo;
|
||||
|
||||
@ApiModelProperty(value = "消息类别 1:通知公告,2:健康推送,3:在线咨询 4:消息通知", required = true)
|
||||
private String messageCategory;
|
||||
|
||||
@ApiModelProperty("通知适用人群(0:全部人群)")
|
||||
private String crowds;
|
||||
|
||||
@ApiModelProperty("通知适用人群名称")
|
||||
private String crowdsName;
|
||||
|
||||
@ApiModelProperty("发送人编号")
|
||||
private String senderNo;
|
||||
|
||||
@ApiModelProperty("发送人姓名")
|
||||
private String senderName;
|
||||
|
||||
@ApiModelProperty("发送时间")
|
||||
private String sendTime;
|
||||
|
||||
@ApiModelProperty("接收人身份证号")
|
||||
private String recipientIdentity;
|
||||
|
||||
@ApiModelProperty("接收人编号")
|
||||
private String recipientNo;
|
||||
|
||||
@ApiModelProperty("接收人姓名")
|
||||
private String recipientName;
|
||||
|
||||
@ApiModelProperty("消息类型,1:健康推送,2:日常提醒, 3:风险评估完成, 4:推送筛查项目,5:预约筛查成功, 6:筛查完成,7:康复处方,8:随访提醒,9:纳入管理,10:申请转诊,11:转诊申请通过,12:申请会诊,13:会诊申请通过,14:处理异常")
|
||||
private String messageType;
|
||||
|
||||
@ApiModelProperty("标题")
|
||||
private String title;
|
||||
|
||||
@ApiModelProperty("消息内容")
|
||||
private String content;
|
||||
|
||||
@ApiModelProperty("消息内容Id用于点击跳转")
|
||||
private String contentId;
|
||||
|
||||
@ApiModelProperty("已读状态,0:未读,1:已读")
|
||||
private String readStatus;
|
||||
|
||||
@ApiModelProperty(value = "模版类型(MessageTemplateType枚举)", required = true)
|
||||
private String templateType;
|
||||
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
package com.xinelu.applet.dto.messagepush;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author mengkuiliang
|
||||
* @Description 小程序推送所需数据
|
||||
* @Date 2023-10-19 019 10:36
|
||||
* @Param
|
||||
* @return
|
||||
**/
|
||||
@Data
|
||||
public class FDWxMegDto {
|
||||
|
||||
/**
|
||||
* 用户openid
|
||||
* */
|
||||
private String touser;
|
||||
|
||||
/**
|
||||
* 订阅消息模版id
|
||||
* */
|
||||
private String template_id;
|
||||
|
||||
/**
|
||||
* 默认跳到小程序首页
|
||||
* */
|
||||
private String page = "pages/index/index";
|
||||
/**
|
||||
* 推送文字
|
||||
* */
|
||||
private Map<String, TemplateData> data;
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package com.xinelu.applet.dto.messagepush;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author mengkuiliang
|
||||
* @Description 消息的内容
|
||||
* @Date 2023-10-19 019 10:36
|
||||
* @Param
|
||||
* @return
|
||||
**/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public class TemplateData {
|
||||
private String value;
|
||||
}
|
||||
@ -18,6 +18,15 @@ public interface ChatRecordMapper {
|
||||
|
||||
List<MessageVo> selectMegVoList(MessageSearchDto messageDto);
|
||||
|
||||
/**
|
||||
* @Author mengkuiliang
|
||||
* @Description
|
||||
* @Date 2023-10-25 025 15:25
|
||||
* @Param [bindingNo, doctorNo]
|
||||
* @return com.xinelu.applet.vo.chatrecord.MessageCenterVo
|
||||
**/
|
||||
List<MessageVo> selectMegList(MessageSearchDto messageDto);
|
||||
|
||||
MessageCenterVo selectOneChatRecord(@Param("bindingNo")Long bindingNo, @Param("doctorNo")Long doctorNo);
|
||||
/**
|
||||
* 查询图文咨询-聊天记录
|
||||
@ -69,5 +78,42 @@ public interface ChatRecordMapper {
|
||||
|
||||
Integer updateReadStatus(MarkReadDto markReadDto);
|
||||
|
||||
int deleteMegs(@Param("ids") List<Long> ids);
|
||||
int deleteMegs(@Param("ids") List<Long> ids);
|
||||
|
||||
/**
|
||||
* @Author mengkuiliang
|
||||
* @Description 查询健康知识推送列表
|
||||
* @Date 2023-10-25 025 11:27
|
||||
* @Param [messageDto]
|
||||
* @return java.lang.Object
|
||||
**/
|
||||
List<MessageVo> getNoticList(MessageSearchDto messageDto);
|
||||
|
||||
/**
|
||||
* @Author mengkuiliang
|
||||
* @Description 查询消息详情
|
||||
* @Date 2023-10-25 025 11:45
|
||||
* @Param [messageNo]
|
||||
* @return com.xinelu.applet.vo.chatrecord.MessageVo
|
||||
**/
|
||||
MessageVo getByNo(String messageNo);
|
||||
|
||||
/**
|
||||
* @Author mengkuiliang
|
||||
* @Description 删除通知
|
||||
* @Date 2023-10-25 025 13:15
|
||||
* @Param [messageNo]
|
||||
* @return void
|
||||
**/
|
||||
void del(String messageNo);
|
||||
|
||||
/**
|
||||
* @Author mengkuiliang
|
||||
* @Description 更新通知
|
||||
* @Date 2023-10-25 025 14:05
|
||||
* @Param [entity]
|
||||
* @return void
|
||||
**/
|
||||
void updateChatRecordOfNo(ChatRecord entity);
|
||||
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user