已删除19个文件
已修改15个文件
已添加1个文件
| | |
| | | !/sql/quartz.sql |
| | | !/sql/ry_20220822.sql |
| | | !/sql/pat_specific_archive_generate_config_lishui_mch_20261104.sql |
| | | !/sql/mch_followup_plan_20261117.sql |
| | | !/sql/pat_mch_archive_followup_status_20261123.sql |
| | | !/sql/service_subtask_add_mch_fields_20261123.sql |
| | | !/sql/drop_mch_followup_plan_tables_20261123.sql |
| | | sql/_probe/ |
| | | *.log |
| | | _dbcheck.txt |
| | |
| | | import com.ruoyi.system.service.ISysDeptService; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import com.ruoyi.message.sms.provider.sltd.ws.MessageSend; |
| | | import com.smartor.common.MchFollowupConstants; |
| | | import com.smartor.common.QwenLLMUtil; |
| | | import com.smartor.common.SpecificArchiveConstants; |
| | | import com.smartor.domain.*; |
| | | import com.ruoyi.task.domain.VO.ServiceSubtaskDetailTraceVO; |
| | | import com.smartor.mapper.*; |
| | | import com.smartor.service.*; |
| | | import com.smartor.service.mch.IMchFollowupPlanService; |
| | | import com.smartor.service.mch.IMchFollowupSendService; |
| | | import com.smartor.service.mch.IMchFollowupSubtaskService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | |
| | | private IPatSpecificArchiveGenerateService patSpecificArchiveGenerateService; |
| | | |
| | | @Autowired |
| | | private IMchFollowupPlanService mchFollowupPlanService; |
| | | |
| | | @Autowired |
| | | private IMchFollowupSendService mchFollowupSendService; |
| | | private IMchFollowupSubtaskService mchFollowupSubtaskService; |
| | | |
| | | @Autowired |
| | | private com.ruoyi.task.event.FollowupCompletedEventPublisher followupCompletedEventPublisher; |
| | |
| | | log.error("ãsfHandlleãåä»»å¡ä¸ºç©ºï¼è·³è¿å¤ç"); |
| | | return; |
| | | } |
| | | // å¦å¹¼é访ï¼service_type=21ï¼èµ°å¦å¹¼ä¸ç¨åéé»è¾ï¼ä¸ä¾èµ service_task.preachform_desc |
| | | if (MchFollowupConstants.SERVICE_TYPE_MCH.equals(serviceSubtask.getServiceType())) { |
| | | try { |
| | | mchFollowupSubtaskService.sendSubtask(serviceSubtask); |
| | | } catch (Exception e) { |
| | | log.error("ãå¦å¹¼é访ãsfHandlle åéå¼å¸¸ï¼subid={}", serviceSubtask.getId(), e); |
| | | } |
| | | return; |
| | | } |
| | | //è¿ééè¦æ ¹æ®èº«ä»½è¯å»é(ç»å¾®ä¿¡å°ç¨åºçåºå®ä»»å¡ç¨ç) |
| | | List<ServiceSubtask> serviceSubtaskListFilter = new ArrayList<>(); |
| | | ServiceTask ivrTask1 = serviceTaskMapper.selectServiceTaskByTaskid(serviceSubtask.getTaskid()); |
| | |
| | | } |
| | | |
| | | /** |
| | | * å¦å¹¼é访ï¼ä¸ºå·²æå¦å¹¼æ¡£æ¡è¡¥å»ºè®¡åã |
| | | * å¦å¹¼éè®¿ï¼æ«æå·²ç¡®è®¤æ¡£æ¡ï¼æ plannedFollowTime + followupPeriod çæ service_subtaskã |
| | | * |
| | | * <p>æ¡£æ¡æ°å¢/ä¿®æ¹æ¶ä¼èªå¨é建计åï¼æ¬ä»»å¡ç¨äºå岿°æ®è¡¥å»ºåå¼å¸¸è¡¥å¿ã</p> |
| | | * <p>å®é
åéç± longTaskSend / compensateTask è°ç¨ sfHandlle ç |
| | | * service_type=21 忝宿ã</p> |
| | | */ |
| | | public void generateMchFollowupPlan() { |
| | | public void generateMchFollowupSubtask() { |
| | | try { |
| | | int generated = mchFollowupPlanService.rebuildAll(200); |
| | | log.info("ãgenerateMchFollowupPlanãå¦å¹¼é访计åè¡¥å»ºå®æï¼çæèç¹æ°={}", generated); |
| | | int generated = mchFollowupSubtaskService.rebuildAll(200); |
| | | log.info("ãgenerateMchFollowupSubtaskãå¦å¹¼é访任å¡çæå®æï¼çæèç¹æ°={}", generated); |
| | | } catch (Exception e) { |
| | | log.error("ãgenerateMchFollowupPlanãå¦å¹¼é访计å补建失败", e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å¦å¹¼éè®¿ï¼æ«æå°æèç¹å¹¶åéã |
| | | * |
| | | * <p>åªè¡¥å 1 天å
å°æçèç¹ï¼è¶
è¿ 1 天æ è®°è¿æãçä¿¡èµ°äºMASï¼å¾®ä¿¡èµ° sendChatLsã</p> |
| | | */ |
| | | public void sendMchFollowup() { |
| | | try { |
| | | int sent = mchFollowupSendService.sendDue(200); |
| | | log.info("ãsendMchFollowupãå¦å¹¼é访åéå®æï¼æåæ°é={}", sent); |
| | | } catch (Exception e) { |
| | | log.error("ãsendMchFollowupãå¦å¹¼é访åé失败", e); |
| | | log.error("ãgenerateMchFollowupSubtaskãå¦å¹¼é访任å¡çæå¤±è´¥", e); |
| | | } |
| | | } |
| | | |
| | |
| | | @ApiModelProperty(value = "æå¡ç±»åéåï¼æéå·åå²") |
| | | private String serviceTypes; |
| | | |
| | | @ApiModelProperty(value = "å¦å¹¼æ¡£æ¡è¯¦æ
ID") |
| | | private Long mchArchiveDetailId; |
| | | |
| | | @ApiModelProperty(value = "å¦å¹¼é访èç¹åºå·") |
| | | private Integer mchNodeSeq; |
| | | |
| | | @ApiModelProperty(value = "å¦å¹¼é访计ååå¸") |
| | | private String mchPlanHash; |
| | | |
| | | @ApiModelProperty(value = "å¦å¹¼é访èç¹JSON") |
| | | private String mchNodeJson; |
| | | |
| | | /** |
| | | * 模æ¿ID |
| | | */ |
| | |
| | | package com.smartor.common; |
| | | |
| | | /** |
| | | * å¦å¹¼é访计åç¸å
³å¸¸éã |
| | | * å¦å¹¼é访ç¸å
³å¸¸éã |
| | | * |
| | | * <p>å¦å¹¼é访åªéç¨äºä¸½æ°´å¸å¦å¹¼ä¿å¥é¢ï¼ä¸ä½¿ç¨ç¬ç«ç计å表ååéä»»å¡ï¼ |
| | | * ä¸è¿å
¥æ®éé访ç {@code service_subtask_preachform} / {@code compensateTask} è¡¥å¿é¾è·¯ã</p> |
| | | * <p>å¦å¹¼é访åªéç¨äºä¸½æ°´å¸å¦å¹¼ä¿å¥é¢ãé访èç¹è½ service_subtaskï¼ |
| | | * service_type=21ï¼ç± sfHandlle çå¦å¹¼åæ¯åéï¼ä¸è¿å
¥æ®éé访补å¿é¾è·¯ã</p> |
| | | */ |
| | | public final class MchFollowupConstants { |
| | | |
| | |
| | | /** æ¡£æ¡ç±»åï¼å¿ä¿ */ |
| | | public static final String ARCHIVE_TYPE_CHILD = "2"; |
| | | |
| | | /** 计åç¶æï¼ææ */ |
| | | public static final String PLAN_STATUS_ACTIVE = "0"; |
| | | /** |
| | | * æ¡£æ¡éè®¿ç¶æï¼å¾
确认ã |
| | | * |
| | | * <p>é¨è¯æ¥è¯å®æ/ä½é¢éè®¿å®æèªå¨å»ºæ¡£æ¶åå
¥ï¼è¡¨ç¤ºæ¡£æ¡å°æªç»è¿äººå·¥ç¡®è®¤ï¼ |
| | | * ä¸çæé访任å¡ã</p> |
| | | */ |
| | | public static final String FOLLOWUP_STATUS_PENDING = "0"; |
| | | |
| | | /** 计åç¶æï¼å·²åæ¶ */ |
| | | public static final String PLAN_STATUS_CANCELED = "1"; |
| | | /** |
| | | * æ¡£æ¡éè®¿ç¶æï¼é访ä¸ã |
| | | * |
| | | * <p>人工ä¿å/确认档æ¡ååå
¥ï¼å
è®¸çæ service_subtaskã</p> |
| | | */ |
| | | public static final String FOLLOWUP_STATUS_ACTIVE = "1"; |
| | | |
| | | /** 计åç¶æï¼å·²å®æ */ |
| | | public static final String PLAN_STATUS_COMPLETED = "2"; |
| | | |
| | | /** 计åç¶æï¼å¾
è¡¥å
åºåæ¥/é
ç½®å¼å¸¸ */ |
| | | public static final String PLAN_STATUS_WAITING = "3"; |
| | | |
| | | /** èç¹ç¶æï¼å¾
åé */ |
| | | public static final String ITEM_STATUS_PENDING = "0"; |
| | | |
| | | /** èç¹ç¶æï¼åéä¸ */ |
| | | public static final String ITEM_STATUS_SENDING = "1"; |
| | | |
| | | /** èç¹ç¶æï¼æå */ |
| | | public static final String ITEM_STATUS_SUCCESS = "2"; |
| | | |
| | | /** èç¹ç¶æï¼å¤±è´¥ï¼éè¯èå°½ï¼ */ |
| | | public static final String ITEM_STATUS_FAILED = "3"; |
| | | |
| | | /** èç¹ç¶æï¼è¿æï¼è¶
è¿è¡¥åçªå£ï¼æªåéï¼ */ |
| | | public static final String ITEM_STATUS_EXPIRED = "4"; |
| | | |
| | | /** èç¹ç¶æï¼åæ¶ */ |
| | | public static final String ITEM_STATUS_CANCELED = "5"; |
| | | |
| | | /** èç¹ç¶æï¼è·³è¿ï¼ææºå·ä¸ºç©ºçï¼ */ |
| | | public static final String ITEM_STATUS_SKIPPED = "6"; |
| | | /** service_subtask.service_typeï¼å¦å¹¼é访 */ |
| | | public static final String SERVICE_TYPE_MCH = "21"; |
| | | |
| | | /** åéæ¹å¼ï¼çä¿¡ */ |
| | | public static final String SEND_TYPE_SMS = "sms"; |
| | |
| | | /** åéæ¹å¼ï¼å¾®ä¿¡å
¬ä¼å· */ |
| | | public static final String SEND_TYPE_WECHAT = "wechat"; |
| | | |
| | | /** è¡¥åçªå£ï¼åªè¡¥å 1 天å
å°æçèç¹ã */ |
| | | public static final long CATCHUP_MILLIS = 24L * 60L * 60L * 1000L; |
| | | |
| | | /** é»è®¤æå¤§éè¯æ¬¡æ°ã */ |
| | | public static final int DEFAULT_MAX_RETRY = 3; |
| | | |
| | | /** é»è®¤éè¯é´éï¼åéï¼ã */ |
| | | public static final int DEFAULT_RETRY_DELAY_MINUTES = 10; |
| | | |
| | | /** 忬¡æ«æé»è®¤ä¸éã */ |
| | | public static final int DEFAULT_BATCH_SIZE = 200; |
| | | |
| | | /** è¡¥åçªå£ï¼åªè¡¥å 1 天å
å°æçèç¹ã */ |
| | | public static final long CATCHUP_MILLIS = 24L * 60L * 60L * 1000L; |
| | | |
| | | /** å¯ç¨å¼å
³ï¼sys_configï¼ææºæè¯»åï¼ç¼ºçè§ä¸ºå¯ç¨ï¼ã */ |
| | | public static final String CONFIG_ENABLED = "mch.followup.enabled"; |
| | | |
| | |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * followupPeriod JSON è§£æåçåéèç¹å®ä¹ï¼å°æªè®¡ç®ç»å¯¹åéæ¶é´ï¼ã |
| | |
| | | private Long templateId; |
| | | |
| | | private String url; |
| | | |
| | | /** æ¡£æ¡å¤§ç±»ï¼1å¦ä¿ 2å¿ä¿ï¼çæ subtask æ¶åå¡«ï¼ä¾¿äºå ä½ç¬¦æ¸²æï¼ */ |
| | | private String archiveType; |
| | | |
| | | /** æ¡£æ¡åç±»åï¼æ©åå
³ç±/å´ç»ç»æMHI/è¥å
»æ§ç¾ç
/å¦ä¹ å°é¾/é«å±å¿ä¸æ¡ */ |
| | | private String archiveSubType; |
| | | |
| | | /** 卿åºåæ¥ */ |
| | | private Date plannedFollowTime; |
| | | } |
| | |
| | | @ApiModelProperty(value = "ç»æ¡ç¶æ") |
| | | private String closeStatus; |
| | | |
| | | /** éè®¿ç¶æï¼0å¾
确认 1éè®¿ä¸ */ |
| | | @Excel(name = "éè®¿ç¶æ") |
| | | @ApiModelProperty(value = "éè®¿ç¶æï¼0å¾
确认 1é访ä¸") |
| | | private String followupStatus; |
| | | |
| | | /** é访确认æ¶é´ */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @Excel(name = "é访确认æ¶é´", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "é访确认æ¶é´") |
| | | private Date followupConfirmTime; |
| | | |
| | | /** é访确认人 */ |
| | | @Excel(name = "é访确认人") |
| | | @ApiModelProperty(value = "é访确认人") |
| | | private String followupConfirmBy; |
| | | |
| | | /** åºçåå¨ */ |
| | | @Excel(name = "åºçåå¨") |
| | | @ApiModelProperty(value = "åºçåå¨") |
| | |
| | | @ApiModelProperty(value = "ç»æ¡ç¶æ") |
| | | private String closeStatus; |
| | | |
| | | /** éè®¿ç¶æï¼0å¾
确认 1éè®¿ä¸ */ |
| | | @Excel(name = "éè®¿ç¶æ") |
| | | @ApiModelProperty(value = "éè®¿ç¶æï¼0å¾
确认 1é访ä¸") |
| | | private String followupStatus; |
| | | |
| | | /** é访确认æ¶é´ */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @Excel(name = "é访确认æ¶é´", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "é访确认æ¶é´") |
| | | private Date followupConfirmTime; |
| | | |
| | | /** é访确认人 */ |
| | | @Excel(name = "é访确认人") |
| | | @ApiModelProperty(value = "é访确认人") |
| | | private String followupConfirmBy; |
| | | |
| | | /** æ¯å¦å»ºå 0-å¦ 1-æ¯ */ |
| | | @Excel(name = "æ¯å¦å»ºå") |
| | | @ApiModelProperty(value = "æ¯å¦å»ºå 0-å¦ 1-æ¯") |
| | |
| | | |
| | | public int deletePatChildArchiveById(Long id); |
| | | |
| | | /** |
| | | * 人工ä¿å/确认档æ¡ãä¿åæååæ¡£æ¡è¿å
¥âé访ä¸âï¼å¹¶æéè®¿å¨æåæé访æ¶é´çæè®¡åã |
| | | */ |
| | | public int insertOrUpdateChildArchive(PatChildArchiveDetail patChildArchiveDetail); |
| | | |
| | | /** |
| | | * ä¿åæ¡£æ¡ï¼å¹¶æå®æ¯å¦ç±äººå·¥ç¡®è®¤é访ã |
| | | * |
| | | * @param patChildArchiveDetail æ¡£æ¡è¯¦æ
|
| | | * @param confirmFollowup true=人工ä¿å/确认ï¼å
许çæé访计åï¼ |
| | | * false=é¨è¯æ¥è¯/ä½é¢é访èªå¨å»ºæ¡£ï¼åªå»ºè稿ï¼ä¸çæè®¡å |
| | | */ |
| | | public int insertOrUpdateChildArchive(PatChildArchiveDetail patChildArchiveDetail, |
| | | boolean confirmFollowup); |
| | | } |
| | |
| | | |
| | | public int deletePatMaternityArchiveById(Long id); |
| | | |
| | | /** |
| | | * 人工ä¿å/确认档æ¡ãä¿åæååæ¡£æ¡è¿å
¥âé访ä¸âï¼å¹¶æéè®¿å¨æåæé访æ¶é´çæè®¡åã |
| | | */ |
| | | public int insertOrUpdateMaternityArchive(PatMaternityArchiveDetail patMaternityArchiveDetail); |
| | | |
| | | /** |
| | | * ä¿åæ¡£æ¡ï¼å¹¶æå®æ¯å¦ç±äººå·¥ç¡®è®¤é访ã |
| | | * |
| | | * @param patMaternityArchiveDetail æ¡£æ¡è¯¦æ
|
| | | * @param confirmFollowup true=人工ä¿å/确认ï¼å
许çæé访计åï¼ |
| | | * false=é¨è¯æ¥è¯/ä½é¢é访èªå¨å»ºæ¡£ï¼åªå»ºè稿ï¼ä¸çæè®¡å |
| | | */ |
| | | public int insertOrUpdateMaternityArchive(PatMaternityArchiveDetail patMaternityArchiveDetail, |
| | | boolean confirmFollowup); |
| | | } |
| | |
| | | import com.smartor.mapper.PatChildArchiveMapper; |
| | | import com.smartor.service.IPatChildArchiveDetailService; |
| | | import com.smartor.service.IPatChildArchiveService; |
| | | import com.smartor.service.mch.IMchFollowupPlanService; |
| | | import com.smartor.service.mch.IMchFollowupSubtaskService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | private IPatChildArchiveDetailService patChildArchiveDetailService; |
| | | |
| | | @Autowired |
| | | private IMchFollowupPlanService mchFollowupPlanService; |
| | | private IMchFollowupSubtaskService mchFollowupSubtaskService; |
| | | |
| | | @Override |
| | | public PatChildArchive selectPatChildArchiveById(Long id) |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int insertOrUpdateChildArchive(PatChildArchiveDetail patChildArchiveDetail) { |
| | | return insertOrUpdateChildArchive(patChildArchiveDetail, true); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int insertOrUpdateChildArchive(PatChildArchiveDetail patChildArchiveDetail, |
| | | boolean confirmFollowup) { |
| | | if (patChildArchiveDetail == null) { |
| | | log.error("insertOrUpdateChildArchiveå
¥å为空ï¼è¯·æ£æ¥å
¥å"); |
| | | throw new BaseException("å¿ç§æ¡£æ¡å
¥å为空ï¼è¯·æ£æ¥å
¥å"); |
| | |
| | | |
| | | Long existArchiveId = null; |
| | | Long existDetailId = null; |
| | | PatChildArchiveDetail existingDetail = null; |
| | | if (CollectionUtils.isNotEmpty(olds)) { |
| | | existArchiveId = olds.get(0).getArchiveid(); |
| | | existDetailId = olds.get(0).getId(); |
| | | existingDetail = olds.get(0); |
| | | existArchiveId = existingDetail.getArchiveid(); |
| | | existDetailId = existingDetail.getId(); |
| | | } |
| | | |
| | | // 人工ä¿å/确认æ¶è¿å
¥é访ä¸ï¼HIS èªå¨å»ºæ¡£åªåå¾
确认ï¼ä¸çæé访计å |
| | | applyFollowupState(patChildArchiveDetail, existingDetail, confirmFollowup); |
| | | |
| | | // 详æ
没æ¥å°ï¼åå
åºæåæ ·é®æ¥ä¸»è¡¨ï¼é¿å
主表éå¤ |
| | | if (existArchiveId == null) { |
| | |
| | | patChildArchiveDetailService.insertPatChildArchiveDetail(patChildArchiveDetail); |
| | | } |
| | | |
| | | // å¦å¹¼é访计åï¼æ¡£æ¡æ°å¢/ä¿®æ¹åæ plannedFollowTime + followupPeriod é建 |
| | | // å¦å¹¼é访任å¡ï¼åªæäººå·¥ç¡®è®¤ï¼followup_status=1ï¼çæ¡£æ¡æçæ/é建 service_subtaskï¼ |
| | | // èªå¨å»ºæ¡£ä¸ºå¾
确认ï¼rebuildForArchive å
é¨ä¼ç´æ¥è·³è¿ã |
| | | try { |
| | | if (mchFollowupPlanService != null) { |
| | | mchFollowupPlanService.rebuildForArchive( |
| | | if (mchFollowupSubtaskService != null) { |
| | | mchFollowupSubtaskService.rebuildForArchive( |
| | | MchFollowupConstants.ARCHIVE_TYPE_CHILD, |
| | | patChildArchive.getId(), patChildArchiveDetail.getId()); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("å¦å¹¼é访计åé建失败ï¼archiveId={}ï¼detailId={}", |
| | | log.error("å¦å¹¼é访任å¡çæå¤±è´¥ï¼archiveId={}ï¼detailId={}", |
| | | patChildArchive.getId(), patChildArchiveDetail.getId(), e); |
| | | } |
| | | |
| | | log.info("insertOrUpdateChildArchiveå¤ç宿ï¼ä¸»è¡¨idï¼{}ï¼è¯¦æ
idï¼{}", patChildArchive.getId(), patChildArchiveDetail.getId()); |
| | | log.info("insertOrUpdateChildArchiveå¤ç宿ï¼ä¸»è¡¨idï¼{}ï¼è¯¦æ
idï¼{}ï¼éè®¿ç¶æï¼{}", |
| | | patChildArchive.getId(), patChildArchiveDetail.getId(), |
| | | patChildArchiveDetail.getFollowupStatus()); |
| | | return patChildArchive.getId().intValue(); |
| | | } |
| | | |
| | | /** |
| | | * å¤çæ¡£æ¡éè®¿ç¶æã |
| | | * |
| | | * <p>人工ä¿å/ç¡®è®¤ï¼æ¡£æ¡è¿å
¥é访ä¸ï¼å¹¶è®°å½é¦æ¬¡ç¡®è®¤æ¶é´/ç¡®è®¤äººï¼ |
| | | * HIS èªå¨å»ºæ¡£ï¼æ°æ¡£æ¡è¿å
¥å¾
ç¡®è®¤ï¼æ´æ°æ¶ä¸æ¹å¨å·²æç¶æï¼ä¹ä¸è¦ç人工维æ¤ç |
| | | * plannedFollowTime / followupPeriodã</p> |
| | | */ |
| | | private void applyFollowupState(PatChildArchiveDetail detail, |
| | | PatChildArchiveDetail existing, |
| | | boolean confirmFollowup) { |
| | | if (confirmFollowup) { |
| | | boolean alreadyActive = existing != null |
| | | && MchFollowupConstants.FOLLOWUP_STATUS_ACTIVE.equals(existing.getFollowupStatus()) |
| | | && existing.getFollowupConfirmTime() != null; |
| | | detail.setFollowupStatus(MchFollowupConstants.FOLLOWUP_STATUS_ACTIVE); |
| | | if (alreadyActive) { |
| | | // 已确认è¿çæ¡£æ¡éå¤ä¿åæ¶ï¼ä¿ç馿¬¡ç¡®è®¤æ¶é´/确认人 |
| | | detail.setFollowupConfirmTime(null); |
| | | detail.setFollowupConfirmBy(null); |
| | | } else { |
| | | detail.setFollowupConfirmTime(DateUtils.getNowDate()); |
| | | String confirmBy = detail.getUpdateBy(); |
| | | if (StringUtils.isEmpty(confirmBy)) { |
| | | confirmBy = detail.getCreateBy(); |
| | | } |
| | | detail.setFollowupConfirmBy(confirmBy); |
| | | } |
| | | return; |
| | | } |
| | | |
| | | // HIS èªå¨å»ºæ¡£ï¼æ°å¢åªè¿å
¥å¾
确认ï¼ä¸çæè®¡å |
| | | if (existing == null) { |
| | | detail.setFollowupStatus(MchFollowupConstants.FOLLOWUP_STATUS_PENDING); |
| | | detail.setFollowupConfirmTime(null); |
| | | detail.setFollowupConfirmBy(null); |
| | | return; |
| | | } |
| | | |
| | | // æ´æ°æ¶ä¿æåç¶æï¼é¿å
HIS é夿¨éæå·²ç¡®è®¤æ¡£æ¡éåå¾
确认 |
| | | detail.setFollowupStatus(null); |
| | | detail.setFollowupConfirmTime(null); |
| | | detail.setFollowupConfirmBy(null); |
| | | // 已确认/åå²å·²çææ¡£æ¡çéè®¿æ¥æä¸å¨æç±äººå·¥ç»´æ¤ï¼HIS 忥ä¸è¦ç |
| | | if (StringUtils.isEmpty(existing.getFollowupStatus()) |
| | | || MchFollowupConstants.FOLLOWUP_STATUS_ACTIVE.equals(existing.getFollowupStatus())) { |
| | | detail.setPlannedFollowTime(null); |
| | | detail.setFollowupPeriod(null); |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.smartor.mapper.PatMaternityArchiveMapper; |
| | | import com.smartor.service.IPatMaternityArchiveDetailService; |
| | | import com.smartor.service.IPatMaternityArchiveService; |
| | | import com.smartor.service.mch.IMchFollowupPlanService; |
| | | import com.smartor.service.mch.IMchFollowupSubtaskService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | private PatMaternityArchiveDetailMapper patMaternityArchiveDetailMapper; |
| | | |
| | | @Autowired |
| | | private IMchFollowupPlanService mchFollowupPlanService; |
| | | private IMchFollowupSubtaskService mchFollowupSubtaskService; |
| | | |
| | | @Override |
| | | public PatMaternityArchive selectPatMaternityArchiveById(Long id) |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int insertOrUpdateMaternityArchive(PatMaternityArchiveDetail patMaternityArchiveDetail) { |
| | | return insertOrUpdateMaternityArchive(patMaternityArchiveDetail, true); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int insertOrUpdateMaternityArchive(PatMaternityArchiveDetail patMaternityArchiveDetail, |
| | | boolean confirmFollowup) { |
| | | if (patMaternityArchiveDetail == null) { |
| | | log.error("insertOrUpdateMaternityArchiveå
¥å为空ï¼è¯·æ£æ¥å
¥å"); |
| | | throw new BaseException("å¦ç§æ¡£æ¡å
¥å为空ï¼è¯·æ£æ¥å
¥å"); |
| | |
| | | |
| | | Long existArchiveId = null; |
| | | Long existDetailId = null; |
| | | PatMaternityArchiveDetail existingDetail = null; |
| | | if (CollectionUtils.isNotEmpty(olds)) { |
| | | existArchiveId = olds.get(0).getArchiveid(); |
| | | existDetailId = olds.get(0).getId(); |
| | | existingDetail = olds.get(0); |
| | | existArchiveId = existingDetail.getArchiveid(); |
| | | existDetailId = existingDetail.getId(); |
| | | } |
| | | |
| | | // 人工ä¿å/确认æ¶è¿å
¥é访ä¸ï¼HIS èªå¨å»ºæ¡£åªåå¾
确认ï¼ä¸çæé访计å |
| | | applyFollowupState(patMaternityArchiveDetail, existingDetail, confirmFollowup); |
| | | |
| | | // 详æ
没æ¥å°ï¼åå
åºæåæ ·é®æ¥ä¸»è¡¨ï¼é¿å
主表éå¤ |
| | | if (existArchiveId == null) { |
| | |
| | | patMaternityArchiveDetailService.insertPatMaternityArchiveDetail(patMaternityArchiveDetail); |
| | | } |
| | | |
| | | // å¦å¹¼é访计åï¼æ¡£æ¡æ°å¢/ä¿®æ¹åæ plannedFollowTime + followupPeriod é建 |
| | | // å¦å¹¼é访任å¡ï¼åªæäººå·¥ç¡®è®¤ï¼followup_status=1ï¼çæ¡£æ¡æçæ/é建 service_subtaskï¼ |
| | | // èªå¨å»ºæ¡£ä¸ºå¾
确认ï¼rebuildForArchive å
é¨ä¼ç´æ¥è·³è¿ã |
| | | try { |
| | | if (mchFollowupPlanService != null) { |
| | | mchFollowupPlanService.rebuildForArchive( |
| | | if (mchFollowupSubtaskService != null) { |
| | | mchFollowupSubtaskService.rebuildForArchive( |
| | | MchFollowupConstants.ARCHIVE_TYPE_MATERNITY, |
| | | patMaternityArchive.getId(), patMaternityArchiveDetail.getId()); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("å¦å¹¼é访计åé建失败ï¼archiveId={}ï¼detailId={}", |
| | | log.error("å¦å¹¼é访任å¡çæå¤±è´¥ï¼archiveId={}ï¼detailId={}", |
| | | patMaternityArchive.getId(), patMaternityArchiveDetail.getId(), e); |
| | | } |
| | | |
| | | log.info("insertOrUpdateMaternityArchiveå¤ç宿ï¼ä¸»è¡¨idï¼{}ï¼è¯¦æ
idï¼{}", patMaternityArchive.getId(), patMaternityArchiveDetail.getId()); |
| | | log.info("insertOrUpdateMaternityArchiveå¤ç宿ï¼ä¸»è¡¨idï¼{}ï¼è¯¦æ
idï¼{}ï¼éè®¿ç¶æï¼{}", |
| | | patMaternityArchive.getId(), patMaternityArchiveDetail.getId(), |
| | | patMaternityArchiveDetail.getFollowupStatus()); |
| | | return patMaternityArchive.getId().intValue(); |
| | | } |
| | | |
| | | /** |
| | | * å¤çæ¡£æ¡éè®¿ç¶æã |
| | | * |
| | | * <p>人工ä¿å/ç¡®è®¤ï¼æ¡£æ¡è¿å
¥é访ä¸ï¼å¹¶è®°å½é¦æ¬¡ç¡®è®¤æ¶é´/ç¡®è®¤äººï¼ |
| | | * HIS èªå¨å»ºæ¡£ï¼æ°æ¡£æ¡è¿å
¥å¾
ç¡®è®¤ï¼æ´æ°æ¶ä¸æ¹å¨å·²æç¶æï¼ä¹ä¸è¦ç人工维æ¤ç |
| | | * plannedFollowTime / followupPeriod / followupCycleTimesã</p> |
| | | */ |
| | | private void applyFollowupState(PatMaternityArchiveDetail detail, |
| | | PatMaternityArchiveDetail existing, |
| | | boolean confirmFollowup) { |
| | | if (confirmFollowup) { |
| | | boolean alreadyActive = existing != null |
| | | && MchFollowupConstants.FOLLOWUP_STATUS_ACTIVE.equals(existing.getFollowupStatus()) |
| | | && existing.getFollowupConfirmTime() != null; |
| | | detail.setFollowupStatus(MchFollowupConstants.FOLLOWUP_STATUS_ACTIVE); |
| | | if (alreadyActive) { |
| | | // 已确认è¿çæ¡£æ¡éå¤ä¿åæ¶ï¼ä¿ç馿¬¡ç¡®è®¤æ¶é´/确认人 |
| | | detail.setFollowupConfirmTime(null); |
| | | detail.setFollowupConfirmBy(null); |
| | | } else { |
| | | detail.setFollowupConfirmTime(DateUtils.getNowDate()); |
| | | String confirmBy = detail.getUpdateBy(); |
| | | if (StringUtils.isEmpty(confirmBy)) { |
| | | confirmBy = detail.getCreateBy(); |
| | | } |
| | | detail.setFollowupConfirmBy(confirmBy); |
| | | } |
| | | return; |
| | | } |
| | | |
| | | // HIS èªå¨å»ºæ¡£ï¼æ°å¢åªè¿å
¥å¾
确认ï¼ä¸çæè®¡å |
| | | if (existing == null) { |
| | | detail.setFollowupStatus(MchFollowupConstants.FOLLOWUP_STATUS_PENDING); |
| | | detail.setFollowupConfirmTime(null); |
| | | detail.setFollowupConfirmBy(null); |
| | | return; |
| | | } |
| | | |
| | | // æ´æ°æ¶ä¿æåç¶æï¼é¿å
HIS é夿¨éæå·²ç¡®è®¤æ¡£æ¡éåå¾
确认 |
| | | detail.setFollowupStatus(null); |
| | | detail.setFollowupConfirmTime(null); |
| | | detail.setFollowupConfirmBy(null); |
| | | // 已确认/åå²å·²çææ¡£æ¡çéè®¿æ¥æä¸å¨æç±äººå·¥ç»´æ¤ï¼HIS 忥ä¸è¦ç |
| | | if (StringUtils.isEmpty(existing.getFollowupStatus()) |
| | | || MchFollowupConstants.FOLLOWUP_STATUS_ACTIVE.equals(existing.getFollowupStatus())) { |
| | | detail.setPlannedFollowTime(null); |
| | | detail.setFollowupPeriod(null); |
| | | detail.setFollowupCycleTimes(null); |
| | | } |
| | | } |
| | | } |
| | |
| | | if (SpecificArchiveConstants.DEPT_CATEGORY_GYNECOLOGY.equals(deptCategory)) { |
| | | PatMaternityArchiveDetail detail = |
| | | buildMaternityDetail(patMedOuthosp, targetArchive, config, campusid); |
| | | patMaternityArchiveService.insertOrUpdateMaternityArchive(detail); |
| | | // æ¥è¯å®æèªå¨å»ºæ¡£ï¼åªå»ºè稿ï¼ç人工ä¿åæ¡£æ¡ååçæé访计å |
| | | patMaternityArchiveService.insertOrUpdateMaternityArchive(detail, false); |
| | | generatedCount++; |
| | | } else if (SpecificArchiveConstants.DEPT_CATEGORY_PEDIATRICS.equals(deptCategory)) { |
| | | PatChildArchiveDetail detail = |
| | | buildChildDetail(patMedOuthosp, targetArchive, config, campusid); |
| | | patChildArchiveService.insertOrUpdateChildArchive(detail); |
| | | // æ¥è¯å®æèªå¨å»ºæ¡£ï¼åªå»ºè稿ï¼ç人工ä¿åæ¡£æ¡ååçæé访计å |
| | | patChildArchiveService.insertOrUpdateChildArchive(detail, false); |
| | | generatedCount++; |
| | | } else { |
| | | log.warn("çæä¸ç§æ¡£æ¡è·³è¿ï¼æªç¥é¨é¨åç±»ï¼configId={}ï¼deptCategory={}", |
| | |
| | | Long archiveId; |
| | | if (SpecificArchiveConstants.DEPT_CATEGORY_GYNECOLOGY.equals(deptCategory)) { |
| | | PatMaternityArchiveDetail detail = buildInhospMaternityDetail(context, config); |
| | | archiveId = (long) patMaternityArchiveService.insertOrUpdateMaternityArchive(detail); |
| | | // ä½é¢éè®¿å®æèªå¨å»ºæ¡£ï¼åªå»ºè稿ï¼ç人工ä¿åæ¡£æ¡ååçæé访计å |
| | | archiveId = (long) patMaternityArchiveService.insertOrUpdateMaternityArchive(detail, false); |
| | | } else if (SpecificArchiveConstants.DEPT_CATEGORY_PEDIATRICS.equals(deptCategory)) { |
| | | PatChildArchiveDetail detail = buildInhospChildDetail(context, config); |
| | | archiveId = (long) patChildArchiveService.insertOrUpdateChildArchive(detail); |
| | | // ä½é¢éè®¿å®æèªå¨å»ºæ¡£ï¼åªå»ºè稿ï¼ç人工ä¿åæ¡£æ¡ååçæé访计å |
| | | archiveId = (long) patChildArchiveService.insertOrUpdateChildArchive(detail, false); |
| | | } else { |
| | | log.warn("ä½é¢é访çæä¸ç§æ¡£æ¡è·³è¿ï¼æªç¥é¨é¨åç±»ï¼configId={}ï¼deptCategory={}", |
| | | config.getId(), deptCategory); |
| | |
| | | import com.ruoyi.common.utils.sms.SmsUtils; |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | import com.smartor.common.MchFollowupConstants; |
| | | import com.smartor.domain.MchFollowupPlan; |
| | | import com.smartor.domain.MchFollowupPlanItem; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | * |
| | | * <p>çä¿¡å¤ç¨ {@link SmsUtils#sendYunMasSms}ï¼å¾®ä¿¡å¤ç¨ |
| | | * {@link SmsUtils#sendChatLs}ï¼å³ {@code /sms/sendChatFuyou} çå
é¨å®ç°ï¼ã |
| | | * ä¸ç»è¿æ®éé访çå鿹工åä¸è¡¥å¿é¾è·¯ã</p> |
| | | * åéä¸ä¸æç± service_subtask + mch_node_json ç»è£
ã</p> |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | |
| | | @Autowired |
| | | private ISysConfigService configService; |
| | | |
| | | public MchFollowupSendOutcome sendSms(MchFollowupPlan plan, MchFollowupPlanItem item) { |
| | | String phone = plan == null ? null : plan.getPhone(); |
| | | String content = item == null ? null : renderContent(item.getContent(), plan, item); |
| | | public MchFollowupSendOutcome sendSms(MchFollowupSendContext context) { |
| | | String phone = context == null ? null : context.getPhone(); |
| | | String content = context == null ? null : renderContent(context.getContent(), context); |
| | | if (StringUtils.isBlank(phone)) { |
| | | return MchFollowupSendOutcome.skip("ææºå·ä¸ºç©º"); |
| | | } |
| | |
| | | } |
| | | try { |
| | | String configJson = configService.selectConfigByKey( |
| | | MchFollowupConstants.CONFIG_YUNMAS, plan.getOrgid()); |
| | | MchFollowupConstants.CONFIG_YUNMAS, context.getOrgid()); |
| | | SmsUtils.YunMasConfig config = SmsUtils.YunMasConfig.of(configJson); |
| | | SmsUtils.SmsResult result = SmsUtils.sendYunMasSms(config, phone, content); |
| | | String requestBody = requestSummary("sms", phone, null); |
| | |
| | | String message = result == null ? "äºMASè¿å为空" : result.getMessage(); |
| | | return MchFollowupSendOutcome.fail(message, requestBody, responseBody); |
| | | } catch (Exception e) { |
| | | log.error("ãå¦å¹¼é访ãçä¿¡åéå¼å¸¸ï¼planId={}ï¼itemId={}", plan.getId(), item.getId(), e); |
| | | log.error("ãå¦å¹¼é访ãçä¿¡åéå¼å¸¸ï¼subtaskId={}", context == null ? null : context.getSeq(), e); |
| | | return MchFollowupSendOutcome.fail("çä¿¡åéå¼å¸¸ï¼" + e.getMessage(), |
| | | requestSummary("sms", phone, null), null); |
| | | } |
| | | } |
| | | |
| | | public MchFollowupSendOutcome sendWechat(MchFollowupPlan plan, MchFollowupPlanItem item) { |
| | | String phone = plan == null ? null : plan.getPhone(); |
| | | if (StringUtils.isBlank(phone) && StringUtils.isBlank(plan == null ? null : plan.getIdcardno())) { |
| | | public MchFollowupSendOutcome sendWechat(MchFollowupSendContext context) { |
| | | String phone = context == null ? null : context.getPhone(); |
| | | if (context == null || (StringUtils.isBlank(phone) && StringUtils.isBlank(context.getIdcardno()))) { |
| | | return MchFollowupSendOutcome.skip("ææºå·åè¯ä»¶å·é½ä¸ºç©º"); |
| | | } |
| | | try { |
| | | String configJson = configService.selectConfigByKey( |
| | | MchFollowupConstants.CONFIG_LS_WX, plan.getOrgid()); |
| | | MchFollowupConstants.CONFIG_LS_WX, context.getOrgid()); |
| | | SmsUtils.LsWxConfig config = SmsUtils.LsWxConfig.of(configJson); |
| | | |
| | | SmsUtils.LsWxMessage message = new SmsUtils.LsWxMessage(); |
| | | message.setId(item.getTemplateId()); |
| | | message.setPatientId(plan.getPatid() == null ? null : String.valueOf(plan.getPatid())); |
| | | message.setPatientName(plan.getPatname()); |
| | | message.setIdCard(plan.getIdcardno()); |
| | | message.setId(context.getTemplateId()); |
| | | message.setPatientId(context.getPatid() == null ? null : String.valueOf(context.getPatid())); |
| | | message.setPatientName(context.getPatname()); |
| | | message.setIdCard(context.getIdcardno()); |
| | | message.setMobile(phone); |
| | | message.setMedCardNo(plan.getSourceBizNo()); |
| | | message.setTitleName(renderContent(item.getTitleName(), plan, item)); |
| | | message.setContent(renderContent(item.getContent(), plan, item)); |
| | | message.setUrl(item.getUrl()); |
| | | message.setMedCardNo(context.getSourceBizNo()); |
| | | message.setTitleName(renderContent(context.getTitleName(), context)); |
| | | message.setContent(renderContent(context.getContent(), context)); |
| | | message.setUrl(context.getUrl()); |
| | | |
| | | String requestBody = requestSummary("wechat", phone, item.getTemplateId()); |
| | | String requestBody = requestSummary("wechat", phone, context.getTemplateId()); |
| | | String resp = SmsUtils.sendChatLs(config, message); |
| | | String messageText = parseWechatMessage(resp); |
| | | boolean ok = parseWechatOk(resp); |
| | |
| | | } |
| | | return MchFollowupSendOutcome.fail(messageText, requestBody, resp); |
| | | } catch (Exception e) { |
| | | log.error("ãå¦å¹¼é访ã微信åéå¼å¸¸ï¼planId={}ï¼itemId={}", plan.getId(), item.getId(), e); |
| | | log.error("ãå¦å¹¼é访ã微信åéå¼å¸¸ï¼subtaskSeq={}", context == null ? null : context.getSeq(), e); |
| | | return MchFollowupSendOutcome.fail("微信åéå¼å¸¸ï¼" + e.getMessage(), |
| | | requestSummary("wechat", phone, item == null ? null : item.getTemplateId()), null); |
| | | requestSummary("wechat", phone, context == null ? null : context.getTemplateId()), null); |
| | | } |
| | | } |
| | | |
| | |
| | | * ${patname}ã${patid}ã${phone}ã${idcardno}ã${plannedFollowTime}ã |
| | | * ${sourceBizNo}ã${archiveType}ã${orgid}ã${seq}ã |
| | | */ |
| | | String renderContent(String text, MchFollowupPlan plan, MchFollowupPlanItem item) { |
| | | if (StringUtils.isBlank(text) || plan == null) { |
| | | String renderContent(String text, MchFollowupSendContext context) { |
| | | if (StringUtils.isBlank(text) || context == null) { |
| | | return text; |
| | | } |
| | | String result = text; |
| | | result = result.replace("${patname}", nvl(plan.getPatname())); |
| | | result = result.replace("${patid}", plan.getPatid() == null ? "" : String.valueOf(plan.getPatid())); |
| | | result = result.replace("${phone}", nvl(plan.getPhone())); |
| | | result = result.replace("${idcardno}", nvl(plan.getIdcardno())); |
| | | result = result.replace("${sourceBizNo}", nvl(plan.getSourceBizNo())); |
| | | result = result.replace("${archiveType}", nvl(plan.getArchiveType())); |
| | | result = result.replace("${orgid}", nvl(plan.getOrgid())); |
| | | result = result.replace("${seq}", item == null || item.getSeq() == null ? "" : String.valueOf(item.getSeq())); |
| | | if (plan.getPlannedFollowTime() != null) { |
| | | result = result.replace("${patname}", nvl(context.getPatname())); |
| | | result = result.replace("${patid}", context.getPatid() == null ? "" : String.valueOf(context.getPatid())); |
| | | result = result.replace("${phone}", nvl(context.getPhone())); |
| | | result = result.replace("${idcardno}", nvl(context.getIdcardno())); |
| | | result = result.replace("${sourceBizNo}", nvl(context.getSourceBizNo())); |
| | | result = result.replace("${archiveType}", nvl(context.getArchiveType())); |
| | | result = result.replace("${orgid}", nvl(context.getOrgid())); |
| | | result = result.replace("${seq}", context.getSeq() == null ? "" : String.valueOf(context.getSeq())); |
| | | if (context.getPlannedFollowTime() != null) { |
| | | result = result.replace("${plannedFollowTime}", |
| | | new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(plan.getPlannedFollowTime())); |
| | | new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(context.getPlannedFollowTime())); |
| | | } else { |
| | | result = result.replace("${plannedFollowTime}", ""); |
| | | } |
| | |
| | | <result property="hrcNeurologicalEvaluation" column="hrc_neurological_evaluation"/> |
| | | <result property="hrcInterventionRecords" column="hrc_intervention_records"/> |
| | | <result property="closeStatus" column="close_status"/> |
| | | <result property="followupStatus" column="followup_status"/> |
| | | <result property="followupConfirmTime" column="followup_confirm_time"/> |
| | | <result property="followupConfirmBy" column="followup_confirm_by"/> |
| | | <result property="gestationalWeek" column="gestational_week"/> |
| | | <result property="birthWeight" column="birth_weight"/> |
| | | <result property="registerUser" column="register_user"/> |
| | |
| | | hrc_neurological_evaluation, |
| | | hrc_intervention_records, |
| | | close_status, |
| | | followup_status, |
| | | followup_confirm_time, |
| | | followup_confirm_by, |
| | | gestational_week, |
| | | birth_weight, |
| | | register_user, |
| | |
| | | <if test="highRiskChildType != null and highRiskChildType != ''">and high_risk_child_type = #{highRiskChildType}</if> |
| | | <if test="highRiskChildName != null and highRiskChildName != ''">and high_risk_child_name like concat('%', #{highRiskChildName}, '%')</if> |
| | | <if test="closeStatus != null and closeStatus != ''">and close_status = #{closeStatus}</if> |
| | | <if test="followupStatus != null and followupStatus != ''">and followup_status = #{followupStatus}</if> |
| | | <if test="gestationalWeek != null">and gestational_week = #{gestationalWeek}</if> |
| | | <if test="birthWeight != null">and birth_weight = #{birthWeight}</if> |
| | | <if test="registerUser != null and registerUser != ''">and register_user = #{registerUser}</if> |
| | |
| | | <if test="hrcNeurologicalEvaluation != null">hrc_neurological_evaluation,</if> |
| | | <if test="hrcInterventionRecords != null">hrc_intervention_records,</if> |
| | | <if test="closeStatus != null">close_status,</if> |
| | | <if test="followupStatus != null">followup_status,</if> |
| | | <if test="followupConfirmTime != null">followup_confirm_time,</if> |
| | | <if test="followupConfirmBy != null">followup_confirm_by,</if> |
| | | <if test="gestationalWeek != null">gestational_week,</if> |
| | | <if test="birthWeight != null">birth_weight,</if> |
| | | <if test="registerUser != null">register_user,</if> |
| | |
| | | <if test="hrcNeurologicalEvaluation != null">#{hrcNeurologicalEvaluation},</if> |
| | | <if test="hrcInterventionRecords != null">#{hrcInterventionRecords},</if> |
| | | <if test="closeStatus != null">#{closeStatus},</if> |
| | | <if test="followupStatus != null">#{followupStatus},</if> |
| | | <if test="followupConfirmTime != null">#{followupConfirmTime},</if> |
| | | <if test="followupConfirmBy != null">#{followupConfirmBy},</if> |
| | | <if test="gestationalWeek != null">#{gestationalWeek},</if> |
| | | <if test="birthWeight != null">#{birthWeight},</if> |
| | | <if test="registerUser != null">#{registerUser},</if> |
| | |
| | | <if test="hrcNeurologicalEvaluation != null">hrc_neurological_evaluation = #{hrcNeurologicalEvaluation},</if> |
| | | <if test="hrcInterventionRecords != null">hrc_intervention_records = #{hrcInterventionRecords},</if> |
| | | <if test="closeStatus != null">close_status = #{closeStatus},</if> |
| | | <if test="followupStatus != null">followup_status = #{followupStatus},</if> |
| | | <if test="followupConfirmTime != null">followup_confirm_time = #{followupConfirmTime},</if> |
| | | <if test="followupConfirmBy != null">followup_confirm_by = #{followupConfirmBy},</if> |
| | | <if test="gestationalWeek != null">gestational_week = #{gestationalWeek},</if> |
| | | <if test="birthWeight != null">birth_weight = #{birthWeight},</if> |
| | | <if test="registerUser != null">register_user = #{registerUser},</if> |
| | |
| | | <result property="specificSituation" column="specific_situation"/> |
| | | <result property="handleSuggestion" column="handle_suggestion"/> |
| | | <result property="closeStatus" column="close_status"/> |
| | | <result property="followupStatus" column="followup_status"/> |
| | | <result property="followupConfirmTime" column="followup_confirm_time"/> |
| | | <result property="followupConfirmBy" column="followup_confirm_by"/> |
| | | <result property="isRecordEstablished" column="is_record_established"/> |
| | | <result property="dueDate" column="due_date"/> |
| | | <result property="registerUser" column="register_user"/> |
| | |
| | | specific_situation, |
| | | handle_suggestion, |
| | | close_status, |
| | | followup_status, |
| | | followup_confirm_time, |
| | | followup_confirm_by, |
| | | is_record_established, |
| | | due_date, |
| | | register_user, |
| | |
| | | <if test="icd10code != null and icd10code != ''">and icd10code = #{icd10code}</if> |
| | | <if test="diagname != null and diagname != ''">and diagname like concat('%', #{diagname}, '%')</if> |
| | | <if test="closeStatus != null and closeStatus != ''">and close_status = #{closeStatus}</if> |
| | | <if test="followupStatus != null and followupStatus != ''">and followup_status = #{followupStatus}</if> |
| | | <if test="isRecordEstablished != null and isRecordEstablished != ''">and is_record_established = #{isRecordEstablished}</if> |
| | | <if test="registerUser != null and registerUser != ''">and register_user = #{registerUser}</if> |
| | | <if test="orgid != null and orgid != ''">and orgid = #{orgid}</if> |
| | |
| | | <if test="specificSituation != null">specific_situation,</if> |
| | | <if test="handleSuggestion != null">handle_suggestion,</if> |
| | | <if test="closeStatus != null">close_status,</if> |
| | | <if test="followupStatus != null">followup_status,</if> |
| | | <if test="followupConfirmTime != null">followup_confirm_time,</if> |
| | | <if test="followupConfirmBy != null">followup_confirm_by,</if> |
| | | <if test="isRecordEstablished != null">is_record_established,</if> |
| | | <if test="dueDate != null">due_date,</if> |
| | | <if test="registerUser != null">register_user,</if> |
| | |
| | | <if test="specificSituation != null">#{specificSituation},</if> |
| | | <if test="handleSuggestion != null">#{handleSuggestion},</if> |
| | | <if test="closeStatus != null">#{closeStatus},</if> |
| | | <if test="followupStatus != null">#{followupStatus},</if> |
| | | <if test="followupConfirmTime != null">#{followupConfirmTime},</if> |
| | | <if test="followupConfirmBy != null">#{followupConfirmBy},</if> |
| | | <if test="isRecordEstablished != null">#{isRecordEstablished},</if> |
| | | <if test="dueDate != null">#{dueDate},</if> |
| | | <if test="registerUser != null">#{registerUser},</if> |
| | |
| | | <if test="specificSituation != null">specific_situation = #{specificSituation},</if> |
| | | <if test="handleSuggestion != null">handle_suggestion = #{handleSuggestion},</if> |
| | | <if test="closeStatus != null">close_status = #{closeStatus},</if> |
| | | <if test="followupStatus != null">followup_status = #{followupStatus},</if> |
| | | <if test="followupConfirmTime != null">followup_confirm_time = #{followupConfirmTime},</if> |
| | | <if test="followupConfirmBy != null">followup_confirm_by = #{followupConfirmBy},</if> |
| | | <if test="isRecordEstablished != null">is_record_established = #{isRecordEstablished},</if> |
| | | <if test="dueDate != null">due_date = #{dueDate},</if> |
| | | <if test="registerUser != null">register_user = #{registerUser},</if> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | -- ============================================================================= |
| | | -- å¦å¹¼æ¡£æ¡éè®¿ç¶æï¼æ¥è¯å®æèªå¨å»ºæ¡£åªåå¾
确认ï¼äººå·¥ä¿åååçæéè®¿ä»»å¡ |
| | | -- æ¥æï¼2026-11-23 |
| | | -- éç¨ï¼ä¸½æ°´å¸å¦å¹¼ä¿å¥é¢å¦å¹¼ä¸ç§æ¡£æ¡ï¼å¦ä¿/å¿ä¿ï¼ |
| | | -- 说æï¼ |
| | | -- 1. followup_status=0 å¾
确认ï¼é¨è¯æ¥è¯/ä½é¢é访èªå¨å»ºæ¡£ï¼ä¸çæ service_subtaskï¼ |
| | | -- 2. followup_status=1 é访ä¸ï¼äººå·¥ä¿åæ¡£æ¡ååå
¥ï¼å
许çæ/é建 service_subtaskï¼ |
| | | -- 3. åéæ°æ®ä¸å·²ææé访æ¶é´åéè®¿å¨æçæ¡£æ¡å填为 1ï¼ä¿æåæåéè¡ä¸ºã |
| | | -- ============================================================================= |
| | | |
| | | ALTER TABLE pat_maternity_archive_detail |
| | | ADD COLUMN followup_status CHAR(1) NOT NULL DEFAULT '0' |
| | | COMMENT 'éè®¿ç¶æï¼0å¾
确认 1é访ä¸' AFTER close_status, |
| | | ADD COLUMN followup_confirm_time DATETIME NULL |
| | | COMMENT 'é访确认æ¶é´' AFTER followup_status, |
| | | ADD COLUMN followup_confirm_by VARCHAR(64) NULL |
| | | COMMENT 'é访确认人' AFTER followup_confirm_time; |
| | | |
| | | ALTER TABLE pat_child_archive_detail |
| | | ADD COLUMN followup_status CHAR(1) NOT NULL DEFAULT '0' |
| | | COMMENT 'éè®¿ç¶æï¼0å¾
确认 1é访ä¸' AFTER close_status, |
| | | ADD COLUMN followup_confirm_time DATETIME NULL |
| | | COMMENT 'é访确认æ¶é´' AFTER followup_status, |
| | | ADD COLUMN followup_confirm_by VARCHAR(64) NULL |
| | | COMMENT 'é访确认人' AFTER followup_confirm_time; |
| | | |
| | | -- åéåå¡«ï¼å·²ææéè®¿æ¥æåéè®¿å¨æçæ¡£æ¡ç»§ç»æåé»è¾çæ/åéã |
| | | -- 确认æ¶é´/确认人ä¸åå¡«ï¼é¿å
æè¿ç§»æ¶é´è¯¯å½æäººå·¥ç¡®è®¤æ¶é´ã |
| | | UPDATE pat_maternity_archive_detail |
| | | SET followup_status = '1' |
| | | WHERE followup_status = '0' |
| | | AND planned_follow_time IS NOT NULL |
| | | AND followup_period IS NOT NULL |
| | | AND followup_period <> ''; |
| | | |
| | | UPDATE pat_child_archive_detail |
| | | SET followup_status = '1' |
| | | WHERE followup_status = '0' |
| | | AND planned_follow_time IS NOT NULL |
| | | AND followup_period IS NOT NULL |
| | | AND followup_period <> ''; |
| | | |
| | | -- è¡¥å»ºæ«æä¸åè¡¨è¿æ»¤ |
| | | ALTER TABLE pat_maternity_archive_detail |
| | | ADD INDEX idx_maternity_followup_status (orgid, followup_status); |
| | | |
| | | ALTER TABLE pat_child_archive_detail |
| | | ADD INDEX idx_child_followup_status (orgid, followup_status); |