| | |
| | | //@PreAuthorize("@ss.hasPermi('system:answer:add')") |
| | | @Log(title = "任务问卷问题选项", businessType = BusinessType.INSERT) |
| | | @ApiOperation("新增任务问卷问题选项") |
| | | @PostMapping("/add") |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody ServiceSubtaskAnswer serviceSubtaskAnswer) { |
| | | SysUser user = getLoginUser().getUser(); |
| | | serviceSubtaskAnswer.setOrgid(user.getOrgid()); |
| | |
| | | //@PreAuthorize("@ss.hasPermi('system:answer:edit')") |
| | | @Log(title = "任务问卷问题选项", businessType = BusinessType.UPDATE) |
| | | @ApiOperation("修改任务问卷问题选项") |
| | | @PostMapping("/edit") |
| | | @PostMapping("/edit") |
| | | public AjaxResult edit(@RequestBody ServiceSubtaskAnswer serviceSubtaskAnswer) { |
| | | log.info("【saveQuestionCache-----edit】的入参为:{}", serviceSubtaskAnswer); |
| | | return toAjax(serviceSubtaskAnswerService.updateServiceSubtaskAnswer(serviceSubtaskAnswer)); |
| | |
| | | package com.ruoyi.web.controller.smartor; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.fasterxml.jackson.databind.JsonNode; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.github.pagehelper.ISelect; |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.reflect.TypeToken; |
| | |
| | | import com.ruoyi.common.core.domain.model.LoginUser; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.dx.MessageSend; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.enums.MsgLSEnum; |
| | | import com.ruoyi.common.enums.PreachFormEnum; |
| | | import com.ruoyi.common.enums.SendStateEnum; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.DtoConversionUtils; |
| | | import com.ruoyi.common.utils.PageUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.*; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.common.utils.reflect.ReflectUtils; |
| | | import com.ruoyi.quartz.service.ICollectHISService; |
| | | import com.ruoyi.quartz.task.RyTask; |
| | | import com.ruoyi.system.domain.SysConfig; |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | import com.ruoyi.system.service.ISysUserDeptService; |
| | | import com.smartor.common.LSHospTokenUtil; |
| | | import com.smartor.common.QwenLLMUtil; |
| | | import com.smartor.domain.*; |
| | | import com.smartor.domain.VO.HeLibraryCountVO; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.stream.Collectors; |
| | |
| | | for (ServiceSubtaskExport serviceSubtaskExport : serviceSubtaskExports) { |
| | | String pf = PreachFormEnum.getDescByCode(serviceSubtaskExport.getPreachform()); |
| | | serviceSubtaskExport.setPreachform(pf); |
| | | if(serviceSubtaskExport.getSendstate() != null) { |
| | | if (serviceSubtaskExport.getSendstate() != null) { |
| | | String stName = SendStateEnum.getDescByCode("" + serviceSubtaskExport.getSendstate()); |
| | | serviceSubtaskExport.setStName(stName); |
| | | } |
| | |
| | | |
| | | Integer statisticaltype = serviceSubtaskCountReq.getStatisticaltype(); |
| | | |
| | | if(ObjectUtils.isNotEmpty(statisticaltype)){ |
| | | if (ObjectUtils.isNotEmpty(statisticaltype)) { |
| | | SysUser user = getLoginUser().getUser(); |
| | | if(!isAdmin.contains(user.getUserId())){ |
| | | if(statisticaltype==1){ |
| | | if(CollectionUtils.isEmpty(serviceSubtaskCountReq.getLeavehospitaldistrictcodes())){ |
| | | if (!isAdmin.contains(user.getUserId())) { |
| | | if (statisticaltype == 1) { |
| | | if (CollectionUtils.isEmpty(serviceSubtaskCountReq.getLeavehospitaldistrictcodes())) { |
| | | //全部病区 |
| | | String deptInfo = user.getDeptInfo(); |
| | | List<String> leavehospitaldistrictcodes = JSON.parseArray(deptInfo) |
| | | .stream() |
| | | .map(item -> (String) ((List<?>) item).get(0)).collect(Collectors.toList()); |
| | | List<String> leavehospitaldistrictcodes = JSON.parseArray(deptInfo).stream().map(item -> (String) ((List<?>) item).get(0)).collect(Collectors.toList()); |
| | | serviceSubtaskCountReq.setLeavehospitaldistrictcodes(leavehospitaldistrictcodes); |
| | | } |
| | | }else if(statisticaltype==2){ |
| | | if(CollectionUtils.isEmpty(serviceSubtaskCountReq.getDeptcodes())){ |
| | | } else if (statisticaltype == 2) { |
| | | if (CollectionUtils.isEmpty(serviceSubtaskCountReq.getDeptcodes())) { |
| | | //全部科室 |
| | | String hospInfo = user.getHospInfo(); |
| | | List<String> deptCodes = JSON.parseArray(hospInfo) |
| | | .stream() |
| | | .map(item -> (String) ((List<?>) item).get(0)).collect(Collectors.toList()); |
| | | List<String> deptCodes = JSON.parseArray(hospInfo).stream().map(item -> (String) ((List<?>) item).get(0)).collect(Collectors.toList()); |
| | | serviceSubtaskCountReq.setDeptcodes(deptCodes); |
| | | } |
| | | } |
| | |
| | | return serviceSubtaskService.getHeLibraryCount(heLibraryCountVO); |
| | | } |
| | | |
| | | /** |
| | | * 手动发送问卷模板的短信功能 |
| | | * |
| | | * @param subid |
| | | * @return |
| | | */ |
| | | @GetMapping(value = "/smsSubTask/{subid}") |
| | | public Map<String, Object> smsSubTask(@PathVariable("subid") Long subid) { |
| | | return serviceSubtaskService.smsSubTask(subid); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/test") |
| | | public void test() { |
| | |
| | | } |
| | | |
| | | @PostMapping("/compensateTasktest") |
| | | public void compensateTasktest(@RequestParam("subId")Long subId) { |
| | | public void compensateTasktest(@RequestParam("subId") Long subId) { |
| | | ryTask.compensateTaskTest(subId); |
| | | } |
| | | |
| | | @PostMapping("/longTaskSendtest") |
| | | public void longTaskSendtest(@RequestParam("subId")Long subId) { |
| | | public void longTaskSendtest(@RequestParam("subId") Long subId) { |
| | | ryTask.longTaskSendTest(subId); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @PostMapping("/qwenLLMTest") |
| | | public int qwenLLMTest(@RequestParam("voiceText") String questionText, @RequestParam("voiceText") String voiceText, |
| | | @RequestParam("value") String value,@RequestParam("regexText") String regexText) { |
| | | public int qwenLLMTest(@RequestParam("voiceText") String questionText, @RequestParam("voiceText") String voiceText, @RequestParam("value") String value, @RequestParam("regexText") String regexText) { |
| | | int result = ryTask.qwenLLMTest(questionText, voiceText, value, regexText); |
| | | return result; |
| | | } |
| | |
| | | package com.smartor.controller; |
| | | package com.ruoyi.web.controller.smartor; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | |
| | | * 查询短信模板列表 |
| | | */ |
| | | //@PreAuthorize("@ss.hasPermi('smartor:smstemplet:list')") |
| | | @PostMapping("list") |
| | | public TableDataInfo list(@RequestBody SmsTemplet smsTemplet) { |
| | | startPage(); |
| | | @PostMapping("/list") |
| | | public Map<String, Object> list(@RequestBody SmsTemplet smsTemplet) { |
| | | //这个不需要分页,一个科室也不会有多少条短信模板 |
| | | smsTemplet.setPageNum(null); |
| | | smsTemplet.setPageSize(null); |
| | | List<SmsTemplet> list = smsTempletService.selectSmsTempletList(smsTemplet); |
| | | return getDataTable(list); |
| | | return getDataTable3(ObjectUtil.isNotEmpty(list)?list.size():0, list); |
| | | } |
| | | |
| | | /** |
| | |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.*; |
| | | import java.time.temporal.ChronoUnit; |
| | | import java.util.Date; |
| | | |
| | | import org.apache.commons.lang3.time.DateFormatUtils; |
| | |
| | | * 计算相差天数 |
| | | */ |
| | | public static int differentDaysByMillisecond(Date date1, Date date2) { |
| | | return Math.abs((int) ((date2.getTime() - date1.getTime()) / (1000 * 3600 * 24))); |
| | | LocalDate d1 = date1.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); |
| | | LocalDate d2 = date2.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); |
| | | return (int) ChronoUnit.DAYS.between(d1, d2); |
| | | } |
| | | |
| | | /** |
| | |
| | | package com.ruoyi.system.domain; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.ruoyi.common.annotation.Excel; |
| | |
| | | * @author smartor |
| | | * @date 2023-03-06 |
| | | */ |
| | | public class SmsTemplet extends BaseEntity |
| | | { |
| | | @Data |
| | | public class SmsTemplet extends BaseEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** $column.columnComment */ |
| | | /** |
| | | * 主键 |
| | | */ |
| | | private Long templetid; |
| | | |
| | | /** $column.columnComment */ |
| | | /** |
| | | * 短信模板编号 |
| | | */ |
| | | @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") |
| | | private String templetno; |
| | | |
| | | /** $column.columnComment */ |
| | | /** |
| | | * 短信模板名称 |
| | | */ |
| | | @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") |
| | | private String templetname; |
| | | |
| | | /** $column.columnComment */ |
| | | /** |
| | | * 模板内容 |
| | | */ |
| | | @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") |
| | | private String templetcontent; |
| | | |
| | | /** $column.columnComment */ |
| | | /** |
| | | * 部门编码 |
| | | */ |
| | | @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") |
| | | private String deptCode; |
| | | |
| | | /** |
| | | * 部门名称 |
| | | */ |
| | | @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") |
| | | private String deptName; |
| | | |
| | | /** |
| | | * 病区编码 |
| | | */ |
| | | @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") |
| | | private String wardCode; |
| | | |
| | | /** |
| | | * 病区名称 |
| | | */ |
| | | @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") |
| | | private String wardName; |
| | | |
| | | /** |
| | | * 用户工号 |
| | | */ |
| | | @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") |
| | | private String userName; |
| | | |
| | | /** |
| | | * 用户铝箔 |
| | | */ |
| | | @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") |
| | | private String nickName; |
| | | |
| | | /** |
| | | * $column.columnComment |
| | | */ |
| | | private String delFlag; |
| | | |
| | | /** $column.columnComment */ |
| | | /** |
| | | * $column.columnComment |
| | | */ |
| | | @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") |
| | | private Long isupload; |
| | | |
| | | /** $column.columnComment */ |
| | | /** |
| | | * $column.columnComment |
| | | */ |
| | | @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") |
| | | private Date uploadTime; |
| | | |
| | | public void setTempletid(Long templetid) |
| | | { |
| | | this.templetid = templetid; |
| | | } |
| | | |
| | | public Long getTempletid() |
| | | { |
| | | return templetid; |
| | | } |
| | | public void setTempletno(String templetno) |
| | | { |
| | | this.templetno = templetno; |
| | | } |
| | | |
| | | public String getTempletno() |
| | | { |
| | | return templetno; |
| | | } |
| | | public void setTempletname(String templetname) |
| | | { |
| | | this.templetname = templetname; |
| | | } |
| | | |
| | | public String getTempletname() |
| | | { |
| | | return templetname; |
| | | } |
| | | public void setTempletcontent(String templetcontent) |
| | | { |
| | | this.templetcontent = templetcontent; |
| | | } |
| | | |
| | | public String getTempletcontent() |
| | | { |
| | | return templetcontent; |
| | | } |
| | | public void setDelFlag(String delFlag) |
| | | { |
| | | this.delFlag = delFlag; |
| | | } |
| | | |
| | | public String getDelFlag() |
| | | { |
| | | return delFlag; |
| | | } |
| | | public void setIsupload(Long isupload) |
| | | { |
| | | this.isupload = isupload; |
| | | } |
| | | |
| | | public Long getIsupload() |
| | | { |
| | | return isupload; |
| | | } |
| | | public void setUploadTime(Date uploadTime) |
| | | { |
| | | this.uploadTime = uploadTime; |
| | | } |
| | | |
| | | public Date getUploadTime() |
| | | { |
| | | return uploadTime; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("templetid", getTempletid()) |
| | | .append("templetno", getTempletno()) |
| | | .append("templetname", getTempletname()) |
| | | .append("templetcontent", getTempletcontent()) |
| | | .append("delFlag", getDelFlag()) |
| | | .append("updateBy", getUpdateBy()) |
| | | .append("updateTime", getUpdateTime()) |
| | | .append("createBy", getCreateBy()) |
| | | .append("createTime", getCreateTime()) |
| | | .append("isupload", getIsupload()) |
| | | .append("uploadTime", getUploadTime()) |
| | | .toString(); |
| | | } |
| | | } |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * 短信模板Mapper接口 |
| | | * |
| | |
| | | * @param templetids 需要删除的数据主键集合 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteSmsTempletByTempletids(Long[] templetids); |
| | | public int deleteSmsTempletByTempletids(@Param("templetids") Long[] templetids); |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | * @date 2023-03-06 |
| | | */ |
| | | @Service |
| | | public class SmsTempletServiceImpl implements ISmsTempletService |
| | | { |
| | | public class SmsTempletServiceImpl implements ISmsTempletService { |
| | | @Autowired |
| | | private SmsTempletMapper smsTempletMapper; |
| | | |
| | |
| | | * @return 短信模板 |
| | | */ |
| | | @Override |
| | | public SmsTemplet selectSmsTempletByTempletid(Long templetid) |
| | | { |
| | | public SmsTemplet selectSmsTempletByTempletid(Long templetid) { |
| | | return smsTempletMapper.selectSmsTempletByTempletid(templetid); |
| | | } |
| | | |
| | |
| | | * @return 短信模板 |
| | | */ |
| | | @Override |
| | | public List<SmsTemplet> selectSmsTempletList(SmsTemplet smsTemplet) |
| | | { |
| | | public List<SmsTemplet> selectSmsTempletList(SmsTemplet smsTemplet) { |
| | | return smsTempletMapper.selectSmsTempletList(smsTemplet); |
| | | } |
| | | |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int insertSmsTemplet(SmsTemplet smsTemplet) |
| | | { |
| | | public int insertSmsTemplet(SmsTemplet smsTemplet) { |
| | | smsTemplet.setCreateTime(DateUtils.getNowDate()); |
| | | return smsTempletMapper.insertSmsTemplet(smsTemplet); |
| | | } |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int updateSmsTemplet(SmsTemplet smsTemplet) |
| | | { |
| | | public int updateSmsTemplet(SmsTemplet smsTemplet) { |
| | | smsTemplet.setUpdateTime(DateUtils.getNowDate()); |
| | | return smsTempletMapper.updateSmsTemplet(smsTemplet); |
| | | } |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deleteSmsTempletByTempletids(Long[] templetids) |
| | | { |
| | | return smsTempletMapper.deleteSmsTempletByTempletids(templetids); |
| | | public int deleteSmsTempletByTempletids(Long[] templetids) { |
| | | return smsTempletMapper.deleteSmsTempletByTempletids(templetids); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deleteSmsTempletByTempletid(Long templetid) |
| | | { |
| | | public int deleteSmsTempletByTempletid(Long templetid) { |
| | | return smsTempletMapper.deleteSmsTempletByTempletid(templetid); |
| | | } |
| | | } |
| | |
| | | <?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"> |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.system.mapper.SmsTempletMapper"> |
| | | |
| | | <resultMap type="SmsTemplet" id="SmsTempletResult"> |
| | | <result property="templetid" column="templetid" /> |
| | | <result property="templetno" column="templetno" /> |
| | | <result property="templetname" column="templetname" /> |
| | | <result property="templetcontent" column="templetcontent" /> |
| | | <result property="delFlag" column="del_flag" /> |
| | | <result property="updateBy" column="update_by" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="createBy" column="create_by" /> |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="isupload" column="isupload" /> |
| | | <result property="uploadTime" column="upload_time" /> |
| | | <result property="guid" column="guid" /> |
| | | <result property="orgid" column="orgid" /> |
| | | <result property="templetid" column="templetid"/> |
| | | <result property="templetno" column="templetno"/> |
| | | <result property="templetname" column="templetname"/> |
| | | <result property="templetcontent" column="templetcontent"/> |
| | | <result property="delFlag" column="del_flag"/> |
| | | <result property="updateBy" column="update_by"/> |
| | | <result property="updateTime" column="update_time"/> |
| | | <result property="createBy" column="create_by"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="isupload" column="isupload"/> |
| | | <result property="uploadTime" column="upload_time"/> |
| | | <result property="guid" column="guid"/> |
| | | <result property="orgid" column="orgid"/> |
| | | <result property="deptCode" column="dept_code"/> |
| | | <result property="deptName" column="dept_name"/> |
| | | <result property="wardName" column="ward_name"/> |
| | | <result property="wardCode" column="ward_code"/> |
| | | <result property="userName" column="user_name"/> |
| | | <result property="nickName" column="nick_name"/> |
| | | |
| | | </resultMap> |
| | | |
| | | <sql id="selectSmsTempletVo"> |
| | | select templetid, templetno, orgid, templetname, templetcontent, del_flag, update_by, guid, update_time, create_by, create_time, isupload, upload_time from sms_templet |
| | | select templetid, |
| | | templetno, |
| | | orgid, |
| | | templetname, |
| | | templetcontent, |
| | | del_flag, |
| | | update_by, |
| | | guid, |
| | | update_time, |
| | | create_by, |
| | | create_time, |
| | | isupload, |
| | | upload_time, |
| | | dept_code, |
| | | dept_name, |
| | | ward_name, |
| | | ward_code, |
| | | user_name, |
| | | nick_name |
| | | from sms_templet |
| | | </sql> |
| | | |
| | | <select id="selectSmsTempletList" parameterType="SmsTemplet" resultMap="SmsTempletResult"> |
| | | <include refid="selectSmsTempletVo"/> |
| | | where 1=1 |
| | | <if test="orgid != null and orgid != ''"> |
| | | AND orgid = #{orgid} |
| | | </if> |
| | | <if test="templetno != null and templetno != ''"> and templetno = #{templetno}</if> |
| | | <if test="templetname != null and templetname != ''"> and templetname like concat('%', #{templetname}, '%')</if> |
| | | <if test="templetcontent != null and templetcontent != ''"> and templetcontent = #{templetcontent}</if> |
| | | <if test="isupload != null "> and isupload = #{isupload}</if> |
| | | <if test="uploadTime != null "> and upload_time = #{uploadTime}</if> |
| | | <if test="orgid != null and orgid != ''"> |
| | | AND orgid = #{orgid} |
| | | </if> |
| | | <if test="templetno != null and templetno != ''">and templetno = #{templetno}</if> |
| | | <if test="templetname != null and templetname != ''">and templetname like concat('%', #{templetname}, '%')</if> |
| | | <if test="templetcontent != null and templetcontent != ''">and templetcontent = #{templetcontent}</if> |
| | | <if test="isupload != null ">and isupload = #{isupload}</if> |
| | | <if test="uploadTime != null ">and upload_time = #{uploadTime}</if> |
| | | <if test="deptCode != null and deptCode != ''">and dept_code = #{deptCode}</if> |
| | | <if test="deptName != null and deptName != ''">and dept_name = #{deptName}</if> |
| | | <if test="wardName != null and wardName != ''">and ward_name = #{wardName}</if> |
| | | <if test="wardCode != null and wardCode != ''">and ward_code = #{wardCode}</if> |
| | | <if test="userName != null and userName != ''">and user_name = #{userName}</if> |
| | | <if test="nickName != null and nickName != ''">and nick_name = #{nickName}</if> |
| | | </select> |
| | | |
| | | <select id="selectSmsTempletByTempletid" parameterType="Long" resultMap="SmsTempletResult"> |
| | |
| | | where templetid = #{templetid} |
| | | </select> |
| | | |
| | | <insert id="insertSmsTemplet" parameterType="SmsTemplet"> |
| | | <insert id="insertSmsTemplet" parameterType="SmsTemplet" useGeneratedKeys="true" |
| | | keyProperty="templetid"> |
| | | insert into sms_templet |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="templetid != null">templetid,</if> |
| | | <if test="templetno != null">templetno,</if> |
| | | <if test="templetname != null">templetname,</if> |
| | | <if test="templetcontent != null">templetcontent,</if> |
| | |
| | | <if test="uploadTime != null">upload_time,</if> |
| | | <if test="guid != null">guid,</if> |
| | | <if test="orgid != null">orgid,</if> |
| | | </trim> |
| | | <if test="deptCode != null">dept_code,</if> |
| | | <if test="deptName != null">dept_name,</if> |
| | | <if test="wardCode != null">ward_code,</if> |
| | | <if test="wardName != null">ward_name,</if> |
| | | <if test="userName != null">user_name,</if> |
| | | <if test="nickName != null">nick_name,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="templetid != null">#{templetid},</if> |
| | | <if test="templetno != null">#{templetno},</if> |
| | | <if test="templetname != null">#{templetname},</if> |
| | | <if test="templetcontent != null">#{templetcontent},</if> |
| | |
| | | <if test="uploadTime != null">#{uploadTime},</if> |
| | | <if test="guid != null">#{guid},</if> |
| | | <if test="orgid != null">#{orgid},</if> |
| | | </trim> |
| | | <if test="deptCode != null">#{deptCode},</if> |
| | | <if test="deptName != null">#{deptName},</if> |
| | | <if test="wardCode != null">#{wardCode},</if> |
| | | <if test="wardName != null">#{wardName},</if> |
| | | <if test="userName != null">#{userName},</if> |
| | | <if test="nickName != null">#{nickName},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateSmsTemplet" parameterType="SmsTemplet"> |
| | |
| | | <if test="uploadTime != null">upload_time = #{uploadTime},</if> |
| | | <if test="guid != null">guid = #{guid},</if> |
| | | <if test="orgid != null">orgid = #{orgid},</if> |
| | | <if test="deptCode != null">dept_code = #{deptCode},</if> |
| | | <if test="deptName != null">dept_name = #{deptName},</if> |
| | | <if test="wardCode != null">ward_code = #{wardCode},</if> |
| | | <if test="wardName != null">ward_name = #{wardName},</if> |
| | | <if test="userName != null">user_name = #{userName},</if> |
| | | <if test="nickName != null">nick_name = #{nickName},</if> |
| | | </trim> |
| | | where templetid = #{templetid} |
| | | </update> |
| | | |
| | | <delete id="deleteSmsTempletByTempletid" parameterType="Long"> |
| | | delete from sms_templet where templetid = #{templetid} |
| | | update sms_templet |
| | | set del_flag = '1' |
| | | where templetid = #{templetid} |
| | | </delete> |
| | | |
| | | <delete id="deleteSmsTempletByTempletids" parameterType="String"> |
| | | delete from sms_templet where templetid in |
| | | <foreach item="templetid" collection="array" open="(" separator="," close=")"> |
| | | update sms_templet set del_flag = '1' where templetid in |
| | | <foreach item="templetid" collection="templetids" open="(" separator="," close=")"> |
| | | #{templetid} |
| | | </foreach> |
| | | </delete> |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | @ApiModelProperty(value = "结束时间") |
| | | private Date endTime; |
| | | |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "出院开始时间") |
| | | private Date hospitalStartTime; |
| | | |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "出院结束时间") |
| | | private Date hospitalEndTime; |
| | | |
| | | @ApiModelProperty(value = "服务类型") |
| | | private List<Long> serviceType; |
| | | |
| | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 任务名称 |
| | | * 科室名称 |
| | | */ |
| | | @Excel(name = "任务名称") |
| | | @ApiModelProperty(value = "任务名称") |
| | | private String taskName; |
| | | @Excel(name = "科室名称") |
| | | @ApiModelProperty(value = "科室名称") |
| | | private String deptname; |
| | | |
| | | /** |
| | | * 发送人 |
| | |
| | | @Excel(name = " 姓名 ") |
| | | @ApiModelProperty(value = "发送人") |
| | | private String sendname; |
| | | |
| | | /** |
| | | * 发送状态 |
| | | */ |
| | | // @Excel(name = " 任务状态 ") |
| | | @ApiModelProperty(value = "发送状态 1 被领取(在任务中是新建,在服务中是被领取) 2 待发送 3 已发送 4 不执行 5 发送失败 6 已完成 7 超时(人工)") |
| | | private Long sendstate; |
| | | |
| | | /** |
| | | * 发送状态 |
| | | */ |
| | | @Excel(name = " 任务状态 ") |
| | | @ApiModelProperty(value = "发送状态 1 被领取(在任务中是新建,在服务中是被领取) 2 待发送 3 已发送 4 不执行 5 发送失败 6 已完成 7 超时(人工)") |
| | | private String stName; |
| | | |
| | | /** |
| | | * 完成时间 |
| | | */ |
| | | @Excel(name = " 完成时间 ", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "完成时间") |
| | | private Date finishtime; |
| | | |
| | | /** |
| | | * 出院时间 |
| | |
| | | @ApiModelProperty(value = "应随访日期") |
| | | private Date visitTime; |
| | | |
| | | /** |
| | | * 完成时间 |
| | | */ |
| | | @Excel(name = " 完成时间 ", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "完成时间") |
| | | private Date finishtime; |
| | | |
| | | /** |
| | | * 随访人员 |
| | | */ |
| | | @Excel(name = "随访人员") |
| | | private String updateBy; |
| | | |
| | | /** |
| | | * 医生姓名 |
| | |
| | | @ApiModelProperty(value = "医生姓名") |
| | | private String drname; |
| | | |
| | | /** |
| | | * 随访人员 |
| | | */ |
| | | @Excel(name = "随访人员") |
| | | private String updateBy; |
| | | |
| | | @Excel(name = "出院天数", suffix = "天") |
| | | @ApiModelProperty(value = "出院天数") |
| | | private Integer endDay; |
| | | |
| | | /** |
| | | * 出院诊断 |
| | | */ |
| | | @Excel(name = " 出院诊断 ") |
| | | @ApiModelProperty(value = "出院诊断") |
| | | private String leavediagname; |
| | | |
| | | |
| | | /** |
| | | * 发送状态 |
| | | */ |
| | | // @Excel(name = " 任务状态 ") |
| | | @ApiModelProperty(value = "发送状态 1 被领取(在任务中是新建,在服务中是被领取) 2 待发送 3 已发送 4 不执行 5 发送失败 6 已完成 7 超时(人工)") |
| | | private Long sendstate; |
| | | |
| | | /** |
| | | * 发送状态 |
| | | */ |
| | | @Excel(name = " 任务状态 ") |
| | | @ApiModelProperty(value = "发送状态 1 被领取(在任务中是新建,在服务中是被领取) 2 待发送 3 已发送 4 不执行 5 发送失败 6 已完成 7 超时(人工)") |
| | | private String stName; |
| | | |
| | | |
| | | /** |
| | | * 身份证号 |
| | |
| | | |
| | | |
| | | /** |
| | | * 科室名称 |
| | | */ |
| | | @Excel(name = "科室名称") |
| | | @ApiModelProperty(value = "科室名称") |
| | | private String deptname; |
| | | |
| | | |
| | | /** |
| | | * 出院病区名称 |
| | | */ |
| | | @ApiModelProperty(value = "出院病区名称") |
| | |
| | | @Excel(name = "任务执行方式") |
| | | private String preachform; |
| | | |
| | | /** |
| | | * 任务名称 |
| | | */ |
| | | @Excel(name = "任务名称") |
| | | @ApiModelProperty(value = "任务名称") |
| | | private String taskName; |
| | | |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @Excel(name = "备注") |
| | | @ApiModelProperty(value = "备注") |
| | | private String remark; |
| | | |
| | |
| | | @ApiModelProperty(value = "主键id") |
| | | private Long subId; |
| | | |
| | | /** |
| | | * 主键id集合 |
| | | */ |
| | | @ApiModelProperty(value = "主键id集合") |
| | | private List<Long> subIdList; |
| | | |
| | | |
| | | /** |
| | | * 第三方任务ID |
| | |
| | | public void setFailSubTaskDefalutVal(Long failDay); |
| | | |
| | | public Map<String, Object> getHeLibraryCount(@RequestBody HeLibraryCountVO heLibraryCountVO); |
| | | |
| | | Map<String, Object> smsSubTask(Long subid); |
| | | } |
| | |
| | | @Value("${lwl_app_key}") |
| | | private String APP_KEY; |
| | | |
| | | |
| | | @Value("${spring.profiles.active}") |
| | | private String active; |
| | | |
| | | @Override |
| | | public List<ServiceSLTDInhospResDTO> queryHealthcareRecordList(ServiceSLTDInhospReqVO reqVO) { |
| | | try { |
| | |
| | | patMedInhosp.setCampusid(dto.getCampusId()); |
| | | if (StringUtils.isNotEmpty(dto.getHealthcareRecordStatus()) && dto.getHealthcareRecordStatus().equals("FH0109.25")) |
| | | patMedInhosp.setRemark("预出院"); |
| | | if (active.equals("nhfy") && dto.getAreaId() != null && dto.getAreaId().toString().equals("40003483") && StringUtils.isNotEmpty(patMedInhosp.getPatname())) { |
| | | //南华附一的产科,要求不生成“之子、之女、之婴”的随访任务 |
| | | if (patMedInhosp.getPatname().contains("之子") || patMedInhosp.getPatname().contains("之女") || patMedInhosp.getPatname().contains("之婴")) { |
| | | patMedInhosp.setDeptcheckFlag("3"); |
| | | patMedInhosp.setWardcheckFlag("3"); |
| | | patMedInhosp.setDiagcheckFlag("3"); |
| | | patMedInhosp.setRemark(patMedInhosp.getRemark() + ";不生成之子、之女、之婴问卷"); |
| | | } |
| | | } |
| | | |
| | | return patMedInhosp; |
| | | } |
| | | |
| | |
| | | */ |
| | | private PatArchive processPatientArchive(ServiceSLTDInhospResDTO dto) { |
| | | // 构建锁的 key:基于 patientno 或 idcardno |
| | | String lockKey = "pat_archive_lock:" + |
| | | (StringUtils.isNotEmpty(dto.getMedicalRecordNo()) ? dto.getMedicalRecordNo() : dto.getIdCardNo()); |
| | | |
| | | String lockKey = "pat_archive_lock:" + (StringUtils.isNotEmpty(dto.getMedicalRecordNo()) ? dto.getMedicalRecordNo() : dto.getIdCardNo()); |
| | | |
| | | // 尝试获取分布式锁,最多等待 3 秒,锁定 10 秒自动释放 |
| | | Boolean lockAcquired = redisTemplate.opsForValue().setIfAbsent(lockKey, "1", 10, TimeUnit.SECONDS); |
| | | |
| | | |
| | | if (lockAcquired == null || !lockAcquired) { |
| | | log.warn("【processPatientArchive】获取分布式锁失败,跳过本次处理(其他线程正在处理),patientno={}", dto.getMedicalRecordNo()); |
| | | // 等待一段时间后重试查询 |
| | |
| | | Thread.currentThread().interrupt(); |
| | | } |
| | | } |
| | | |
| | | |
| | | try { |
| | | return doProcessPatientArchive(dto); |
| | | } finally { |
| | |
| | | } |
| | | |
| | | PatArchive patArchive = buildPatientArchive(dto); |
| | | log.info("【processPatientArchive】患者档案查重完成,patientno={}, 是否已存在={}", |
| | | patArchive.getPatientno(), CollectionUtils.isEmpty(existingArchives) ? "否" : "是(id=" + existingArchives.get(0).getId() + ")"); |
| | | |
| | | log.info("【processPatientArchive】患者档案查重完成,patientno={}, 是否已存在={}", patArchive.getPatientno(), CollectionUtils.isEmpty(existingArchives) ? "否" : "是(id=" + existingArchives.get(0).getId() + ")"); |
| | | |
| | | if (CollectionUtils.isEmpty(existingArchives)) { |
| | | try { |
| | | // 最终确认查询(防御性编程:防止Redis锁失效等极端情况) |
| | |
| | | if (StringUtils.isNotEmpty(dto.getMedicalRecordNo())) { |
| | | finalQuery.setPatientno(dto.getMedicalRecordNo()); |
| | | } |
| | | |
| | | |
| | | List<PatArchive> finalCheck = patArchiveService.selectPatArchiveList(finalQuery); |
| | | log.info("【processPatientArchive】最终确认查询,patientno={}, idcardno={}, 结果数量={}", |
| | | dto.getMedicalRecordNo(), dto.getIdCardNo(), finalCheck.size()); |
| | | |
| | | log.info("【processPatientArchive】最终确认查询,patientno={}, idcardno={}, 结果数量={}", dto.getMedicalRecordNo(), dto.getIdCardNo(), finalCheck.size()); |
| | | |
| | | if (CollectionUtils.isEmpty(finalCheck)) { |
| | | patArchiveService.insertPatArchive(patArchive); |
| | | log.info("【processPatientArchive】✓ 新增患者档案成功,patientno={}, id={}", |
| | | patArchive.getPatientno(), patArchive.getId()); |
| | | log.info("【processPatientArchive】✓ 新增患者档案成功,patientno={}, id={}", patArchive.getPatientno(), patArchive.getId()); |
| | | } else { |
| | | // 其他线程已经插入,直接使用已有记录 |
| | | existingArchives = finalCheck; |
| | |
| | | log.info("【processPatientArchive】档案已被其他线程创建,使用已有记录,id={}", patArchive.getId()); |
| | | } |
| | | } catch (org.springframework.dao.DuplicateKeyException e) { |
| | | log.warn("【processPatientArchive】患者档案已存在(并发插入异常),跳过:patientno={}, idcardno={}", |
| | | patArchive.getPatientno(), patArchive.getIdcardno()); |
| | | log.warn("【processPatientArchive】患者档案已存在(并发插入异常),跳过:patientno={}, idcardno={}", patArchive.getPatientno(), patArchive.getIdcardno()); |
| | | // 并发插入场景,重新查询获取已存在的记录 |
| | | PatArchive queryRetry = new PatArchive(); |
| | | queryRetry.setPatientno(patArchive.getPatientno()); |
| | |
| | | patArchive.setNotrequiredFlag(existingArchives.get(0).getNotrequiredFlag()); |
| | | patArchive.setNotrequiredreason(existingArchives.get(0).getNotrequiredreason()); |
| | | patArchiveService.updateArchive(patArchive); |
| | | log.info("【processPatientArchive】✓ 更新患者档案,patientno={}, id={}", |
| | | patArchive.getPatientno(), patArchive.getId()); |
| | | log.info("【processPatientArchive】✓ 更新患者档案,patientno={}, id={}", patArchive.getPatientno(), patArchive.getId()); |
| | | } |
| | | |
| | | return patArchive; |
| | |
| | | import com.ruoyi.common.utils.*; |
| | | import com.ruoyi.common.core.service.IConfigService; |
| | | import com.ruoyi.common.utils.spring.SpringUtils; |
| | | import com.ruoyi.system.domain.SysConfig; |
| | | import com.ruoyi.system.mapper.SysConfigMapper; |
| | | import com.smartor.common.FtpService; |
| | | import com.smartor.common.MtSubmitSmUtil; |
| | | import com.smartor.config.PhoneUtils; |
| | | import com.smartor.domain.DTO.ServiceSubtaskDetailDTO; |
| | | import com.smartor.domain.*; |
| | |
| | | |
| | | @Value("${ASRCallBackPath}") |
| | | private String ASRCallBackPath; |
| | | |
| | | @Autowired |
| | | private MtSubmitSmUtil mtSubmitSmUtil; |
| | | |
| | | @Autowired |
| | | private SysConfigMapper sysConfigMapper; |
| | | |
| | | @Autowired |
| | | private RedisTemplate redisTemplate; |
| | |
| | | // serviceTaskVO.setPreachform(result); |
| | | } |
| | | |
| | | if(StringUtils.isNotEmpty(serviceTaskVO.getPreachformDesc())){ |
| | | if (StringUtils.isNotEmpty(serviceTaskVO.getPreachformDesc())) { |
| | | //直接通过PreachformDesc生成List返回 |
| | | try { |
| | | List<Map<String, Object>> mapList = objectMapper.readValue(serviceTaskVO.getPreachformDesc(), List.class); |
| | | serviceTaskVO.setPreachformList(mapList); |
| | | }catch (Exception e) { |
| | | } catch (Exception e) { |
| | | } |
| | | }else { |
| | | if(CollectionUtils.isNotEmpty(list)){ |
| | | } else { |
| | | if (CollectionUtils.isNotEmpty(list)) { |
| | | //获取该患者所有的执行状态 |
| | | List<ServiceSubtaskPreachform> serviceSubtaskPreachformList = serviceSubtaskPreachformLists.stream() |
| | | .filter((item -> item.getSubid().equals(list.get(0).getId()) && item.getTaskid().equals(serviceTask.getTaskid()))).collect(Collectors.toList()); |
| | | List<ServiceSubtaskPreachform> serviceSubtaskPreachformList = serviceSubtaskPreachformLists.stream().filter((item -> item.getSubid().equals(list.get(0).getId()) && item.getTaskid().equals(serviceTask.getTaskid()))).collect(Collectors.toList()); |
| | | List<Map<String, Object>> resultList = serviceSubtaskPreachformList.stream().map(item -> { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("sort", item.getSort()); |
| | |
| | | serviceSubtaskRes.setContinueContent(serviceSubtask.getContinueContent()); |
| | | } |
| | | // 1:待随访(2 待发送);2:随访中(3 已发送、1 被领取)、3:未完成(5 发送失败、7、超时)、4:已完成( 6 已完成)、5:无需随访(4 不执行) |
| | | if (serviceSubtaskRes.getSendstate() == 1 || serviceSubtaskRes.getSendstate() == 2L || serviceSubtaskRes.getSendstate() == 3L || serviceSubtaskRes.getSendstate() == 5 || serviceSubtaskRes.getSendstate() == 7L) serviceSubtaskRes.setSendstateView(1L); |
| | | if (serviceSubtaskRes.getSendstate() == 1 || serviceSubtaskRes.getSendstate() == 2L || serviceSubtaskRes.getSendstate() == 3L || serviceSubtaskRes.getSendstate() == 5 || serviceSubtaskRes.getSendstate() == 7L) |
| | | serviceSubtaskRes.setSendstateView(1L); |
| | | if (serviceSubtaskRes.getSendstate() == 6) serviceSubtaskRes.setSendstateView(2L); |
| | | if (serviceSubtaskRes.getSendstate() == 4) serviceSubtaskRes.setSendstateView(3L); |
| | | serviceSubtaskResList.add(serviceSubtaskRes); |
| | |
| | | //南华附一的icd10code是有重复的,所以不能用南华附一的icd10code去查询 |
| | | log.info("----serviceTaskdiag的值为:{}", serviceTaskdiag); |
| | | if (!StringUtils.isEmpty(serviceTaskVO.getIcd10name())) { |
| | | String[] Icd10Names = serviceTaskVO.getIcd10name().split(","); |
| | | String[] Icd10codes = serviceTaskVO.getIcd10code().split(","); |
| | | String[] Icd10Names = serviceTaskVO.getIcd10name().split("$"); |
| | | String[] Icd10codes = serviceTaskVO.getIcd10code().split("$"); |
| | | for (int i = 0; i < Icd10Names.length; i++) { |
| | | serviceTaskdiag.setIcd10code(Icd10codes[i]); |
| | | serviceTaskdiag.setIcd10name(Icd10Names[i]); |
| | |
| | | serviceSubtask.setInhospid(patTaskRelevance.getHospid()); |
| | | //新建完成就是待发送状态 |
| | | serviceSubtask.setSendstate(2L); |
| | | serviceSubtask.setDeptcode(StringUtils.isNotEmpty(patTaskRelevance.getDeptcode())?patTaskRelevance.getDeptcode():serviceTaskVO.getDeptcode()); |
| | | serviceSubtask.setDeptname(StringUtils.isNotEmpty(patTaskRelevance.getDeptName())?patTaskRelevance.getDeptName():serviceTaskVO.getDeptname()); |
| | | serviceSubtask.setDeptcode(StringUtils.isNotEmpty(patTaskRelevance.getDeptcode()) ? patTaskRelevance.getDeptcode() : serviceTaskVO.getDeptcode()); |
| | | serviceSubtask.setDeptname(StringUtils.isNotEmpty(patTaskRelevance.getDeptName()) ? patTaskRelevance.getDeptName() : serviceTaskVO.getDeptname()); |
| | | serviceSubtask.setLeavehospitaldistrictcode(patTaskRelevance.getLeavehospitaldistrictcode()); |
| | | serviceSubtask.setLeavehospitaldistrictname(patTaskRelevance.getLeavehospitaldistrictname()); |
| | | serviceSubtask.setType(serviceTaskVO.getType()); |
| | |
| | | serviceSubtask.setUpdateBy(serviceTask.getCreateBy()); |
| | | serviceSubtask.setVisitTime(DateUtils.parseDate(serviceTaskVO.getShowTimeMorn())); |
| | | //如果立即执行,时间就是当前时间 |
| | | if(serviceTaskVO.getSendType()!=null&&serviceTaskVO.getSendType()==2) serviceSubtask.setVisitTime(new Date()); |
| | | if (serviceTaskVO.getSendType() != null && serviceTaskVO.getSendType() == 2) |
| | | serviceSubtask.setVisitTime(new Date()); |
| | | if (serviceTaskVO.getLongTask() != null && serviceTaskVO.getLongTask() == 1) { |
| | | serviceSubtask.setLongSendTime(patTaskRelevance.getLongSendTime()); |
| | | serviceSubtask.setVisitTime(patTaskRelevance.getVisittime()); |
| | |
| | | if (StringUtils.isNotEmpty(serviceTaskVO.getIcd10code())) { |
| | | String[] icd10codes = serviceTaskVO.getIcd10code().split(","); |
| | | String[] icd10names = serviceTaskVO.getIcd10name().split(","); |
| | | if(!active.equals("nhfy")&&!active.equals("druid")){ |
| | | if (!active.equals("nhfy") && !active.equals("druid")) { |
| | | if (icd10codes.length != icd10names.length) { |
| | | throw new BaseException("疾病编码和疾病名称数量不一致"); |
| | | } |
| | |
| | | } |
| | | return serviceSubtaskStatistic; |
| | | } |
| | | |
| | | /** |
| | | * 首次随访统计 |
| | | * |
| | |
| | | return resultMap; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> smsSubTask(Long subid) { |
| | | log.info("smsSubTask的入参为:{}", subid); |
| | | Map<String, Object> resultMap = new HashMap<>(); |
| | | resultMap.put("code", "500"); |
| | | resultMap.put("msg", "发送失败"); |
| | | |
| | | //获取患者的基本信息 |
| | | ServiceSubtask serviceSubtask = selectServiceSubtaskById(subid); |
| | | RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample(); |
| | | String patid = rsaPublicKeyExample.encryptedData(serviceSubtask.getPatid().toString(), pub_key); |
| | | String subId = rsaPublicKeyExample.encryptedData(serviceSubtask.getId().toString(), pub_key); |
| | | String taskId = rsaPublicKeyExample.encryptedData(serviceSubtask.getTaskid().toString(), pub_key); |
| | | |
| | | //发送数据的封装 |
| | | ServiceOutPath serviceOutPath = new ServiceOutPath(); |
| | | serviceOutPath.setParam1(taskId); |
| | | serviceOutPath.setParam2(patid); |
| | | serviceOutPath.setParam3(serviceSubtask.getTaskName()); |
| | | serviceOutPath.setParam6(subId); |
| | | serviceOutPath.setCreateTime(new Date()); |
| | | serviceOutPath.setOrgid(serviceSubtask.getOrgid()); |
| | | iServiceOutPathService.insertServiceOutPath(serviceOutPath); |
| | | String format = String.format("%03X", serviceOutPath.getId()); |
| | | serviceOutPath.setRadix(format); |
| | | serviceOutPath.setUpdateTime(new Date()); |
| | | iServiceOutPathService.updateServiceOutPath(serviceOutPath); |
| | | |
| | | SendMagParam sendMagParam = new SendMagParam(); |
| | | sendMagParam.setType("4"); |
| | | sendMagParam.setPhone(serviceSubtask.getPhone()); |
| | | sendMagParam.setUrl(StringUtils.isNotEmpty(req_path) ? localIP + ":" + req_path + "/wt?p=" + format : localIP + "/wt?p=" + format); |
| | | |
| | | SysConfig sysConfig = new SysConfig(); |
| | | |
| | | sysConfig = sysConfigMapper.checkConfigKeyUnique("wj.sms.template"); |
| | | |
| | | if (!Objects.isNull(sysConfig)) { |
| | | String smsContemt = sysConfig.getConfigValue(); |
| | | sendMagParam.setContent(smsContemt.replace("${wjurl}", sendMagParam.getUrl())); |
| | | } |
| | | |
| | | if (active.equals("nhfy")) { |
| | | Map<String, Object> smsResult = mtSubmitSmUtil.submitSm(sendMagParam.getPhone(), sendMagParam.getContent()); |
| | | if (smsResult != null && smsResult.get("result") != null && smsResult.get("result").toString().equals("0")) { |
| | | resultMap.put("code", "200"); |
| | | resultMap.put("msg", "发送成功"); |
| | | serviceSubtask.setRemark(StringUtils.isNotEmpty(serviceSubtask.getRemark()) ? serviceSubtask.getRemark() + ";短信发送成功" : "短信发送成功"); |
| | | log.info("是否发送成功:{}", serviceSubtask.getRemark()); |
| | | updateServiceSubtask(serviceSubtask); |
| | | } |
| | | } |
| | | return resultMap; |
| | | } |
| | | |
| | | private Boolean saveServiceSubtaskDetail(ServiceSubtask serviceSubtask) { |
| | | Boolean result = true; |
| | |
| | | #{state} |
| | | </foreach> |
| | | </if> |
| | | <if test="subIdList != null and sendstates.size() > 0"> |
| | | AND id IN |
| | | <foreach collection="subIdList" item="subId" open="(" separator="," close=")"> |
| | | #{subId} |
| | | </foreach> |
| | | </if> |
| | | <!-- taskIds筛选 --> |
| | | <if test="taskIds != null and taskIds.size() > 0"> |
| | | AND taskid IN |
| | |
| | | AND visit_time >= DATE(#{startTime}) |
| | | AND visit_time < DATE_ADD(DATE(#{endTime}), INTERVAL 1 DAY) |
| | | </if> |
| | | <if test="hospitalStartTime != null and hospitalEndTime!=null"> |
| | | AND endtime >= DATE(#{hospitalStartTime}) |
| | | AND endtime < DATE_ADD(DATE(#{hospitalEndTime}), INTERVAL 1 DAY) |
| | | </if> |
| | | <if test="visitDeptCode != null">and visit_dept_code = #{visitDeptCode}</if> |
| | | <if test="visitDeptName != null">and visit_dept_name = #{visitDeptName}</if> |
| | | <if test="isabnormal != null">and isabnormal = #{isabnormal}</if> |
| | |
| | | AND visit_time >= DATE(#{startTime}) |
| | | AND visit_time < DATE_ADD(DATE(#{endTime}), INTERVAL 1 DAY) |
| | | </if> |
| | | <if test="hospitalStartTime != null and hospitalEndTime!=null"> |
| | | AND endtime >= DATE(#{hospitalStartTime}) |
| | | AND endtime < DATE_ADD(DATE(#{hospitalEndTime}), INTERVAL 1 DAY) |
| | | </if> |
| | | <if test="visitDeptCode != null">and visit_dept_code = #{visitDeptCode}</if> |
| | | <if test="visitDeptName != null">and visit_dept_name = #{visitDeptName}</if> |
| | | <if test="isabnormal != null">and isabnormal = #{isabnormal}</if> |