liusheng
2024-12-04 1ccb709f723a759597dcdc7239d8885cef84d3ce
代码提交
已添加6个文件
已修改5个文件
731 ■■■■■ 文件已修改
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServicePatientTempController.java 109 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/resources/application-druid.yml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java 145 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/ServicePatientTemp.java 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/ThiedInhospInfo.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/mapper/ServicePatientTempMapper.java 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/IServicePatientTempService.java 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/PatMedInhospServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/ServicePatientTempServiceImpl.java 96 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/ServicePatientTempMapper.xml 158 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServicePatientTempController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,109 @@
package com.ruoyi.web.controller.smartor;
import java.util.List;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.smartor.domain.ServicePatientTemp;
import com.smartor.service.IServicePatientTempService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
 * ã€æ‚£è€…模板关联】Controller
 *
 * @author lihu
 * @date 2024-12-03
 */
@Api("患者模板关联")
@RestController
@RequestMapping("/smartor/tempxch")
public class ServicePatientTempController extends BaseController {
    @Autowired
    private IServicePatientTempService servicePatientTempService;
    /**
     * æŸ¥è¯¢ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘åˆ—è¡¨
     */
    @ApiOperation("查询【请填写功能名称】列表")
    //@PreAuthorize("@ss.hasPermi('smartor:temp:list')")
    @GetMapping("/list")
    public TableDataInfo list(ServicePatientTemp servicePatientTemp) {
        startPage();
        List<ServicePatientTemp> list = servicePatientTempService.selectServicePatientTempList(servicePatientTemp);
        return getDataTable(list);
    }
    /**
     * å¯¼å‡ºã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘åˆ—è¡¨
     */
    @ApiOperation("导出【请填写功能名称】列表")
    //@PreAuthorize("@ss.hasPermi('smartor:temp:export')")
    @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, ServicePatientTemp servicePatientTemp) {
        List<ServicePatientTemp> list = servicePatientTempService.selectServicePatientTempList(servicePatientTemp);
        ExcelUtil<ServicePatientTemp> util = new ExcelUtil<ServicePatientTemp>(ServicePatientTemp.class);
        util.exportExcel(response, list, "【请填写功能名称】数据");
    }
    /**
     * èŽ·å–ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘è¯¦ç»†ä¿¡æ¯
     */
    @ApiOperation("获取【请填写功能名称】详细信息")
    //@PreAuthorize("@ss.hasPermi('smartor:temp:query')")
    @GetMapping(value = "/getInfo/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id) {
        return success(servicePatientTempService.selectServicePatientTempById(id));
    }
    /**
     * æ–°å¢žã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     */
    @ApiOperation("新增【请填写功能名称】")
    //@PreAuthorize("@ss.hasPermi('smartor:temp:add')")
    @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
    @PostMapping("/add")
    public AjaxResult add(@RequestBody ServicePatientTemp servicePatientTemp) {
        return toAjax(servicePatientTempService.insertServicePatientTemp(servicePatientTemp));
    }
    /**
     * ä¿®æ”¹ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     */
    @ApiOperation("修改【请填写功能名称】")
    //@PreAuthorize("@ss.hasPermi('smartor:temp:edit')")
    @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
    @PostMapping("/edit")
    public AjaxResult edit(@RequestBody ServicePatientTemp servicePatientTemp) {
        return toAjax(servicePatientTempService.updateServicePatientTemp(servicePatientTemp));
    }
    /**
     * åˆ é™¤ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     */
    @ApiOperation("删除【请填写功能名称】")
    //@PreAuthorize("@ss.hasPermi('smartor:temp:remove')")
    @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
    @GetMapping("/remove/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids) {
        return toAjax(servicePatientTempService.deleteServicePatientTempByIds(ids));
    }
}
ruoyi-admin/src/main/resources/application-druid.yml
@@ -170,9 +170,9 @@
app_key_yq: ZurNHpaQLq6P55YS
#本 åœ° çŸ­ä¿¡è¯·æ±‚地址(这个服务是我们自己写的)
#xhsmsPath: http://192.168.2.13:8092/sendSms
xhsmsPath: http://192.168.2.13:8092/sendSms
#新华短信请求地址(这个服务是我们自己写的)
xhsmsPath: http://192.16.4.220:8092/sendSms
#xhsmsPath: http://192.16.4.220:8092/sendSms
#帐号
xhsmsAccount: 911124
#接口密码
ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml
@@ -60,7 +60,6 @@
    <select id="selectGenTableList" parameterType="GenTable" resultMap="GenTableResult">
        <include refid="selectGenTableVo"/>
        <where>
            del_flag= 0
            <if test="tableName != null and tableName != ''">
                AND lower(table_name) like lower(concat('%', #{tableName}, '%'))
            </if>
@@ -116,7 +115,7 @@
               c.column_id, c.column_name, c.column_comment, c.column_type, c.java_type, c.java_field, c.is_pk, c.is_increment, c.is_required, c.is_insert, c.is_edit, c.is_list, c.is_query, c.query_type, c.html_type, c.dict_type, c.sort
        FROM gen_table t
             LEFT JOIN gen_table_column c ON t.table_id = c.table_id
        where del_flag= 0 and t.table_id = #{tableId} order by c.sort
        where  t.table_id = #{tableId} order by c.sort
    </select>
    <select id="selectGenTableByName" parameterType="String" resultMap="GenTableResult">
@@ -190,7 +189,7 @@
            <if test="remark != null">remark = #{remark},</if>
            update_time = sysdate()
        </set>
        where table_id = #{tableId} and del_flag= 0
        where table_id = #{tableId}
    </update>
    <delete id="deleteGenTableByIds" parameterType="Long">
ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java
@@ -24,6 +24,7 @@
import com.smartor.service.*;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
@@ -43,6 +44,7 @@
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.*;
@@ -69,6 +71,9 @@
    @Autowired
    private IServiceSubtaskService iServiceSubtaskService;
    @Autowired
    private IServicePatientTempService iServicePatientTempService;
    @Autowired
    private PlatformTransactionManager transactionManager;
@@ -117,6 +122,9 @@
    @Autowired
    ISvyTaskTemplateService svyTaskTemplateService;
    @Autowired
    IIvrTaskTemplateService iIvrTaskTemplateService;
    @Value("${hosp_info_url}")
    private String hospInfoUrl;
@@ -187,8 +195,13 @@
        //将患者信息、出院、门诊数据全部采集
        // èŽ·å–å½“å‰æ—¥æœŸå’Œæ—¶é—´
        LocalDateTime endTime = LocalDateTime.now();
        endTime = endTime.with(LocalTime.MIN);
//        String dateStr = "2024/11/30 00:00:00";
//        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss");
//        LocalDateTime endTime = LocalDateTime.parse(dateStr, formatter);
        // èŽ·å–å‰ä¸€å¤©çš„æ—¥æœŸå’Œæ—¶é—´
        LocalDateTime startTime = endTime.minusDays(1);
        startTime = startTime.with(LocalTime.MIN);
        getInHospInfo("0", startTime, endTime);
        getInHospInfo("1", startTime, endTime);
@@ -224,8 +237,102 @@
        iPatMedInhospService.dealOutHospInfo();
    }
//    /**
//     * å¤„理患者信息,进入子任务表(微信小程序)
//     */
//    public void dealOutHospInfoXHC() {
//        PatMedInhosp patMedInhosp = new PatMedInhosp();
//        //获取未处理的数据
//        List<ServicePatientTemp> servicePatientTemps = iServicePatientTempService.selectServicePatientTempList(new ServicePatientTemp());
//
//        for (ServicePatientTemp servicePatientTemp : servicePatientTemps) {
//            Long tid = null;
//            if (servicePatientTemp.getType() != null && servicePatientTemp.getType() == 1) {
//                IvrTaskTemplate ivrTaskTemplate = iIvrTaskTemplateService.selectIvrTaskTemplateByID(servicePatientTemp.getTempId());
//                tid = ivrTaskTemplate.getTaskid();
//            } else if (servicePatientTemp.getType() != null && servicePatientTemp.getType() == 2) {
//                SvyTaskTemplate svyTaskTemplate = svyTaskTemplateService.selectSvyTaskTemplateBySvyid(servicePatientTemp.getTempId());
//                tid = svyTaskTemplate.getTaskid();
//            }
//
//            ServiceTask serviceTask = serviceTaskMapper.selectServiceTaskByTaskid(tid);
//            ServiceSubtask serviceSubtask = DtoConversionUtils.sourceToTarget(serviceTask, ServiceSubtask.class);
//            serviceSubtask.setTaskid(serviceTask.getTaskid());
//            serviceSubtask.setTemplateid(servicePatientTemp.getTempId());
//            serviceSubtask.setTemplatename(stt.getTemplateName());
//            serviceSubtask.setPatid(patArchive.getId());
//            serviceSubtask.setSendname(patArchive.getName());
//            serviceSubtask.setSfzh(patArchive.getIdcardno());
//            serviceSubtask.setPhone(patArchive.getTelcode());
//            serviceSubtask.setSex(patArchive.getSex());
//            serviceSubtask.setAge(patArchive.getAge());
//            serviceSubtask.setSendstate(2L);
//            serviceSubtask.setStarttime(patMedInhosp1.getStarttime());
//            serviceSubtask.setEndtime(patMedInhosp1.getEndtime());
//            serviceSubtask.setServiceType("2");
//            serviceSubtask.setPreachform(serviceTask.getPreachform());
//            serviceSubtask.setHospType("2");
//            serviceSubtask.setCreateTime(new Date());
//            serviceSubtask.setUpdateTime(new Date());
//            serviceSubtask.setCreateBy(patMedInhosp1.getNurseName());
//            serviceSubtask.setLeavehospitaldistrictcode(patMedInhosp1.getLeavehospitaldistrictcode());
//            serviceSubtask.setLeavehospitaldistrictname(patMedInhosp1.getLeavehospitaldistrictname());
//            //设置发送时间
//            Date newDate = addDays(patMedInhosp1.getEndtime(), stt.getSendDay());
//            serviceSubtask.setLongSendTime(newDate);
//            //患者发送时间
//            if (StringUtils.isNotEmpty(patArchive.getNotrequiredFlag()) && patArchive.getNotrequiredFlag().equals("1")) {
//                remark = patArchive.getNotrequiredreason();
//                serviceSubtask.setRemark(remark);
//                serviceSubtask.setResult("error");
//                serviceSubtask.setFinishtime(new Date());
//                //不执行
//                serviceSubtask.setSendstate(4L);
//            }
//
//            //在新增之前,先通过患者ID,sendstate=2查询一下,在所有长期任务中,是不是还有该患者待执行的任务,有的话,比较之前的endtime是否小于当前的endtaime,如果之前的小于现在的,则直接将之前的停掉(原因再入院)
//            ServiceSubtaskVO subtask = new ServiceSubtaskVO();
//            subtask.setPatid(patArchive.getId());
//            subtask.setSendstate(2L);
//            List<ServiceSubtask> selectServiceSubtaskList = serviceSubtaskMapper.selectServiceSubtaskList(subtask);
//            log.error("该患者待执行的任务:{}", selectServiceSubtaskList);
//            if (CollectionUtils.isNotEmpty(selectServiceSubtaskList) && selectServiceSubtaskList.size() > 0) {
//                for (ServiceSubtask serviceSubtask1 : selectServiceSubtaskList) {
//                    if (Objects.isNull(serviceSubtask1.getLongSendTime())) {
//                        //不是长期任务,不处理
//                        continue;
//                    }
//                    if (serviceSubtask1.getEndtime().before(serviceSubtask.getEndtime())) {
//                        //如果当前循环的子任务的出院时间在“准备新增的子任务”的出院时间之前,则将循环的子任务停掉
//                        serviceSubtask1.setSendstate(4L);
//                        serviceSubtask1.setRemark("患者再入院");
//                        serviceSubtask1.setResult("error");
//                        serviceSubtask1.setFinishtime(new Date());
//                        serviceSubtaskMapper.updateServiceSubtask(serviceSubtask1);
//                    } else {
//                        //相反,则将当有的数据停掉
//                        serviceSubtask.setResult("error");
//                        serviceSubtask.setFinishtime(new Date());
//                        serviceSubtask.setSendstate(4L);
//                        serviceSubtask.setRemark("患者再入院");
//                    }
//                }
//            }
//
//            serviceSubtaskMapper.insertServiceSubtask(serviceSubtask);
//            //将check_flag改成1(已处理)
//            PatMedInhosp patMedInhosp2 = new PatMedInhosp();
//            patMedInhosp2.setInhospid(patMedInhosp1.getInhospid());
//            patMedInhosp2.setCheckFlag("1");
//            patMedInhospMapper.updatePatMedInhosp(patMedInhosp2);
//        }
//
//        return 1;
//    }
    /**
     * é•¿æœŸä»»åŠ¡æ‰§è¡Œ
     * é•¿æœŸä»»åŠ¡æ‰§è¡Œï¼ˆç”µè¯ï¼‰
     */
    public void longTaskSend() {
        //获取任务信息
@@ -302,12 +409,12 @@
//                                serviceSubtask1.setTaskid(ivrTask.getTaskid());
//                                List<ServiceSubtask> selectServiceSubtaskList1 = iServiceSubtaskService.selectServiceSubtaskList(serviceSubtask1);
//                                for (ServiceSubtask serviceSubtask2 : selectServiceSubtaskList1) {
                                    if (StringUtils.isEmpty(value)) {
                                        value = "," + serviceSubtask.getId().toString() + ",";
                                    } else {
                                        if (!value.contains("," + serviceSubtask.getId().toString()))
                                            value = value + "," + serviceSubtask.getId().toString() + ",";
                                    }
                                if (StringUtils.isEmpty(value)) {
                                    value = "," + serviceSubtask.getId().toString() + ",";
                                } else {
                                    if (!value.contains("," + serviceSubtask.getId().toString()))
                                        value = value + "," + serviceSubtask.getId().toString() + ",";
                                }
//                                }
                            } catch (Exception e) {
                                String guid = UUID.randomUUID().toString();
@@ -355,6 +462,13 @@
                    //多媒体
                } else if (descByCode.equals("纸质")) {
                    //纸质
                } else if (descByCode.equals("微信小程序")) {
                    //微信小程序
                    for (ServiceSubtask serviceSubtask : selectServiceSubtaskList) {
                        log.error("微信小程序期任务发送---------进来了吗?{}", serviceSubtask);
                    }
                } else if (descByCode.equals("短信")) {
                    RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample();
                    String taskId = rsaPublicKeyExample.encryptedData(ivrTask1.getTaskid().toString(), pub_key);
@@ -507,8 +621,8 @@
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.S");
        Map<String, String> req = new HashMap<>();
        if (cry.equals("1")) {
            req.put("startTime", startTime.format(formatter));
            req.put("endTime", endTime.format(formatter));
            req.put("cashStartDate", startTime.format(formatter));
            req.put("cashEndDate", endTime.format(formatter));
            req.put("currStatus", "4");
        } else if (cry.equals("0")) {
            req.put("admissStartDate", startTime.format(formatter));
@@ -631,8 +745,8 @@
                    e.printStackTrace();
                }
                try {
                    if (StringUtils.isNotEmpty(thiedInhospInfo.getOutDate()))
                        patMedInhosp.setEndtime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(thiedInhospInfo.getOutDate()));
                    if (StringUtils.isNotEmpty(thiedInhospInfo.getCashDate()))
                        patMedInhosp.setEndtime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(thiedInhospInfo.getCashDate()));
                } catch (ParseException e) {
                    e.printStackTrace();
                }
@@ -667,8 +781,10 @@
                log.error("是否需要更新:{}", patMedInhosps.size());
                if (CollectionUtils.isNotEmpty(patMedInhosps)) {
                    patMedInhosp.setInhospid(patMedInhosps.get(0).getInhospid());
                    log.error("------患者出入院修改信息:{}",patMedInhosp);
                    patMedInhospService.updatePatMedInhosp(patMedInhosp);
                } else {
                    log.error("----患者出入院新增信息:{}",patMedInhosp);
                    patMedInhospService.insertPatMedInhosp(patMedInhosp);
                }
@@ -720,4 +836,11 @@
//        String code = (String) jsonObject.get("code");
        return jsonObject.toString();
    }
//    public static void main(String[] args) {
//        LocalDateTime originalDateTime = LocalDateTime.now();
//        LocalDateTime startOfDay = originalDateTime.with(LocalTime.MIN);
//        System.out.println("Original DateTime: " + originalDateTime);
//        System.out.println("Start of Day: " + startOfDay);
//    }
}
smartor/src/main/java/com/smartor/domain/ServicePatientTemp.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,81 @@
package com.smartor.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
 * ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘å¯¹è±¡ service_patient_temp
 *
 * @author lihu
 * @date 2024-12-03
 */
@Data
@ApiModel("【请填写功能名称】")
public class ServicePatientTemp extends BaseEntity {
    private static final long serialVersionUID = 1L;
    /**
     * $column.columnComment
     */
    @ApiModelProperty("$column.columnComment")
    //数据库自增改成@TableId(type = IdType.AUTO)
    private Long id;
    /**
     * æ‚£è€…ID
     */
    @ApiModelProperty("患者ID")
    @Excel(name = "患者ID")
    private Long userId;
    /**
     * æ¨¡æ¿ID
     */
    @ApiModelProperty("模板ID")
    @Excel(name = "模板ID")
    private Long tempId;
    /**
     * æ¨¡æ¿ç±»åž‹:    1:ivr    2:svy
     */
    @ApiModelProperty("模板类型:    1:ivr    2:svy")
    @Excel(name = "模板类型:    1:ivr    2:svy")
    private Integer type;
    /**
     * å¼€å§‹æ—¶é—´
     */
    @ApiModelProperty("开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date startTime;
    /**
     * ç»“束时间
     */
    @ApiModelProperty("结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date endTime;
    /**
     * é—´éš”天数
     */
    @ApiModelProperty("间隔天数")
    @Excel(name = "间隔天数")
    private Long dayNum;
    /**
     * 0未删除    1删除
     */
    @ApiModelProperty("0未删除    1删除")
    private String delFlag;
}
smartor/src/main/java/com/smartor/domain/ThiedInhospInfo.java
@@ -449,6 +449,13 @@
    private String preoutDate;
    /**
     * ç»“账日期
     */
    @ApiModelProperty("结账日期")
    @Excel(name = "结账日期")
    private String cashDate;
    /**
     * ç—…人出院日期
     */
    @ApiModelProperty("病人出院日期")
smartor/src/main/java/com/smartor/mapper/ServicePatientTempMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,63 @@
package com.smartor.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import com.smartor.domain.ServicePatientTemp;
/**
 * ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘Mapper接口
 *
 * @author lihu
 * @date 2024-12-03
 */
@Mapper
public interface ServicePatientTempMapper
{
    /**
     * æŸ¥è¯¢ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     *
     * @param id ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘ä¸»é”®
     * @return ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     */
    public ServicePatientTemp selectServicePatientTempById(Long id);
    /**
     * æŸ¥è¯¢ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘åˆ—è¡¨
     *
     * @param servicePatientTemp ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     * @return ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘é›†åˆ
     */
    public List<ServicePatientTemp> selectServicePatientTempList(ServicePatientTemp servicePatientTemp);
    /**
     * æ–°å¢žã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     *
     * @param servicePatientTemp ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     * @return ç»“æžœ
     */
    public int insertServicePatientTemp(ServicePatientTemp servicePatientTemp);
    /**
     * ä¿®æ”¹ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     *
     * @param servicePatientTemp ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     * @return ç»“æžœ
     */
    public int updateServicePatientTemp(ServicePatientTemp servicePatientTemp);
    /**
     * åˆ é™¤ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     *
     * @param id ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘ä¸»é”®
     * @return ç»“æžœ
     */
    public int deleteServicePatientTempById(Long id);
    /**
     * æ‰¹é‡åˆ é™¤ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     *
     * @param ids éœ€è¦åˆ é™¤çš„æ•°æ®ä¸»é”®é›†åˆ
     * @return ç»“æžœ
     */
    public int deleteServicePatientTempByIds(Long[] ids);
}
smartor/src/main/java/com/smartor/service/IServicePatientTempService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,61 @@
package com.smartor.service;
import java.util.List;
import com.smartor.domain.ServicePatientTemp;
/**
 * ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘Service接口
 *
 * @author lihu
 * @date 2024-12-03
 */
public interface IServicePatientTempService
{
    /**
     * æŸ¥è¯¢ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     *
     * @param id ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘ä¸»é”®
     * @return ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     */
    public ServicePatientTemp selectServicePatientTempById(Long id);
    /**
     * æŸ¥è¯¢ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘åˆ—è¡¨
     *
     * @param servicePatientTemp ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     * @return ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘é›†åˆ
     */
    public List<ServicePatientTemp> selectServicePatientTempList(ServicePatientTemp servicePatientTemp);
    /**
     * æ–°å¢žã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     *
     * @param servicePatientTemp ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     * @return ç»“æžœ
     */
    public int insertServicePatientTemp(ServicePatientTemp servicePatientTemp);
    /**
     * ä¿®æ”¹ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     *
     * @param servicePatientTemp ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     * @return ç»“æžœ
     */
    public int updateServicePatientTemp(ServicePatientTemp servicePatientTemp);
    /**
     * æ‰¹é‡åˆ é™¤ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     *
     * @param ids éœ€è¦åˆ é™¤çš„【请填写功能名称】主键集合
     * @return ç»“æžœ
     */
    public int deleteServicePatientTempByIds(Long[] ids);
    /**
     * åˆ é™¤ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘ä¿¡æ¯
     *
     * @param id ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘ä¸»é”®
     * @return ç»“æžœ
     */
    public int deleteServicePatientTempById(Long id);
}
smartor/src/main/java/com/smartor/service/impl/PatMedInhospServiceImpl.java
@@ -205,7 +205,7 @@
        patMedInhosp.setCheckFlag("0");
        patMedInhosp.setInhospstate("1");
        List<PatMedInhosp> patMedInhosps = patMedInhospMapper.selectPatMedInhospList(patMedInhosp);
        log.error("dealOutHospInfo需要处理的出院患者信息:{}", patMedInhosps);
        for (PatMedInhosp patMedInhosp1 : patMedInhosps) {
            //根据患者所在科室,获取该科室的长期任务模板
            Long taskid = null;
smartor/src/main/java/com/smartor/service/impl/ServicePatientTempServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,96 @@
package com.smartor.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.smartor.mapper.ServicePatientTempMapper;
import com.smartor.domain.ServicePatientTemp;
import com.smartor.service.IServicePatientTempService;
/**
 * ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘Service业务层处理
 *
 * @author lihu
 * @date 2024-12-03
 */
@Service
public class ServicePatientTempServiceImpl implements IServicePatientTempService
{
    @Autowired
    private ServicePatientTempMapper servicePatientTempMapper;
    /**
     * æŸ¥è¯¢ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     *
     * @param id ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘ä¸»é”®
     * @return ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     */
    @Override
    public ServicePatientTemp selectServicePatientTempById(Long id)
    {
        return servicePatientTempMapper.selectServicePatientTempById(id);
    }
    /**
     * æŸ¥è¯¢ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘åˆ—è¡¨
     *
     * @param servicePatientTemp ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     * @return ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     */
    @Override
    public List<ServicePatientTemp> selectServicePatientTempList(ServicePatientTemp servicePatientTemp)
    {
        return servicePatientTempMapper.selectServicePatientTempList(servicePatientTemp);
    }
    /**
     * æ–°å¢žã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     *
     * @param servicePatientTemp ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     * @return ç»“æžœ
     */
    @Override
    public int insertServicePatientTemp(ServicePatientTemp servicePatientTemp)
    {
        servicePatientTemp.setCreateTime(DateUtils.getNowDate());
        return servicePatientTempMapper.insertServicePatientTemp(servicePatientTemp);
    }
    /**
     * ä¿®æ”¹ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     *
     * @param servicePatientTemp ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     * @return ç»“æžœ
     */
    @Override
    public int updateServicePatientTemp(ServicePatientTemp servicePatientTemp)
    {
        servicePatientTemp.setUpdateTime(DateUtils.getNowDate());
        return servicePatientTempMapper.updateServicePatientTemp(servicePatientTemp);
    }
    /**
     * æ‰¹é‡åˆ é™¤ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     *
     * @param ids éœ€è¦åˆ é™¤çš„【请填写功能名称】主键
     * @return ç»“æžœ
     */
    @Override
    public int deleteServicePatientTempByIds(Long[] ids)
    {
        return servicePatientTempMapper.deleteServicePatientTempByIds(ids);
    }
    /**
     * åˆ é™¤ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘ä¿¡æ¯
     *
     * @param id ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘ä¸»é”®
     * @return ç»“æžœ
     */
    @Override
    public int deleteServicePatientTempById(Long id)
    {
        return servicePatientTempMapper.deleteServicePatientTempById(id);
    }
}
smartor/src/main/resources/mapper/smartor/ServicePatientTempMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,158 @@
<?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.smartor.mapper.ServicePatientTempMapper">
    <resultMap type="com.smartor.domain.ServicePatientTemp" id="ServicePatientTempResult">
        <result property="id" column="id"/>
        <result property="userId" column="user_id"/>
        <result property="tempId" column="temp_id"/>
        <result property="type" column="type"/>
        <result property="startTime" column="start_time"/>
        <result property="endTime" column="end_time"/>
        <result property="dayNum" column="day_num"/>
        <result property="delFlag" column="del_flag"/>
        <result property="createTime" column="create_time"/>
        <result property="updateTime" column="update_time"/>
    </resultMap>
    <sql id="selectServicePatientTempVo">
        select id,
               user_id,
               temp_id,
               type,
               start_time,
               end_time,
               day_num,
               del_flag,
               create_time,
               update_time
        from service_patient_temp
    </sql>
    <select id="selectServicePatientTempList" parameterType="com.smartor.domain.ServicePatientTemp"
            resultMap="ServicePatientTempResult">
        <include refid="selectServicePatientTempVo"/>
        <where>
            <if test="userId != null ">
                and user_id = #{userId}
            </if>
            <if test="tempId != null ">
                and temp_id = #{tempId}
            </if>
            <if test="type != null ">
                and type = #{type}
            </if>
            <if test="startTime != null ">
                and start_time = #{startTime}
            </if>
            <if test="endTime != null ">
                and end_time = #{endTime}
            </if>
            <if test="dayNum != null ">
                and day_num = #{dayNum}
            </if>
        </where>
    </select>
    <select id="selectServicePatientTempById" parameterType="Long"
            resultMap="ServicePatientTempResult">
        <include refid="selectServicePatientTempVo"/>
        where id = #{id}
    </select>
    <insert id="insertServicePatientTemp" parameterType="com.smartor.domain.ServicePatientTemp">
        insert into service_patient_temp
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,
            </if>
            <if test="userId != null">user_id,
            </if>
            <if test="tempId != null">temp_id,
            </if>
            <if test="type != null">type,
            </if>
            <if test="startTime != null">start_time,
            </if>
            <if test="endTime != null">end_time,
            </if>
            <if test="dayNum != null">day_num,
            </if>
            <if test="delFlag != null">del_flag,
            </if>
            <if test="createTime != null">create_time,
            </if>
            <if test="updateTime != null">update_time,
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},
            </if>
            <if test="userId != null">#{userId},
            </if>
            <if test="tempId != null">#{tempId},
            </if>
            <if test="type != null">#{type},
            </if>
            <if test="startTime != null">#{startTime},
            </if>
            <if test="endTime != null">#{endTime},
            </if>
            <if test="dayNum != null">#{dayNum},
            </if>
            <if test="delFlag != null">#{delFlag},
            </if>
            <if test="createTime != null">#{createTime},
            </if>
            <if test="updateTime != null">#{updateTime},
            </if>
        </trim>
    </insert>
    <update id="updateServicePatientTemp" parameterType="com.smartor.domain.ServicePatientTemp">
        update service_patient_temp
        <trim prefix="SET" suffixOverrides=",">
            <if test="userId != null">user_id = #{userId},
            </if>
            <if test="tempId != null">temp_id = #{tempId},
            </if>
            <if test="type != null">type = #{type},
            </if>
            <if test="startTime != null">start_time = #{startTime},
            </if>
            <if test="endTime != null">end_time = #{endTime},
            </if>
            <if test="dayNum != null">day_num = #{dayNum},
            </if>
            <if test="delFlag != null">del_flag = #{delFlag},
            </if>
            <if test="createTime != null">create_time = #{createTime},
            </if>
            <if test="updateTime != null">update_time = #{updateTime},
            </if>
        </trim>
        where id = #{id}
    </update>
    <update id="deleteServicePatientTempById" parameterType="Long">
        update service_patient_temp
        <trim prefix="SET" suffixOverrides=",">
            del_flag =1
        </trim>
        where id = #{id}
    </update>
    <update id="deleteServicePatientTempByIds" parameterType="String">
        update service_patient_temp
        <trim prefix="SET" suffixOverrides=",">
            del_flag =1
        </trim>
        where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </update>
</mapper>