Browse Source

代码修改

LAPTOP-KB9HII50\70708 1 year ago
parent
commit
70bc5bf494

+ 4 - 1
common/common-entity/src/db/2023.sql

@ -319,4 +319,7 @@ INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('64', '0', '101', '亻革家人', '1', '', '', 'RGJR', '', '', NULL, '', NULL, '', '');
INSERT INTO `base`.`zy_nation_dict` (`ID`, `ORG_ID`, `NATION_CODE`, `NATION_NAME`, `VALID_FLAG`, `USER_CODE`, `CUSTOM_CODE`, `SPELL_CODE`, `WBZX_CODE`, `SORT_NO`, `CREATE_TIME`, `CREATE_OPERATOR`, `MODIFY_TIME`, `MODIFY_OPERATOR`, `REMARK`) VALUES ('65', '0', '62', '山由族', '1', '', '', 'SYZ', 'MMY', '', NULL, '', NULL, '', '');
ALTER TABLE `wlyy_rehabilitation_guidance` MODIFY COLUMN `type` varchar(50);
ALTER TABLE `wlyy_rehabilitation_guidance` MODIFY COLUMN `type` varchar(50);
ALTER TABLE base_service_item_plan
    ADD COLUMN reservation_type TINYINT(1) NULL;

+ 11 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServiceItemPlanDO.java

@ -29,6 +29,8 @@ public class ServiceItemPlanDO extends UuidIdentityEntityWithCreateTime {
    private String content;//服务完成笔记
    private String appendixs;//附件
    private Integer reservationType;//复诊类型 1线上 2线下
    private String guidanceMessage;//指导留言
    private String followupStatus;//随访状态 0取消 1已完成 2未开始 3进行中 4待审核
@ -158,4 +160,13 @@ public class ServiceItemPlanDO extends UuidIdentityEntityWithCreateTime {
    public void setFollowupStatus(String followupStatus) {
        this.followupStatus = followupStatus;
    }
    @Column(name = "reservation_type")
    public Integer getReservationType() {
        return reservationType;
    }
    public void setReservationType(Integer reservationType) {
        this.reservationType = reservationType;
    }
}

+ 32 - 0
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/rehabilitation/controller/RehabilitationManageController.java

@ -374,6 +374,38 @@ public class RehabilitationManageController extends EnvelopRestEndpoint {
        }
    }
    /**
     *
     * @param patient 居民code
     * @param doctor 专科医生code
     * @param type 1康复指导2康复下转3复诊提醒4上门服务提醒5家签提醒
     * @param relationCode 业务关联code
     * @param planId 计划id
     * @return
     */
    @RequestMapping(value = "sendSpecialistWeixinMessage", method = RequestMethod.POST)
    @ApiOperation("康复管理-发送微信模板消息")
    public Envelop sendSpecialistWeixinMessage(@ApiParam(name = "patient", value = "居民code", required = true)
                                               @RequestParam(value = "patient", required = true) String patient,
                                               @ApiParam(name = "doctor", value = "医生code", required = true)
                                               @RequestParam(value = "doctor", required = true) String doctor,
                                               @ApiParam(name = "type", value = "发送类型", required = true)
                                               @RequestParam(value = "type", required = true) Integer type,
                                               @ApiParam(name = "relationCode", value = "业务code", required = false)
                                               @RequestParam(value = "relationCode", required = true) String relationCode,
                                               @ApiParam(name = "planId", value = "计划id", required = false)
                                               @RequestParam(value = "planId", required = true) String planId,
                                               @ApiParam(name = "reservationType", value = "复诊类型:1线上,2线下,3远程", required = false)
                                               @RequestParam(value = "reservationType", required = false) Integer reservationType) {
        try {
            rehabilitationGuidanceService.sendSpecialistWeixinMessage(patient,doctor,type,relationCode,planId,reservationType);
            return success("请求成功!");
        } catch (Exception e) {
            e.printStackTrace();
            return failed("请求失败");
        }
    }
    @RequestMapping(value = "sendGuidance", method = RequestMethod.POST)
    @ApiOperation("康复管理-发送康复指导")

+ 13 - 20
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/rehabilitation/service/RehabilitationGuidanceService.java

@ -283,12 +283,12 @@ public class RehabilitationGuidanceService {
     *
     * @param patientCode  居民code
     * @param doctorCode   专科医生code
     * @param type         1康复指导2康复下转3复诊提醒4上门服务提醒5家签提醒
     * @param type         1康复指导2康复下转3复诊提醒4上门服务提醒
     * @param relationCode 业务关联code
     * @param planId       计划id
     * @throws Exception
     */
    public void sendSpecialistWeixinMessage(String patientCode, String doctorCode, Integer type, String relationCode, String planId, String reservationType) throws Exception {
    public void sendSpecialistWeixinMessage(String patientCode, String doctorCode, Integer type, String relationCode, String planId, Integer reservationType) throws Exception {
        //康复指导
        BasePatientDO patient = patientDao.findById(patientCode).orElse(null);
        BaseDoctorDO doctor = doctorDao.findById(doctorCode).orElse(null);
@ -312,7 +312,6 @@ public class RehabilitationGuidanceService {
            json.put("represented", patientCode);//被代理人
            json.put("id", planId);
            json.put("date", DateUtil.getStringDate());
//            json.put("orgName", doctor.getHospitalName());
            json.put("doctorName", doctor.getName());
            json.put("content", "《" + rehabilitationguidanceDO.getTitle() + "》");
            json.put("remark", "请及时阅读");
@ -340,23 +339,20 @@ public class RehabilitationGuidanceService {
        } else if (type == 3) {
            //复诊提醒3
            //更新复诊类型
            if (StringUtils.isNoneBlank(reservationType)) {
                String updSql = "update wlyy_rehabilitation_plan_detail set reservation_type = " + reservationType + " where id = '" + relationCode + "'";
                jdbcTemplate.execute(updSql);
            ServiceItemPlanDO serviceItemPlanDO = serviceItemPlanDao.findById(relationCode).orElse(null);
            if(serviceItemPlanDO==null){
                throw new ServiceException("参数错误:relationCode");
            }
            sendType = 11;//待办事项
            String sql = "select pd.id,pd.execute_time as executeTime from wlyy_rehabilitation_plan_detail pd " +
                    "where pd.id ='" + relationCode + "' and pd.hospital_service_item_id='7' and pd.status <>1 order by pd.execute_time desc ";
            List<Map<String, Object>> mapList = jdbcTemplate.queryForList(sql);
            String excuteTime = "";
            if (mapList != null && mapList.size() != 0) {
                excuteTime = DateUtil.dateToStrLong((Date) mapList.get(0).get("executeTime"));
            if(!serviceItemPlanDO.getDoctor().equals(doctorCode)){
                throw new ServiceException("不是您的任务,无法操作");
            }
            if (StringUtils.isNoneBlank(excuteTime)) {
                json.put("first", patient.getName() + ",您好!您的下次复诊时间是[" + excuteTime + "],请按时安排就诊。您可点击“查看详情”,提前预约就诊");
            } else {
                json.put("first", patient.getName() + ",您好!" + doctor.getName() + "医生提醒您预约复诊。您可点击“查看详情”,提前预约就诊");
            if("1".equals(serviceItemPlanDO.getStatus())){
                throw new ServiceException("请勿重复提醒");
            }
            serviceItemPlanDO.setReservationType(reservationType);
            rehabilitationManageService.completePlan(serviceItemPlanDO);
            sendType = 11;//待办事项
            json.put("first", patient.getName() + ",您好!" + doctor.getName() + "医生提醒您预约复诊。您可点击“查看详情”,提前预约就诊");
            json.put("toUser", patientCode);
            json.put("represented", patientCode);//被代理人
            json.put("keyword1", "复诊预约");
@ -370,10 +366,8 @@ public class RehabilitationGuidanceService {
                    "where pd.id ='" + relationCode + "' and pd.hospital_service_item_id='4' and pd.status <>1 order by pd.execute_time desc ";
            List<Map<String, Object>> mapList = jdbcTemplate.queryForList(sql);
            String excuteTime = "";
            String detailId = "";
            if (mapList != null && mapList.size() != 0) {
                excuteTime = DateUtil.dateToStrLong((Date) mapList.get(0).get("executeTime"));
            }
            if (StringUtils.isNoneBlank(excuteTime)) {
                json.put("first", patient.getName() + ",您好!您的下次上门诊疗服务时间是[" + excuteTime + "],请按时预约上门诊疗服务。您可点击“查看详情”,提前预约就诊");
@ -392,7 +386,6 @@ public class RehabilitationGuidanceService {
        if (StringUtils.isNotBlank(patient.getOpenid())) {
            pushMsgTask.putWxMsg(weiXinAccessTokenUtils.getAccessToken(), sendType, patient.getOpenid(), patient.getName(), json);
        }
    }