Compare commits

...

16 Commits

Author SHA1 Message Date
zhangheng
78bf6fba43 批量任务 2026-05-11 14:43:17 +08:00
zhangheng
4562d9f2fc 批量任务 2026-05-09 18:04:49 +08:00
zhangheng
1b6653f024 批量任务 2026-04-30 14:11:07 +08:00
zhangheng
e72efecc69 批量任务 2026-04-29 22:34:41 +08:00
zhangheng
13e8b15117 批量任务 2026-04-29 22:33:39 +08:00
zhangheng
d7080dd8f3 批量任务 2026-04-29 17:09:16 +08:00
zhangheng
07c54ef256 批量任务 2026-04-29 16:46:49 +08:00
zhangheng
bbe1efc28a 批量任务与账单 2026-04-28 12:19:43 +08:00
zhangheng
d9cfee4494 专病路径修改 2026-04-08 10:20:56 +08:00
zhangheng
13b77fb9eb 首页根据医院查询修改 2026-04-07 18:06:25 +08:00
haoweina
efc9632033 Merge branch 'dev_hekousecondhospital' of http://8.131.93.145:54082/xinyilu/PostDischargePatientManage into dev_hekousecondhospital 2026-03-26 16:41:09 +08:00
haoweina
54fcf1b379 曜智外呼对接修改 2026-03-26 16:41:01 +08:00
zhangheng
ddb37fdc11 配置修改 2026-03-26 16:31:05 +08:00
haoweina
a86ae8e6bb 修改获取回调数据接口 2026-03-26 15:47:23 +08:00
zhangheng
0e0c1c090b 配置修改 2026-03-25 11:46:47 +08:00
zhangheng
83c28dd507 和并二院修改 2026-03-17 15:58:59 +08:00
100 changed files with 5764 additions and 243 deletions

View File

@ -9,13 +9,6 @@ spring:
url: jdbc:mysql://127.0.0.1:3306/post-discharge-hkey?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&allowMultiQueries=true
username: root
password: Hk2y!@#$
# 从库数据源
slave:
# 从数据源开关/默认关闭
enabled: true
url: jdbc:mysql://8.131.93.145:54081/aiob_callback?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&allowMultiQueries=true
username: root
password: 1qaz!@#$
hkhis:
# 从数据源开关/默认关闭
enabled: true
@ -61,4 +54,4 @@ spring:
merge-sql: true
wall:
config:
multi-statement-allow: true
multi-statement-allow: true

View File

@ -110,7 +110,7 @@ token:
# 令牌有效期默认30分钟
expireTime: 120
# 请求拦截白名单
ant-matchers: /postDischarge/**,/testMobile/**,/postDischargeApplet/**,/api/**,/manage/patientInfoimporttemp/**
ant-matchers: /postDischarge/**,/testMobile/**,/postDischargeApplet/**,/api/**,/manage/patientInfoimporttemp/**,/monitor/sendTextMessage/**
## MyBatis-Plus配置
mybatis-plus:
@ -239,11 +239,9 @@ aliyun-sms:
# 地域ID
regionId: cn-qingdao
# 阿里云登录确认验证模板-短信签名
signName: 新医路
# 阿里云登录确认验证模板-模板CODE
templateCode: SMS_152466667
# 阿里云登录确认验证模板-模板内容
templateContent: 验证码${code},您正在登录,若非本人操作,请勿泄露。
signName: 山东新医路信息科技有限公司
# 任务执行回调地址--正式
callBackUrl: http://47.104.245.3:8105/api/taskMessageBack
# 阿里云参数配置
aliyun-sms2:
@ -258,11 +256,9 @@ aliyun-sms2:
# 地域ID
regionId: cn-qingdao
# 阿里云登录确认验证模板-短信签名
signName: 山东新医路信息科技
# 阿里云登录确认验证模板-模板CODE
templateCode: SMS_499195589
# 阿里云登录确认验证模板-模板内容
templateContent: 尊敬的用户,馨医健康致电您未成功接通,请放心接听。也可通过馨医健康小程序消息中心查看相关信息;
signName: 河口区第二人民医院
# 任务执行回调地址--正式
callBackUrl: http://47.104.245.3:8105/api/taskMessageBack
# 小程序首页路径
applet-page-config:
@ -292,7 +288,7 @@ aiob:
accessKey: 9a61c68abf134ab9823e39f61f2c2f72
secretKey: 4287bfa1d5a34c229aacb5e056c94682
# 任务执行回调地址--测试
callBackUrl: http://192.168.4.7:19090/api/taskCallBack
callBackUrl: http://47.104.245.3:8105/api
xinyilu-database:
# 公共机构ID新医路用于宣教库公共库查询

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<!-- 日志存放路径 -->
<property name="log.path" value="D:\\PostDischarge\\logs"/>
<property name="log.path" value="E:\\PostDischarge\\logs"/>
<!-- 日志输出格式 -->
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>

View File

@ -220,10 +220,15 @@ public class Constants {
public static final String OUTPATIENT = "outpatient";
/**
* 门诊患者
* 患者导入
*/
public static final String PATIENT_INFO_IMPORT = "patientInfoImport";
/**
* 患者导入
*/
public static final String BATCH_SEND_TASK_INFO = "batchSendTaskInfo";
/**
* 预住院
*/

View File

@ -0,0 +1,41 @@
package com.xinelu.common.enums;
import lombok.Getter;
/**
* @Description 账单来源
* @Author zh
* @Date 2026-04-20
*/
@Getter
public enum BillSourceEnum {
/**
* 电话
*/
TELEPHONE("telephone","电话"),
/**
* 短信
*/
MESSAGE("message","短信"),
;
final private String info;
private final String code;
BillSourceEnum(String info, String code) {
this.info = info;
this.code = code;
}
public String getCode() {
return code;
}
public String getInfo() {
return info;
}
}

View File

@ -13,15 +13,30 @@ public enum NodeExecuteStatusEnum {
/**
* 已执行
*/
EXECUTED("EXECUTED"),
EXECUTED("EXECUTED", "已执行"),
/**
* 未执行
*/
UNEXECUTED("UNEXECUTED"),
UNEXECUTED("UNEXECUTED", "未执行"),
/**
* 执行中
*/
EXECUTING("EXECUTING", "执行中"),
;
final private String info;
private final String code;
NodeExecuteStatusEnum(String info) {
NodeExecuteStatusEnum(String info, String code) {
this.info = info;
this.code = code;
}
public String getCode() {
return code;
}
public String getInfo() {
return info;
}
}

View File

@ -0,0 +1,41 @@
package com.xinelu.common.enums;
public enum PersonnelTypeEnum {
/**
* 在院
*/
IN_HOSPITAL("IN_HOSPITAL", "在院"),
/**
* 门诊
*/
OUTPATIENT("OUTPATIENT", "门诊"),
/**
* 出院
*/
DISCHARGED("DISCHARGED", "出院"),
/**
* 体检
*/
PHYSICAL_EXAMINATION("PHYSICAL_EXAMINATION", "体检");
private final String code;
final private String info;
PersonnelTypeEnum(String code, String info) {
this.code = code;
this.info = info;
}
public String getCode() {
return code;
}
public String getInfo() {
return info;
}
}

View File

@ -13,7 +13,7 @@ public enum PhoneDialMethodEnum {
/**
* AI
* ALL
*/
ALL("ALL"),

View File

@ -0,0 +1,45 @@
package com.xinelu.common.utils;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* @description: 字符串获取工具类
* @author: zh
* @createDate: 2026-04-26
*/
public class BracketExtractor {
/**
* 提取字符串中所有内的文字返回List<String>
*
* @param input 原始字符串
* @return 包含所有内文字的列表不会为null若无匹配则返回空列表
*/
public static List<String> extractToList(String input) {
List<String> result = new ArrayList<>();
if (input == null || input.isEmpty()) {
return result;
}
// 正则匹配 后任意字符非贪婪直到
Pattern pattern = Pattern.compile("【(.*?)】");
Matcher matcher = pattern.matcher(input);
while (matcher.find()) {
result.add(matcher.group(1)); // group(1) 是括号内捕获的内容
}
return result;
}
/**
* 提取字符串中所有内的文字返回String[]
*
* @param input 原始字符串
* @return 包含所有内文字的数组
*/
public static String[] extractToArray(String input) {
List<String> list = extractToList(input);
return list.toArray(new String[0]);
}
}

View File

@ -35,14 +35,6 @@ public class DruidConfig {
return druidProperties.dataSource(dataSource);
}
@Bean
@ConfigurationProperties("spring.datasource.druid.slave")
@ConditionalOnProperty(prefix = "spring.datasource.druid.slave", name = "enabled", havingValue = "true")
public DataSource slaveDataSource(DruidProperties druidProperties) {
DruidDataSource dataSource = DruidDataSourceBuilder.create().build();
return druidProperties.dataSource(dataSource);
}
@Bean
@ConfigurationProperties("spring.datasource.druid.hkhis")
@ -57,7 +49,6 @@ public class DruidConfig {
public DynamicDataSource dataSource(DataSource masterDataSource) {
Map<Object, Object> targetDataSources = new HashMap<>();
targetDataSources.put(DataSourceType.MASTER.name(), masterDataSource);
setDataSource(targetDataSources, DataSourceType.SLAVE.name(), "slaveDataSource");
setDataSource(targetDataSources, DataSourceType.HKHIS.name(), "hkhisDataSource");
return new DynamicDataSource(masterDataSource, targetDataSources);
}

View File

@ -0,0 +1,135 @@
package com.xinelu.manage.controller.batchsendtaskinfo;
import com.xinelu.common.annotation.Log;
import com.xinelu.common.constant.Constants;
import com.xinelu.common.core.controller.BaseController;
import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.core.page.TableDataInfo;
import com.xinelu.common.enums.BusinessType;
import com.xinelu.common.utils.poi.ExcelUtil;
import com.xinelu.manage.domain.batchsendtaskinfo.BatchSendTaskInfo;
import com.xinelu.manage.dto.batchsendtaskinfo.BatchSendTaskDto;
import com.xinelu.manage.dto.batchsendtaskrecordinfo.BatchSendTaskRecordDto;
import com.xinelu.manage.service.batchsendtaskinfo.IBatchSendTaskInfoService;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Objects;
/**
* 批量推送任务信息Controller
*
* @author zh
* @date 2026-04-26
*/
@RestController
@RequestMapping("/system/batchSendTaskInfo")
public class BatchSendTaskInfoController extends BaseController {
@Resource
private IBatchSendTaskInfoService batchSendTaskInfoService;
/**
* 查询批量推送任务信息列表
*/
@PreAuthorize("@ss.hasPermi('system:batchSendTaskInfo:list')")
@GetMapping("/list")
public TableDataInfo list(BatchSendTaskDto batchSendTaskInfo) {
startPage();
List<BatchSendTaskInfo> list = batchSendTaskInfoService.selectBatchSendTaskInfoList(batchSendTaskInfo);
return getDataTable(list);
}
/**
* 查询批量推送任务信息列表
*/
@GetMapping("/batchSendTaskList")
public List<BatchSendTaskInfo> batchSendTaskList(BatchSendTaskDto batchSendTaskInfo) {
return batchSendTaskInfoService.selectBatchSendTaskInfoList(batchSendTaskInfo);
}
/**
* 导出批量推送任务信息列表
*/
@PreAuthorize("@ss.hasPermi('system:batchSendTaskInfo:export')")
@Log(title = "批量推送任务信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, BatchSendTaskDto batchSendTaskInfo) {
List<BatchSendTaskInfo> list = batchSendTaskInfoService.selectBatchSendTaskInfoList(batchSendTaskInfo);
ExcelUtil<BatchSendTaskInfo> util = new ExcelUtil<>(BatchSendTaskInfo.class);
util.exportExcel(response, list, "批量推送任务信息数据");
}
/**
* 获取批量推送任务信息详细信息
*/
@PreAuthorize("@ss.hasPermi('system:batchSendTaskInfo:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return AjaxResult.success(batchSendTaskInfoService.selectBatchSendTaskInfoById(id));
}
/**
* 新增批量推送任务信息
*/
@PreAuthorize("@ss.hasPermi('system:batchSendTaskInfo:add')")
@Log(title = "批量推送任务信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody BatchSendTaskInfo batchSendTaskInfo) {
return toAjax(batchSendTaskInfoService.insertBatchSendTaskInfo(batchSendTaskInfo));
}
/**
* 修改批量推送任务信息
*/
@PreAuthorize("@ss.hasPermi('system:batchSendTaskInfo:edit')")
@Log(title = "批量推送任务信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody BatchSendTaskInfo batchSendTaskInfo) {
return toAjax(batchSendTaskInfoService.updateBatchSendTaskInfo(batchSendTaskInfo));
}
/**
* 删除批量推送任务信息
*/
@PreAuthorize("@ss.hasPermi('system:batchSendTaskInfo:remove')")
@Log(title = "批量推送任务信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(batchSendTaskInfoService.deleteBatchSendTaskInfoByIds(ids));
}
@ApiOperation("批量推送任务信息导入")
@PostMapping("/batchSendTaskUpload")
public AjaxResult batchSendTaskUpload(MultipartFile file, Integer isDistinct, String importName) throws Exception {
//判断excel里面是否有数据/文件格式
if (Objects.isNull(file) || StringUtils.isBlank(file.getOriginalFilename())) {
return AjaxResult.error("请选择需要导入的文件!");
}
// 获取文件名
String filename = file.getOriginalFilename();
if (!filename.endsWith(Constants.XLSX) && !filename.endsWith(Constants.XLS)) {
return AjaxResult.error("导入文件格式不正确请导入xlsx或xls格式的文件");
}
ExcelUtil<BatchSendTaskInfo> util = new ExcelUtil<>(BatchSendTaskInfo.class);
List<BatchSendTaskInfo> list = util.importExcel(file.getInputStream());
return batchSendTaskInfoService.batchSendTaskUpload(list, isDistinct, filename, importName);
}
@ApiOperation("创建批量推送任务")
@PostMapping("/batchSend")
public AjaxResult batchSend(@RequestBody BatchSendTaskRecordDto batchSendTaskRecordDto) throws Exception {
return batchSendTaskInfoService.batchSend(batchSendTaskRecordDto);
}
@ApiOperation("标签信息")
@GetMapping("/getPhysicalExaminationLabel")
public List<String> getPhysicalExaminationLabel(){
return batchSendTaskInfoService.getPhysicalExaminationLabel();
}
}

View File

@ -0,0 +1,99 @@
package com.xinelu.manage.controller.batchsendtaskrecordinfo;
import com.xinelu.common.annotation.Log;
import com.xinelu.common.core.controller.BaseController;
import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.core.page.TableDataInfo;
import com.xinelu.common.enums.BusinessType;
import com.xinelu.common.utils.poi.ExcelUtil;
import com.xinelu.manage.domain.batchsendtaskrecordinfo.BatchSendTaskRecordInfo;
import com.xinelu.manage.service.batchsendtaskrecordinfo.IBatchSendTaskRecordInfoService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 批量推送任务记录Controller
*
* @author zh
* @date 2026-04-26
*/
@RestController
@RequestMapping("/system/batchSendTaskRecordInfo")
public class BatchSendTaskRecordInfoController extends BaseController {
@Resource
private IBatchSendTaskRecordInfoService batchSendTaskRecordInfoService;
/**
* 查询批量推送任务记录列表
*/
@PreAuthorize("@ss.hasPermi('system:batchSendTaskRecordInfo:list')")
@GetMapping("/list")
public TableDataInfo list(BatchSendTaskRecordInfo batchSendTaskRecordInfo) {
startPage();
List<BatchSendTaskRecordInfo> list = batchSendTaskRecordInfoService.selectBatchSendTaskRecordInfoList(batchSendTaskRecordInfo);
return getDataTable(list);
}
/**
* 导出批量推送任务记录列表
*/
@PreAuthorize("@ss.hasPermi('system:batchSendTaskRecordInfo:export')")
@Log(title = "批量推送任务记录", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, BatchSendTaskRecordInfo batchSendTaskRecordInfo) {
List<BatchSendTaskRecordInfo> list = batchSendTaskRecordInfoService.selectBatchSendTaskRecordInfoList(batchSendTaskRecordInfo);
ExcelUtil<BatchSendTaskRecordInfo> util = new ExcelUtil<>(BatchSendTaskRecordInfo.class);
util.exportExcel(response, list, "批量推送任务记录数据");
}
/**
* 获取批量推送任务记录详细信息
*/
@PreAuthorize("@ss.hasPermi('system:batchSendTaskRecordInfo:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return AjaxResult.success(batchSendTaskRecordInfoService.selectBatchSendTaskRecordInfoById(id));
}
/**
* 新增批量推送任务记录
*/
@PreAuthorize("@ss.hasPermi('system:batchSendTaskRecordInfo:add')")
@Log(title = "批量推送任务记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody BatchSendTaskRecordInfo batchSendTaskRecordInfo) {
return toAjax(batchSendTaskRecordInfoService.insertBatchSendTaskRecordInfo(batchSendTaskRecordInfo));
}
/**
* 修改批量推送任务记录
*/
@PreAuthorize("@ss.hasPermi('system:batchSendTaskRecordInfo:edit')")
@Log(title = "批量推送任务记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody BatchSendTaskRecordInfo batchSendTaskRecordInfo) {
return toAjax(batchSendTaskRecordInfoService.updateBatchSendTaskRecordInfo(batchSendTaskRecordInfo));
}
/**
* 删除批量推送任务记录
*/
@PreAuthorize("@ss.hasPermi('system:batchSendTaskRecordInfo:remove')")
@Log(title = "批量推送任务记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(batchSendTaskRecordInfoService.deleteBatchSendTaskRecordInfoByIds(ids));
}
/**
* 获取短信或电话模板
*/
@GetMapping("/getTemplate")
public List<BatchSendTaskRecordInfo> getTemplate(String batchTaskSource) {
return batchSendTaskRecordInfoService.getTemplate(batchTaskSource);
}
}

View File

@ -0,0 +1,94 @@
package com.xinelu.manage.controller.batchsendtaskvariableinfo;
import com.xinelu.common.annotation.Log;
import com.xinelu.common.core.controller.BaseController;
import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.core.page.TableDataInfo;
import com.xinelu.common.enums.BusinessType;
import com.xinelu.common.utils.poi.ExcelUtil;
import com.xinelu.manage.domain.batchsendtaskvariableinfo.BatchSendTaskVariableInfo;
import com.xinelu.manage.service.batchsendtaskvariableinfo.IBatchSendTaskVariableInfoService;
import org.springframework.security.access.prepost.PreAuthorize;
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 javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 批量推送任务记录变量属性Controller
*
* @author zh
* @date 2026-04-26
*/
@RestController
@RequestMapping("/system/batchSendTaskVariableInfo")
public class BatchSendTaskVariableInfoController extends BaseController {
@Resource
private IBatchSendTaskVariableInfoService batchSendTaskVariableInfoService;
/**
* 查询批量推送任务记录变量属性列表
*/
@PreAuthorize("@ss.hasPermi('system:batchSendTaskVariableInfo:list')")
//@GetMapping("/list")
public TableDataInfo list(BatchSendTaskVariableInfo batchSendTaskVariableInfo) {
startPage();
List<BatchSendTaskVariableInfo> list = batchSendTaskVariableInfoService.selectBatchSendTaskVariableInfoList(batchSendTaskVariableInfo);
return getDataTable(list);
}
/**
* 导出批量推送任务记录变量属性列表
*/
@PreAuthorize("@ss.hasPermi('system:batchSendTaskVariableInfo:export')")
@Log(title = "批量推送任务记录变量属性", businessType = BusinessType.EXPORT)
//@PostMapping("/export")
public void export(HttpServletResponse response, BatchSendTaskVariableInfo batchSendTaskVariableInfo) {
List<BatchSendTaskVariableInfo> list = batchSendTaskVariableInfoService.selectBatchSendTaskVariableInfoList(batchSendTaskVariableInfo);
ExcelUtil<BatchSendTaskVariableInfo> util = new ExcelUtil<>(BatchSendTaskVariableInfo.class);
util.exportExcel(response, list, "批量推送任务记录变量属性数据");
}
/**
* 获取批量推送任务记录变量属性详细信息
*/
@PreAuthorize("@ss.hasPermi('system:batchSendTaskVariableInfo:query')")
//@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return AjaxResult.success(batchSendTaskVariableInfoService.selectBatchSendTaskVariableInfoById(id));
}
/**
* 新增批量推送任务记录变量属性
*/
@PreAuthorize("@ss.hasPermi('system:batchSendTaskVariableInfo:add')")
@Log(title = "批量推送任务记录变量属性", businessType = BusinessType.INSERT)
//@PostMapping
public AjaxResult add(@RequestBody BatchSendTaskVariableInfo batchSendTaskVariableInfo) {
return toAjax(batchSendTaskVariableInfoService.insertBatchSendTaskVariableInfo(batchSendTaskVariableInfo));
}
/**
* 修改批量推送任务记录变量属性
*/
@PreAuthorize("@ss.hasPermi('system:batchSendTaskVariableInfo:edit')")
@Log(title = "批量推送任务记录变量属性", businessType = BusinessType.UPDATE)
//@PutMapping
public AjaxResult edit(@RequestBody BatchSendTaskVariableInfo batchSendTaskVariableInfo) {
return toAjax(batchSendTaskVariableInfoService.updateBatchSendTaskVariableInfo(batchSendTaskVariableInfo));
}
/**
* 删除批量推送任务记录变量属性
*/
@PreAuthorize("@ss.hasPermi('system:batchSendTaskVariableInfo:remove')")
@Log(title = "批量推送任务记录变量属性", businessType = BusinessType.DELETE)
//@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(batchSendTaskVariableInfoService.deleteBatchSendTaskVariableInfoByIds(ids));
}
}

View File

@ -0,0 +1,110 @@
package com.xinelu.manage.controller.billinfo;
import com.xinelu.common.annotation.Log;
import com.xinelu.common.core.controller.BaseController;
import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.core.page.TableDataInfo;
import com.xinelu.common.enums.BusinessType;
import com.xinelu.common.utils.poi.ExcelUtil;
import com.xinelu.manage.domain.billinfo.BillInfo;
import com.xinelu.manage.dto.billinfo.BillInfoDto;
import com.xinelu.manage.service.billinfo.IBillInfoService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 账单信息Controller
*
* @author zh
* @date 2026-04-16
*/
@RestController
@RequestMapping("/system/billInfo")
public class BillInfoController extends BaseController {
@Resource
private IBillInfoService billInfoService;
/**
* 查询账单信息列表
*/
@PreAuthorize("@ss.hasPermi('system:billInfo:list')")
@GetMapping("/list")
public TableDataInfo list(BillInfo billInfo) {
startPage();
List<BillInfo> list = billInfoService.selectBillInfoList(billInfo);
return getDataTable(list);
}
/**
* 导出账单信息列表
*/
@PreAuthorize("@ss.hasPermi('system:billInfo:export')")
@Log(title = "账单信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, BillInfo billInfo) {
List<BillInfo> list = billInfoService.selectBillInfoList(billInfo);
ExcelUtil<BillInfo> util = new ExcelUtil<>(BillInfo.class);
util.exportExcel(response, list, "账单信息数据");
}
/**
* 获取账单信息详细信息
*/
@PreAuthorize("@ss.hasPermi('system:billInfo:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return AjaxResult.success(billInfoService.selectBillInfoById(id));
}
/**
* 获取账单信息详细信息
*/
@GetMapping(value = "/view")
public AjaxResult view(String billCode) {
return AjaxResult.success(billInfoService.selectBillDetails(billCode));
}
/**
* 新增账单信息
*/
@PreAuthorize("@ss.hasPermi('system:billInfo:add')")
@Log(title = "账单信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody BillInfo billInfo) {
return toAjax(billInfoService.insertBillInfo(billInfo));
}
/**
* 修改账单信息
*/
@PreAuthorize("@ss.hasPermi('system:billInfo:edit')")
@Log(title = "账单信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody BillInfo billInfo) {
return toAjax(billInfoService.updateBillInfo(billInfo));
}
/**
* 删除账单信息
*/
@PreAuthorize("@ss.hasPermi('system:billInfo:remove')")
@Log(title = "账单信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(billInfoService.deleteBillInfoByIds(ids));
}
/**
* 导出账单明细信息列表
*/
@PostMapping("/exportDetails")
public void exportDetails(HttpServletResponse response, BillInfo billInfo) {
List<BillInfoDto> list = billInfoService.selectBillDetails(billInfo.getBillCode());
ExcelUtil<BillInfoDto> util = new ExcelUtil<>(BillInfoDto.class);
util.exportExcel(response, list, "账单信息数据");
}
}

View File

@ -44,31 +44,71 @@ public class ImportDownloadController {
throw new ServiceException("请选择文件类型!");
}
File file = null;
Resource resource;
String filePath;
switch (fileType) {
case Constants.AGENCY:
file = ResourceUtils.getFile("classpath:template/机构信息导入表.xlsx");
//file = ResourceUtils.getFile("classpath:template/机构信息导入表.xlsx");
resource = new ClassPathResource("classpath:template/机构信息导入表.xlsx");
filePath= this.getClass().getClassLoader().getResource("classpath:template/机构信息导入表.xlsx").getFile();
file= new File(filePath);
// 通过流讲文件复制到file中
FileUtils.copyToFile(resource.getInputStream(), file);
break;
case Constants.DEPARTMENT:
file = ResourceUtils.getFile("classpath:template/科室信息导入表.xlsx");
//file = ResourceUtils.getFile("classpath:template/科室信息导入表.xlsx");
resource = new ClassPathResource("classpath:template/科室信息导入表.xlsx");
filePath= this.getClass().getClassLoader().getResource("classpath:template/科室信息导入表.xlsx").getFile();
file= new File(filePath);
// 通过流讲文件复制到file中
FileUtils.copyToFile(resource.getInputStream(), file);
break;
case Constants.PRE_HOSPITALIZED: // 预住院患者
file = ResourceUtils.getFile("classpath:template/预住院患者信息导入表.xlsx");
//file = ResourceUtils.getFile("classpath:template/预住院患者信息导入表.xlsx");
resource = new ClassPathResource("classpath:template/预住院患者信息导入表.xlsx");
filePath= this.getClass().getClassLoader().getResource("classpath:template/预住院患者信息导入表.xlsx").getFile();
file= new File(filePath);
// 通过流讲文件复制到file中
FileUtils.copyToFile(resource.getInputStream(), file);
break;
case Constants.IN_HOSPITAL: // 在院患者
file = ResourceUtils.getFile("classpath:template/在院患者信息导入表.xlsx");
//file = ResourceUtils.getFile("classpath:template/在院患者信息导入表.xlsx");
resource = new ClassPathResource("classpath:template/在院患者信息导入表.xlsx");
filePath= this.getClass().getClassLoader().getResource("classpath:template/在院患者信息导入表.xlsx").getFile();
file= new File(filePath);
// 通过流讲文件复制到file中
FileUtils.copyToFile(resource.getInputStream(), file);
break;
case Constants.DISCHARGED: // 出院患者
file = ResourceUtils.getFile("classpath:template/出院患者信息导入表.xlsx");
//file = ResourceUtils.getFile("classpath:template/出院患者信息导入表.xlsx");
resource = new ClassPathResource("classpath:template/出院患者信息导入表.xlsx");
filePath= this.getClass().getClassLoader().getResource("classpath:template/出院患者信息导入表.xlsx").getFile();
file= new File(filePath);
// 通过流讲文件复制到file中
FileUtils.copyToFile(resource.getInputStream(), file);
break;
case Constants.OUTPATIENT: // 门诊患者
file = ResourceUtils.getFile("classpath:template/门诊患者信息导入表.xlsx");
//file = ResourceUtils.getFile("classpath:template/门诊患者信息导入表.xlsx");
resource = new ClassPathResource("classpath:template/门诊患者信息导入表.xlsx");
filePath= this.getClass().getClassLoader().getResource("classpath:template/门诊患者信息导入表.xlsx").getFile();
file= new File(filePath);
// 通过流讲文件复制到file中
FileUtils.copyToFile(resource.getInputStream(), file);
break;
case Constants.PATIENT_INFO_IMPORT: // 门诊患者
//本地服务
//file = ResourceUtils.getFile("classpath:template/OutpatientFollowUpRecords.xlsx");
//线上服务
Resource resource = new ClassPathResource("classpath:template/OutpatientFollowUpRecords.xlsx");
String filePath= this.getClass().getClassLoader().getResource("classpath:template/OutpatientFollowUpRecords.xlsx").getFile();
resource = new ClassPathResource("classpath:template/OutpatientFollowUpRecords.xlsx");
filePath= this.getClass().getClassLoader().getResource("classpath:template/OutpatientFollowUpRecords.xlsx").getFile();
file= new File(filePath);
// 通过流讲文件复制到file中
FileUtils.copyToFile(resource.getInputStream(), file);
break;
case Constants.BATCH_SEND_TASK_INFO:
//file = ResourceUtils.getFile("classpath:template/批量发送任务信息.xlsx");
resource = new ClassPathResource("classpath:template/批量发送任务信息.xlsx");
filePath= this.getClass().getClassLoader().getResource("classpath:template/批量发送任务信息.xlsx").getFile();
file= new File(filePath);
// 通过流讲文件复制到file中
FileUtils.copyToFile(resource.getInputStream(), file);

View File

@ -0,0 +1,92 @@
package com.xinelu.manage.controller.phonedialrecord;
import com.xinelu.common.annotation.Log;
import com.xinelu.common.core.controller.BaseController;
import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.core.page.TableDataInfo;
import com.xinelu.common.enums.BusinessType;
import com.xinelu.common.utils.poi.ExcelUtil;
import com.xinelu.manage.domain.phonedialrecord.PhoneDialRecord;
import com.xinelu.manage.service.phonedialrecord.IPhoneDialRecordService;
import com.xinelu.manage.vo.phonedialrecord.BillPhoneDialVo;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 电话拨打记录Controller
*
* @author zh
* @date 2026-04-17
*/
@RestController
@RequestMapping("/system/phoneDialRecord")
public class PhoneDialRecordController extends BaseController {
@Resource
private IPhoneDialRecordService phoneDialRecordService;
/**
* 查询电话拨打记录列表
*/
@PreAuthorize("@ss.hasPermi('system:phoneDialRecord:list')")
@GetMapping("/list")
public TableDataInfo list(BillPhoneDialVo phoneDialRecord) {
startPage();
List<BillPhoneDialVo> list = phoneDialRecordService.selectPhoneDialRecordList(phoneDialRecord);
return getDataTable(list);
}
/**
* 导出电话拨打记录列表
*/
@PreAuthorize("@ss.hasPermi('system:phoneDialRecord:export')")
@Log(title = "电话拨打记录", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, BillPhoneDialVo phoneDialRecord) {
List<BillPhoneDialVo> list = phoneDialRecordService.selectPhoneDialRecordList(phoneDialRecord);
ExcelUtil<BillPhoneDialVo> util = new ExcelUtil<>(BillPhoneDialVo.class);
util.exportExcel(response, list, "电话拨打记录数据");
}
/**
* 获取电话拨打记录详细信息
*/
@PreAuthorize("@ss.hasPermi('system:phoneDialRecord:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return AjaxResult.success(phoneDialRecordService.selectPhoneDialRecordById(id));
}
/**
* 新增电话拨打记录
*/
@PreAuthorize("@ss.hasPermi('system:phoneDialRecord:add')")
@Log(title = "电话拨打记录", businessType = BusinessType.INSERT)
//@PostMapping
public AjaxResult add(@RequestBody PhoneDialRecord phoneDialRecord) {
return toAjax(phoneDialRecordService.insertPhoneDialRecord(phoneDialRecord));
}
/**
* 修改电话拨打记录
*/
@PreAuthorize("@ss.hasPermi('system:phoneDialRecord:edit')")
@Log(title = "电话拨打记录", businessType = BusinessType.UPDATE)
//@PutMapping
public AjaxResult edit(@RequestBody PhoneDialRecord phoneDialRecord) {
return toAjax(phoneDialRecordService.updatePhoneDialRecord(phoneDialRecord));
}
/**
* 删除电话拨打记录
*/
@PreAuthorize("@ss.hasPermi('system:phoneDialRecord:remove')")
@Log(title = "电话拨打记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(phoneDialRecordService.deletePhoneDialRecordByIds(ids));
}
}

View File

@ -140,4 +140,12 @@ public class ScriptInfoController extends BaseController {
public AjaxResult updateScriptEdgeNode(@RequestBody ScriptVO scriptVO) {
return scriptInfoService.updateScriptEdgeNode(scriptVO);
}
/**
* 查询话术变量
*/
@GetMapping("/selectScriptVariable")
public AjaxResult selectScriptVariable(Long id) {
return scriptInfoService.selectScriptVariable(id);
}
}

View File

@ -0,0 +1,92 @@
package com.xinelu.manage.controller.shortmessagesendrecord;
import com.xinelu.common.annotation.Log;
import com.xinelu.common.core.controller.BaseController;
import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.core.page.TableDataInfo;
import com.xinelu.common.enums.BusinessType;
import com.xinelu.common.utils.poi.ExcelUtil;
import com.xinelu.manage.domain.shortmessagesendrecord.ShortMessageSendRecord;
import com.xinelu.manage.service.shortmessagesendrecord.IShortMessageSendRecordService;
import com.xinelu.manage.vo.shortmessagesendrecord.ShortMessageSendRecordVo;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 短信发送结果记录Controller
*
* @author zh
* @date 2026-04-17
*/
@RestController
@RequestMapping("/system/shortMessageSendRecord")
public class ShortMessageSendRecordController extends BaseController {
@Resource
private IShortMessageSendRecordService shortMessageSendRecordService;
/**
* 查询短信发送结果记录列表
*/
@PreAuthorize("@ss.hasPermi('system:shortMessageSendRecord:list')")
@GetMapping("/list")
public TableDataInfo list(ShortMessageSendRecordVo shortMessageSendRecord) {
startPage();
List<ShortMessageSendRecordVo> list = shortMessageSendRecordService.selectShortMessageSendRecordList(shortMessageSendRecord);
return getDataTable(list);
}
/**
* 导出短信发送结果记录列表
*/
@PreAuthorize("@ss.hasPermi('system:shortMessageSendRecord:export')")
@Log(title = "短信发送结果记录", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, ShortMessageSendRecordVo shortMessageSendRecord) {
List<ShortMessageSendRecordVo> list = shortMessageSendRecordService.selectShortMessageSendRecordList(shortMessageSendRecord);
ExcelUtil<ShortMessageSendRecordVo> util = new ExcelUtil<>(ShortMessageSendRecordVo.class);
util.exportExcel(response, list, "短信发送结果记录数据");
}
/**
* 获取短信发送结果记录详细信息
*/
@PreAuthorize("@ss.hasPermi('system:shortMessageSendRecord:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return AjaxResult.success(shortMessageSendRecordService.selectShortMessageSendRecordById(id));
}
/**
* 新增短信发送结果记录
*/
@PreAuthorize("@ss.hasPermi('system:shortMessageSendRecord:add')")
@Log(title = "短信发送结果记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ShortMessageSendRecord shortMessageSendRecord) {
return toAjax(shortMessageSendRecordService.insertShortMessageSendRecord(shortMessageSendRecord));
}
/**
* 修改短信发送结果记录
*/
@PreAuthorize("@ss.hasPermi('system:shortMessageSendRecord:edit')")
@Log(title = "短信发送结果记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ShortMessageSendRecord shortMessageSendRecord) {
return toAjax(shortMessageSendRecordService.updateShortMessageSendRecord(shortMessageSendRecord));
}
/**
* 删除短信发送结果记录
*/
@PreAuthorize("@ss.hasPermi('system:shortMessageSendRecord:remove')")
@Log(title = "短信发送结果记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(shortMessageSendRecordService.deleteShortMessageSendRecordByIds(ids));
}
}

View File

@ -74,7 +74,7 @@ public class SignPatientManageRouteController extends BaseController {
}
/**
* 新增签约患者管理任务路径手动创建任务
* 新增签约患者管理任务路径手动创建任务患者导入
*/
@Log(title = "签约患者管理任务路径", businessType = BusinessType.INSERT)
@PostMapping("/add")

View File

@ -117,4 +117,12 @@ public class TextMessageController extends BaseController {
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(textMessageService.deleteTextMessageByIds(ids));
}
/**
* 查询话术变量
*/
@GetMapping("/selectTextMessageVariable")
public AjaxResult selectTextMessageVariable(Long id) {
return textMessageService.selectTextMessageVariable(id);
}
}

View File

@ -0,0 +1,217 @@
package com.xinelu.manage.domain.batchsendtaskinfo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.xinelu.common.annotation.Excel;
import com.xinelu.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.time.LocalDateTime;
import java.util.Objects;
/**
* 批量推送任务信息对象 batch_send_task_info
*
* @author zh
* @date 2026-04-26
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "批量推送任务信息对象", description = "batch_send_task_info")
public class BatchSendTaskInfo extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 导入数据id
*/
private Long id;
/**
* 序号
*/
@ApiModelProperty(value = "序号")
private Long orderNum;
/**
* 流水号/导入编号
*/
@ApiModelProperty(value = "流水号/导入编号")
private String sn;
/**
* 导入批次名称
*/
@ApiModelProperty(value = "导入批次名称")
private String importName;
/**
* 团体名称
*/
@ApiModelProperty(value = "团体名称")
@Excel(name = "团体名称")
private String teamName;
/**
* 所属机构ID
*/
@ApiModelProperty(value = "所属机构ID")
private Long hospitalAgencyId;
/**
* 所属医院名称
*/
@ApiModelProperty(value = "所属医院名称")
@Excel(name = "所属医院")
private String hospitalAgencyName;
/**
* 匹配的科室ID
*/
@ApiModelProperty(value = "匹配的科室ID")
private Long departmentId;
/**
* 匹配的科室名称
*/
@ApiModelProperty(value = "匹配的科室名称")
@Excel(name = "所属科室")
private String departmentName;
/**
* 就诊/体检时间时间格式yyyy-MM-dd
*/
@ApiModelProperty(value = "就诊/出院/体检时间时间格式yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "就诊/出院/体检时间", width = 30, dateFormat = "yyyy-MM-dd")
private LocalDateTime visitDate;
/**
* 体检/门诊/住院号
*/
@ApiModelProperty(value = "体检/门诊/住院号")
@Excel(name = "体检/门诊/住院号")
private String inHospitalNumber;
/**
* 患者姓名
*/
@ApiModelProperty(value = "患者姓名")
@Excel(name = "姓名")
private String patientName;
/**
* 联系电话
*/
@ApiModelProperty(value = "联系电话")
@Excel(name = "联系电话")
private String patientPhone;
/**
* 性别
*/
@ApiModelProperty(value = "性别")
@Excel(name = "性别")
private String sex;
/**
* 年龄
*/
@ApiModelProperty(value = "年龄")
@Excel(name = "年龄")
private Long age;
/**
* 身份证号
*/
@ApiModelProperty(value = "身份证号")
@Excel(name = "身份证号")
private String cardNo;
/**
* 人员类型在院IN_HOSPITAL门诊OUTPATIENT出院DISCHARGED体检PHYSICAL_EXAMINATION
*/
@ApiModelProperty(value = "人员类型")
@Excel(name = "人员类型")
private String personnelType;
/**
* 人群id
*/
@ApiModelProperty(value = "人群id")
private Long crowdId;
/**
* 人群名称
*/
@ApiModelProperty(value = "人群名称")
@Excel(name = "所属人群")
private String crowdName;
/**
* 体检总结/主要诊断
*/
@ApiModelProperty(value = "体检总结/主要诊断")
@Excel(name = "总检结论")
private String physicalExaminationSummary;
/**
* 总结标签逗号隔断
*/
@ApiModelProperty(value = "总结标签,逗号隔断")
private String physicalExaminationLabel;
/**
* 删除标识0未删除1已删除
*/
private Integer delFlag;
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
BatchSendTaskInfo that = (BatchSendTaskInfo) o;
return Objects.equals(inHospitalNumber, that.inHospitalNumber) && Objects.equals(patientPhone, that.patientPhone);
}
@Override
public int hashCode() {
return Objects.hash(inHospitalNumber, patientPhone);
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("orderNum", getOrderNum())
.append("sn", getSn())
.append("importName", getImportName())
.append("teamName", getTeamName())
.append("hospitalAgencyId", getHospitalAgencyId())
.append("hospitalAgencyName", getHospitalAgencyName())
.append("departmentId", getDepartmentId())
.append("departmentName", getDepartmentName())
.append("visitDate", getVisitDate())
.append("inHospitalNumber", getInHospitalNumber())
.append("patientName", getPatientName())
.append("patientPhone", getPatientPhone())
.append("age", getAge())
.append("cardNo", getCardNo())
.append("crowdId", getCrowdId())
.append("crowdName", getCrowdName())
.append("physicalExaminationSummary", getPhysicalExaminationSummary())
.append("physicalExaminationLabel", getPhysicalExaminationLabel())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.toString();
}
}

View File

@ -0,0 +1,48 @@
package com.xinelu.manage.domain.batchsendtasklabelinfo;
import com.xinelu.common.annotation.Excel;
import com.xinelu.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 批量推送任务标签信息表对象 batch_send_task_label_info
*
* @author xinelu
* @date 2026-04-29
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "批量推送任务标签信息表对象", description = "batch_send_task_label_info")
public class BatchSendTaskLabelInfo extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 标签id
*/
private Long id;
/**
* 总结标签
*/
@ApiModelProperty(value = "总结标签")
@Excel(name = "总结标签")
private String physicalExaminationLabel;
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("physicalExaminationLabel", getPhysicalExaminationLabel())
.toString();
}
}

View File

@ -0,0 +1,135 @@
package com.xinelu.manage.domain.batchsendtaskrecordinfo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.xinelu.common.annotation.Excel;
import com.xinelu.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.time.LocalDateTime;
/**
* 批量推送任务记录对象 batch_send_task_record_info
*
* @author zh
* @date 2026-04-26
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "批量推送任务记录对象", description = "batch_send_task_record_info")
public class BatchSendTaskRecordInfo extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 批量发送任务id
*/
private Long id;
/**
* 批量发送任务编号
*/
@ApiModelProperty(value = "批量发送任务编号")
@Excel(name = "批量发送任务编号")
private String batchTaskNumber;
/**
* 批量发送任务名称
*/
@ApiModelProperty(value = "批量发送任务名称")
@Excel(name = "批量发送任务名称")
private String batchTaskName;
/**
* 批量任务BATCH_TASK,单个实时拔打任务ACTUAL_TIME_TASK
*/
@ApiModelProperty(value = "批量任务BATCH_TASK,单个实时拔打任务ACTUAL_TIME_TASK")
private String taskExecuteType;
/**
* 任务计划执行时间
*/
@ApiModelProperty(value = "任务计划执行时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "任务计划执行时间", width = 30, dateFormat = "yyyy-MM-dd")
private LocalDateTime nodePlanTime;
/**
* 模版类型短信message电话telephone
*/
@ApiModelProperty(value = "模版类型短信message电话telephone")
@Excel(name = "模版类型短信message电话telephone")
private String batchTaskSource;
/**
* 第三方平台模板ID
*/
@ApiModelProperty(value = "第三方平台模板ID")
private String robotPublishId;
/**
* 模板表id
*/
@ApiModelProperty(value = "模板表id")
private String templateId;
/**
* 电话模板名称
*/
@ApiModelProperty(value = "电话模板名称")
@Excel(name = "模板名称")
private String templateName;
/**
* 内容变量使用特殊符号进行标记
*/
@ApiModelProperty(value = "内容")
@Excel(name = "内容", readConverterExp = "变量使用特殊符号进行标记")
private String nodeContent;
/**
* 节点任务执行状态已执行EXECUTED未执行UNEXECUTED执行中EXECUTING
*/
@ApiModelProperty(value = "节点任务执行状态已执行EXECUTED未执行UNEXECUTED执行中EXECUTING")
@Excel(name = "节点任务执行状态已执行EXECUTED未执行UNEXECUTED执行中EXECUTING")
private String nodeExecuteStatus;
/**
* 总结标签逗号隔断
*/
@ApiModelProperty(value = "总结标签,逗号隔断")
@Excel(name = "总结标签")
private String physicalExaminationLabel;
/**
* 删除标识0未删除1已删除
*/
private Integer delFlag;
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("batchTaskNumber", getBatchTaskNumber())
.append("batchTaskName", getBatchTaskName())
.append("taskExecuteType", getTaskExecuteType())
.append("nodePlanTime", getNodePlanTime())
.append("batchTaskSource", getBatchTaskSource())
.append("robotPublishId", getRobotPublishId())
.append("templateId", getTemplateId())
.append("templateName", getTemplateName())
.append("nodeContent", getNodeContent())
.append("nodeExecuteStatus", getNodeExecuteStatus())
.append("physicalExaminationLabel", getPhysicalExaminationLabel())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.toString();
}
}

View File

@ -0,0 +1,68 @@
package com.xinelu.manage.domain.batchsendtaskvariableinfo;
import com.xinelu.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 批量推送任务记录变量属性对象 batch_send_task_variable_info
*
* @author zh
* @date 2026-04-26
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "批量推送任务记录变量属性对象", description = "batch_send_task_variable_info")
public class BatchSendTaskVariableInfo extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 导入数据id
*/
private Long id;
/**
* 变量
*/
@ApiModelProperty(value = "变量")
private String variable;
/**
* 变量属性
*/
@ApiModelProperty(value = "变量属性")
private String variableAttribute;
/**
* 批量推送任务记录表id
*/
@ApiModelProperty(value = "批量推送任务记录表id")
private Long batchSendTaskRecordId;
/**
* 批量推送任务表id
*/
@ApiModelProperty(value = "批量推送任务表id")
private Long batchSendTaskId;
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("variable", getVariable())
.append("variableAttribute", getVariableAttribute())
.append("batchSendTaskRecordId", getBatchSendTaskRecordId())
.append("batchSendTaskId", getBatchSendTaskId())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.toString();
}
}

View File

@ -0,0 +1,99 @@
package com.xinelu.manage.domain.billinfo;
import com.xinelu.common.annotation.Excel;
import com.xinelu.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.math.BigDecimal;
/**
* 账单信息对象 bill_info
*
* @author xinelu
* @date 2026-04-16
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "账单信息对象", description = "bill_info")
public class BillInfo extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 账单主键
*/
private Long id;
/**
* 账单编号
*/
@ApiModelProperty(value = "账单编号")
@Excel(name = "账单编号")
private String billCode;
/**
* 账单名称
*/
@ApiModelProperty(value = "账单名称")
@Excel(name = "账单名称")
private String billName;
/**
* 账单月份
*/
@ApiModelProperty(value = "账单月份")
@Excel(name = "账单月份")
private String billMonth;
/**
* 条数/时长
*/
@ApiModelProperty(value = "条数/时长")
@Excel(name = "条数/时长")
private BigDecimal pushLength;
/**
* 账单金额
*/
@ApiModelProperty(value = "账单金额")
@Excel(name = "账单金额")
private BigDecimal billExpense;
/**
* 缴费状态已缴费PAID未交费UNPAID_FEES
*/
@ApiModelProperty(value = "缴费状态已缴费PAID未交费UNPAID_FEES")
@Excel(name = "缴费状态已缴费PAID未交费UNPAID_FEES")
private String paymentStatus;
/**
* 账单来源短信message电话telephone
*/
@ApiModelProperty(value = "账单来源短信message电话telephone")
@Excel(name = "账单来源短信message电话telephone")
private String billSource;
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("billCode", getBillCode())
.append("billName", getBillName())
.append("billMonth", getBillMonth())
.append("pushLength", getPushLength())
.append("billExpense", getBillExpense())
.append("paymentStatus", getPaymentStatus())
.append("billSource", getBillSource())
.append("createTime", getCreateTime())
.toString();
}
}

View File

@ -12,6 +12,7 @@ import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
@ -37,21 +38,19 @@ public class PhoneDialRecord extends BaseEntity {
* 患者id
*/
@ApiModelProperty(value = "患者id")
@Excel(name = "患者id")
private Long patientId;
/**
* 签约患者管理任务节点表id
*/
@ApiModelProperty(value = "签约患者管理任务节点表id")
@Excel(name = "签约患者管理任务节点表id")
private Long manageRouteNodeId;
/**
* 患者手机号
*/
@ApiModelProperty(value = "患者手机号")
@Excel(name = "患者手机号")
@Excel(name = "手机号")
private String patientPhone;
/**
@ -66,42 +65,37 @@ public class PhoneDialRecord extends BaseEntity {
* 电话模板id
*/
@ApiModelProperty(value = "电话模板id")
@Excel(name = "电话模板id")
private String phoneTemplateId;
/**
* 电话模板名称
*/
@ApiModelProperty(value = "电话模板名称")
@Excel(name = "电话模板名称")
@Excel(name = "模板名称")
private String phoneTemplateName;
/**
* 替换标签之后的电话内容
*/
@ApiModelProperty(value = "替换标签之后的电话内容")
@Excel(name = "替换标签之后的电话内容")
private String messageNodeContent;
/**
* AI 自动外呼 COMMON人工随访电话否则为空
*/
@ApiModelProperty(value = "AI :自动外呼 或 COMMON人工随访电话否则为空")
@Excel(name = "AI :自动外呼 或 COMMON人工随访电话否则为空")
private String phoneDialMethod;
/**
* 推送结果状态码0表示成功
*/
@ApiModelProperty(value = "推送结果状态码")
@Excel(name = "推送结果状态码", readConverterExp = "0表示成功")
private Long errorCode;
/**
* 推送结果状态码success成功fail失败
*/
@ApiModelProperty(value = "推送结果状态码success成功fail失败")
@Excel(name = "推送结果状态码success成功fail失败")
private String errorStatus;
/**
@ -116,6 +110,33 @@ public class PhoneDialRecord extends BaseEntity {
@ApiModelProperty(value = "通话录音存储路径")
private String phoneDialRecordVideo;
/**
* 通话时长
*/
@ApiModelProperty(value = "通话时长")
@Excel(name = "通话时长")
private BigDecimal phoneDuration;
/**
* 通话费用
*/
@ApiModelProperty(value = "单价")
@Excel(name = "单价")
private BigDecimal phoneUnitPrice;
/**
* 通话费用
*/
@ApiModelProperty(value = "通话费用")
@Excel(name = "通话费用")
private BigDecimal phoneExpense;
/**
* 关联账单id
*/
@ApiModelProperty(value = "关联账单id")
private Long billId;
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
@ -134,6 +155,12 @@ public class PhoneDialRecord extends BaseEntity {
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("ctUuid", getCtUuid())
.append("phoneDialRecordVideo", getPhoneDialRecordVideo())
.append("phoneDuration", getPhoneDuration())
.append("phoneCost", getPhoneExpense())
.append("phoneUnitPrice", getPhoneUnitPrice())
.append("billId", getBillId())
.toString();
}
}

View File

@ -12,8 +12,8 @@ import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;
/**
* 短信发送结果记录对象 short_message_send_record
@ -38,21 +38,19 @@ public class ShortMessageSendRecord extends BaseEntity {
* 患者id
*/
@ApiModelProperty(value = "患者id")
@Excel(name = "患者id")
private Long patientId;
/**
* 签约患者管理任务节点表id
*/
@ApiModelProperty(value = "签约患者管理任务节点表id")
@Excel(name = "签约患者管理任务节点表id")
private Long manageRouteNodeId;
/**
* 患者手机号
*/
@ApiModelProperty(value = "患者手机号")
@Excel(name = "患者手机号")
@Excel(name = "手机号")
private String patientPhone;
/**
@ -67,37 +65,65 @@ public class ShortMessageSendRecord extends BaseEntity {
* 消息模板id
*/
@ApiModelProperty(value = "消息模板id")
@Excel(name = "消息模板id")
private String messageTemplateId;
/**
* 消息内容
*/
@ApiModelProperty(value = "消息内容")
@Excel(name = "消息内容")
private String messageNodeContent;
/**
* 推送结果状态码0表示成功
*/
@ApiModelProperty(value = "推送结果状态码")
@Excel(name = "推送结果状态码", readConverterExp = "0表示成功")
private Long errorCode;
/**
* 推送结果状态码success成功fail失败
*/
@ApiModelProperty(value = "推送结果状态码success成功fail失败")
@Excel(name = "推送结果状态码success成功fail失败")
private String errorStatus;
/**
* PHONE_MSG:电话同时发短信时COMMON:通用
*/
@ApiModelProperty(value = "PHONE_MSG:电话同时发短信时COMMON:通用")
@Excel(name = "PHONE_MSG:电话同时发短信时COMMON:通用")
private String messageType;
/**
* 短信长度
*/
@ApiModelProperty(value = "短信长度")
@Excel(name = "短信长度")
private Long messageLength;
/**
* 短信数量
*/
@ApiModelProperty(value = "短信数量")
@Excel(name = "短信数量")
private Long messageQuantity;
/**
* 短信单价
*/
@ApiModelProperty(value = "短信单价")
@Excel(name = "短信单价")
private BigDecimal messageUnitPrice;
/**
* 短信价格
*/
@ApiModelProperty(value = "短信价格")
@Excel(name = "短信价格")
private BigDecimal messageExpense;
/**
* 关联账单id
*/
@ApiModelProperty(value = "关联账单id")
private Long billId;
@Override
public String toString() {
@ -116,6 +142,11 @@ public class ShortMessageSendRecord extends BaseEntity {
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("messageType", getMessageType())
.append("messageLength", getMessageLength())
.append("messageQuantity", getMessageQuantity())
.append("messageUnitPrice", getMessageUnitPrice())
.append("messageExpense", getMessageExpense())
.append("billId", getBillId())
.toString();
}
}

View File

@ -13,7 +13,6 @@ import lombok.NoArgsConstructor;
import javax.validation.constraints.NotBlank;
import java.time.LocalDateTime;
import java.time.LocalTime;
/**
* 签约患者管理任务路径对象 sign_patient_manage_route
@ -140,4 +139,11 @@ public class SignPatientManageRoute extends BaseEntity {
@Excel(name = "导入患者主表ID")
private String importMainId;
/** 批量推送任务表id */
@ApiModelProperty(value = "批量推送任务表id")
private Long batchSendTaskRecordId;
/** 批量推送信息表id */
@ApiModelProperty(value = "批量推送信息表id")
private Long batchSendTaskId;
}

View File

@ -0,0 +1,55 @@
package com.xinelu.manage.domain.textmessage;
import lombok.Data;
/**
* 对SendSms和SendBatchSms短信发送接口设置回执接收
*/
@Data
public class SmsReport {
/**
* 转发给运营商的时间
*/
private String send_time;
/**
* 收到运营商回执的时间
*/
private String report_time;
/**
* 是否发送成功取值true发送成功false发送失败
*/
private Boolean success;
/**
* 错误码信息描述
*/
private String err_msg;
/**
* 错误码
*/
private String err_code;
/**
* 短信接收号码
*/
private String phone_number;
/**
* 短信长度
*/
private String sms_size;
/**
* 发送回执ID即发送流水号
*/
private String biz_id;
/**
* 用发送短信SendSms接口时传的outId
*/
private String out_id;
}

View File

@ -0,0 +1,38 @@
package com.xinelu.manage.domain.textmessage;
import com.alibaba.fastjson.JSONArray;
import lombok.Data;
import java.util.Date;
/**
* 阿里云回调服务数据库表
*/
@Data
public class TaskMessageBackEntity {
/**
* 主键
*/
private Integer id;
/**
* 回调数据
*/
private JSONArray messageBackData;
/**
* 已读状态0未读1已读
*/
private Integer readState;
/**
* 创建时间
*/
private Date createDate;
/**
* 修改时间
*/
private Date updateDate;
}

View File

@ -112,6 +112,10 @@ public class TextMessage extends BaseEntity {
*/
private Long sourceTemplateId;
/**
* 短信变量竖线隔开来源于创建短息任务页面
*/
private String variables;
@Override
public String toString() {
@ -128,6 +132,7 @@ public class TextMessage extends BaseEntity {
.append("textMessageStatus", getTextMessageStatus())
.append("textMessageSort", getTextMessageSort())
.append("textMessageRemark", getTextMessageRemark())
.append("variables", getVariables())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())

View File

@ -44,6 +44,11 @@ public class CreateTaskDto {
*/
private List<Integer> forbidDialDate;
/**
* 禁呼时间默认为空表示不限制禁呼时间 [{"forbidDialStartTime":"12:00","forbidDialEndTime":"13:00"},{"forbidDialStartTime":"14:00","forbidDialEndTime":"15:00"}]
*/
private List<RetryRuleList> forbidDialTime;
/**
* 重试次数整数 N 3默认为空表示不重试
*/
@ -64,12 +69,21 @@ public class CreateTaskDto {
*/
private Boolean isOpenPhoneDown = false;
/**
* 是否开启重复号码过滤,true为开启false为关闭
*/
private Boolean isOpenRepeatFilter = true;
/**
* 号码类型过滤 1-400号码2-800号码3-手机号码4-固话5-95号码6-96号码7-其他
*/
private List<Integer> numTypeFilterList;
/**
* 是否开启任务回调 默认false
*/
private Boolean taskDataCallback;
/**
* 任务级回调地址设置
*/

View File

@ -0,0 +1,20 @@
package com.xinelu.manage.dto.aiob;
import lombok.Data;
/**
* 禁呼时间
*/
@Data
public class RetryRuleList {
/**
* 禁呼开始时间
*/
private String forbidDialStartTime;
/**
* 禁呼截止时间
*/
private String forbidDialEndTime;
}

View File

@ -0,0 +1,21 @@
package com.xinelu.manage.dto.batchsendtaskinfo;
import com.xinelu.manage.domain.batchsendtaskinfo.BatchSendTaskInfo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDate;
@Data
public class BatchSendTaskDto extends BatchSendTaskInfo {
@ApiModelProperty(value = "开始时间")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate startDate;
@ApiModelProperty(value = "结束时间")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate endDate;
}

View File

@ -0,0 +1,40 @@
package com.xinelu.manage.dto.batchsendtaskrecordinfo;
import com.xinelu.manage.domain.batchsendtaskinfo.BatchSendTaskInfo;
import com.xinelu.manage.domain.signpatientmanageroutenode.SignPatientManageRouteNode;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
import java.util.Map;
/**
* 批量任务创建dto
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class BatchSendTaskRecordDto extends SignPatientManageRouteNode {
/**
* 总结标签逗号隔断
*/
@ApiModelProperty(value = "总结标签,逗号隔断")
private String physicalExaminationLabel;
/**
* 模版类型短信message电话telephone
*/
@ApiModelProperty(value = "模版类型短信message电话telephone")
private String batchTaskSource;
List<BatchSendTaskInfo> list;
/**
* 名单的变量variable map模板需要用到的变量,{"key1": "value1","key2": "value2"}
*/
private String variable;
private Map<String, String> vars;
}

View File

@ -0,0 +1,64 @@
package com.xinelu.manage.dto.billinfo;
import com.xinelu.common.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDate;
/**
* 账单dto
*/
@Data
public class BillInfoDto {
/**
* 患者姓名
*/
@ApiModelProperty(value = "患者姓名")
@Excel(name = "姓名")
private String patientName;
/**
* 患者电话
*/
@ApiModelProperty(value = "患者电话")
@Excel(name = "电话")
private String patientPhone;
/**
* 模版名称
*/
@ApiModelProperty(value = "模版名称")
@Excel(name = "模版名称")
private String template;
/**
* 推送时间
*/
@ApiModelProperty(value = "推送时间")
@Excel(name = "推送时间")
private LocalDate pushTime;
/**
* 条数/时长
*/
@ApiModelProperty(value = "条数/时长")
@Excel(name = "条数/时长")
private BigDecimal pushLength;
/**
* 单价
*/
@ApiModelProperty(value = "单价")
@Excel(name = "单价")
private BigDecimal unitPrice;
/**
* 费用
*/
@ApiModelProperty(value = "费用")
@Excel(name = "费用")
private BigDecimal expense;
}

View File

@ -31,4 +31,9 @@ public class SmsInfoDTO {
* 模板中的变量替换JSON串
*/
private JSONObject templateParam;
/**
* 外部流水扩展字段
*/
private String OutId;
}

View File

@ -120,4 +120,9 @@ public class TextMessageTaskDTO extends BaseEntity {
@ApiModelProperty(value = "适用任务类型字典表ids")
private Long[] suitTaskTypeIds;
/**
* 短信变量竖线隔开来源于创建短息任务页面
*/
private String variables;
}

View File

@ -11,7 +11,7 @@ import org.apache.ibatis.annotations.Param;
* @Author haown
* @Date 2025-12-23 15:45
*/
@DataSource(DataSourceType.SLAVE)
public interface AIOBCallbackMapper {
List<AIOBCallbackEntity> getList(AIOBCallbackEntity query);

View File

@ -0,0 +1,70 @@
package com.xinelu.manage.mapper.batchsendtaskinfo;
import com.xinelu.manage.domain.batchsendtaskinfo.BatchSendTaskInfo;
import com.xinelu.manage.dto.batchsendtaskinfo.BatchSendTaskDto;
import java.util.List;
/**
* 批量推送任务信息Mapper接口
*
* @author zh
* @date 2026-04-26
*/
public interface BatchSendTaskInfoMapper {
/**
* 查询批量推送任务信息
*
* @param id 批量推送任务信息主键
* @return 批量推送任务信息
*/
BatchSendTaskInfo selectBatchSendTaskInfoById(Long id);
/**
* 查询批量推送任务信息列表
*
* @param batchSendTaskInfo 批量推送任务信息
* @return 批量推送任务信息集合
*/
List<BatchSendTaskInfo> selectBatchSendTaskInfoList(BatchSendTaskDto batchSendTaskInfo);
/**
* 新增批量推送任务信息
*
* @param batchSendTaskInfo 批量推送任务信息
* @return 结果
*/
int insertBatchSendTaskInfo(BatchSendTaskInfo batchSendTaskInfo);
/**
* 修改批量推送任务信息
*
* @param batchSendTaskInfo 批量推送任务信息
* @return 结果
*/
int updateBatchSendTaskInfo(BatchSendTaskInfo batchSendTaskInfo);
/**
* 删除批量推送任务信息
*
* @param id 批量推送任务信息主键
* @return 结果
*/
int deleteBatchSendTaskInfoById(Long id);
/**
* 批量删除批量推送任务信息
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
int deleteBatchSendTaskInfoByIds(Long[] ids);
/**
* 新增患者信息
*
* @param batchSendTaskInfoList 批量任务信息
* @return 结果
*/
int insertBatchSendTaskInfoList(List<BatchSendTaskInfo> batchSendTaskInfoList);
}

View File

@ -0,0 +1,70 @@
package com.xinelu.manage.mapper.batchsendtasklabelinfo;
import com.xinelu.manage.domain.batchsendtasklabelinfo.BatchSendTaskLabelInfo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 批量推送任务标签信息表Mapper接口
*
* @author xinelu
* @date 2026-04-29
*/
public interface BatchSendTaskLabelInfoMapper {
/**
* 查询批量推送任务标签信息表
*
* @param id 批量推送任务标签信息表主键
* @return 批量推送任务标签信息表
*/
BatchSendTaskLabelInfo selectBatchSendTaskLabelInfoById(Long id);
/**
* 查询批量推送任务标签信息表列表
*
* @param batchSendTaskLabelInfo 批量推送任务标签信息表
* @return 批量推送任务标签信息表集合
*/
List<BatchSendTaskLabelInfo> selectBatchSendTaskLabelInfoList(BatchSendTaskLabelInfo batchSendTaskLabelInfo);
/**
* 新增批量推送任务标签信息表
*
* @param batchSendTaskLabelInfo 批量推送任务标签信息表
* @return 结果
*/
int insertBatchSendTaskLabelInfo(BatchSendTaskLabelInfo batchSendTaskLabelInfo);
/**
* 修改批量推送任务标签信息表
*
* @param batchSendTaskLabelInfo 批量推送任务标签信息表
* @return 结果
*/
int updateBatchSendTaskLabelInfo(BatchSendTaskLabelInfo batchSendTaskLabelInfo);
/**
* 删除批量推送任务标签信息表
*
* @param id 批量推送任务标签信息表主键
* @return 结果
*/
int deleteBatchSendTaskLabelInfoById(Long id);
/**
* 批量删除批量推送任务标签信息表
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
int deleteBatchSendTaskLabelInfoByIds(Long[] ids);
/**
* 新增患者信息
*
* @param labels 批量任务信息
* @return 结果
*/
int insertBatchSendTaskLabelInfList(@Param("list") List<String> labels);
}

View File

@ -0,0 +1,70 @@
package com.xinelu.manage.mapper.batchsendtaskrecordinfo;
import com.xinelu.manage.domain.batchsendtaskrecordinfo.BatchSendTaskRecordInfo;
import com.xinelu.manage.vo.batchsendtaskrecordinfo.BatchSendTaskRecordVo;
import java.util.List;
/**
* 批量推送任务记录Mapper接口
*
* @author zh
* @date 2026-04-26
*/
public interface BatchSendTaskRecordInfoMapper {
/**
* 查询批量推送任务记录
*
* @param id 批量推送任务记录主键
* @return 批量推送任务记录
*/
BatchSendTaskRecordInfo selectBatchSendTaskRecordInfoById(Long id);
/**
* 查询批量推送任务记录列表
*
* @param batchSendTaskRecordInfo 批量推送任务记录
* @return 批量推送任务记录集合
*/
List<BatchSendTaskRecordInfo> selectBatchSendTaskRecordInfoList(BatchSendTaskRecordInfo batchSendTaskRecordInfo);
/**
* 新增批量推送任务记录
*
* @param batchSendTaskRecordInfo 批量推送任务记录
* @return 结果
*/
int insertBatchSendTaskRecordInfo(BatchSendTaskRecordInfo batchSendTaskRecordInfo);
/**
* 修改批量推送任务记录
*
* @param batchSendTaskRecordInfo 批量推送任务记录
* @return 结果
*/
int updateBatchSendTaskRecordInfo(BatchSendTaskRecordInfo batchSendTaskRecordInfo);
/**
* 删除批量推送任务记录
*
* @param id 批量推送任务记录主键
* @return 结果
*/
int deleteBatchSendTaskRecordInfoById(Long id);
/**
* 批量删除批量推送任务记录
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
int deleteBatchSendTaskRecordInfoByIds(Long[] ids);
/**
* 查询批量推送任务记录
*
* @param id 批量推送任务记录主键
* @return 批量推送任务记录
*/
BatchSendTaskRecordVo selectBatchSendTaskRecordVoById(Long id);
}

View File

@ -0,0 +1,69 @@
package com.xinelu.manage.mapper.batchsendtaskvariableinfo;
import com.xinelu.manage.domain.batchsendtaskvariableinfo.BatchSendTaskVariableInfo;
import java.util.List;
/**
* 批量推送任务记录变量属性Mapper接口
*
* @author zh
* @date 2026-04-26
*/
public interface BatchSendTaskVariableInfoMapper {
/**
* 查询批量推送任务记录变量属性
*
* @param id 批量推送任务记录变量属性主键
* @return 批量推送任务记录变量属性
*/
BatchSendTaskVariableInfo selectBatchSendTaskVariableInfoById(Long id);
/**
* 查询批量推送任务记录变量属性列表
*
* @param batchSendTaskVariableInfo 批量推送任务记录变量属性
* @return 批量推送任务记录变量属性集合
*/
List<BatchSendTaskVariableInfo> selectBatchSendTaskVariableInfoList(BatchSendTaskVariableInfo batchSendTaskVariableInfo);
/**
* 新增批量推送任务记录变量属性
*
* @param batchSendTaskVariableInfo 批量推送任务记录变量属性
* @return 结果
*/
int insertBatchSendTaskVariableInfo(BatchSendTaskVariableInfo batchSendTaskVariableInfo);
/**
* 修改批量推送任务记录变量属性
*
* @param batchSendTaskVariableInfo 批量推送任务记录变量属性
* @return 结果
*/
int updateBatchSendTaskVariableInfo(BatchSendTaskVariableInfo batchSendTaskVariableInfo);
/**
* 删除批量推送任务记录变量属性
*
* @param id 批量推送任务记录变量属性主键
* @return 结果
*/
int deleteBatchSendTaskVariableInfoById(Long id);
/**
* 批量删除批量推送任务记录变量属性
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
int deleteBatchSendTaskVariableInfoByIds(Long[] ids);
/**
* 批量添加变量表
*
* @param batchSendTaskVariableInfos 变量信息
* @return int
*/
int insertBatchSendTaskVariableInfos(List<BatchSendTaskVariableInfo> batchSendTaskVariableInfos);
}

View File

@ -0,0 +1,69 @@
package com.xinelu.manage.mapper.billinfo;
import com.xinelu.manage.domain.billinfo.BillInfo;
import java.util.List;
/**
* 账单信息Mapper接口
*
* @author zh
* @date 2026-04-16
*/
public interface BillInfoMapper {
/**
* 查询账单信息
*
* @param id 账单信息主键
* @return 账单信息
*/
BillInfo selectBillInfoById(Long id);
/**
* 查询账单信息
*
* @param code 账单信息
* @return 账单信息
*/
BillInfo selectBillInfoByCode(String code);
/**
* 查询账单信息列表
*
* @param billInfo 账单信息
* @return 账单信息集合
*/
List<BillInfo> selectBillInfoList(BillInfo billInfo);
/**
* 新增账单信息
*
* @param billInfo 账单信息
* @return 结果
*/
int insertBillInfo(BillInfo billInfo);
/**
* 修改账单信息
*
* @param billInfo 账单信息
* @return 结果
*/
int updateBillInfo(BillInfo billInfo);
/**
* 删除账单信息
*
* @param id 账单信息主键
* @return 结果
*/
int deleteBillInfoById(Long id);
/**
* 批量删除账单信息
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
int deleteBillInfoByIds(Long[] ids);
}

View File

@ -117,7 +117,7 @@ public interface PatientInfoMapper {
* @param now 当前时间
* @return int
*/
int getPatientInfoCountByCreateTime(@Param("firstDay") LocalDate firstDay, @Param("now") LocalDate now);
int getPatientInfoCountByCreateTime(@Param("firstDay") LocalDate firstDay, @Param("now") LocalDate now, @Param("hospitalAgencyId")Long hospitalAgencyId);
/**
* 根据签约时间查询患者数量
@ -126,14 +126,14 @@ public interface PatientInfoMapper {
* @param now 当前时间
* @return int
*/
int selectPatientInfoCountBySignTime(@Param("firstDay") LocalDate firstDay, @Param("now") LocalDate now);
int selectPatientInfoCountBySignTime(@Param("firstDay") LocalDate firstDay, @Param("now") LocalDate now, @Param("hospitalAgencyId")Long hospitalAgencyId);
/**
* 已签约总数
*
* @return int
*/
int selectPatientSignTotalCount();
int selectPatientSignTotalCount(Long hospitalAgencyId);
/**
* 服务中患者总数

View File

@ -48,5 +48,5 @@ public interface PatientPreHospitalizationMapper {
* @param now 当前时间
* @return int
*/
int getPatientPreHospitalizationCountByCreateTime(@Param("firstDay") LocalDate firstDay, @Param("now") LocalDate now);
int getPatientPreHospitalizationCountByCreateTime(@Param("firstDay") LocalDate firstDay, @Param("now") LocalDate now, @Param("hospitalAgencyId")Long hospitalAgencyId);
}

View File

@ -1,9 +1,12 @@
package com.xinelu.manage.mapper.phonedialrecord;
import com.xinelu.manage.domain.phonedialrecord.PhoneDialRecord;
import com.xinelu.manage.dto.billinfo.BillInfoDto;
import com.xinelu.manage.dto.phonedialrecord.PhoneDialRecordDto;
import com.xinelu.manage.dto.statistics.FollowUpRateDto;
import com.xinelu.manage.vo.phonedialrecord.BillPhoneDialVo;
import com.xinelu.manage.vo.phonedialrecord.PhoneDialRecordVo;
import java.util.List;
/**
@ -29,6 +32,14 @@ public interface PhoneDialRecordMapper {
*/
List<PhoneDialRecord> selectPhoneDialRecordList(PhoneDialRecord phoneDialRecord);
/**
* 查询电话拨打记录列表
*
* @param phoneDialRecord 电话拨打记录
* @return 电话拨打记录集合
*/
List<BillPhoneDialVo> selectPhoneDialRecords(BillPhoneDialVo phoneDialRecord);
/**
* 新增电话拨打记录
*
@ -86,4 +97,12 @@ public interface PhoneDialRecordMapper {
* @return 电话拨打记录集合
*/
List<PhoneDialRecord> getNoVideoList(PhoneDialRecordDto phoneDialRecordDto);
/**
* 根据账单id查询电话推送记录
*
* @param billId 账单id
* @return BillInfoDto
*/
List<BillInfoDto> selectPhoneDialStatisticByBillId(Long billId);
}

View File

@ -81,4 +81,19 @@ public interface ScriptInfoMapper {
int deleteScriptInfoNode(Long id);
int deleteScriptInfoEdge(Long id);
/**
* 查询话术信息列表
* @return 话术信息集合
*/
List<ScriptInfo> selectScriptInfos();
/**
* 根据机器人编号查询变量信息
*
* @param robotPublishId
* @return String
*/
String selectVariablesByRobotPublishId(String robotPublishId);
}

View File

@ -1,7 +1,9 @@
package com.xinelu.manage.mapper.shortmessagesendrecord;
import com.xinelu.manage.domain.shortmessagesendrecord.ShortMessageSendRecord;
import com.xinelu.manage.dto.billinfo.BillInfoDto;
import com.xinelu.manage.dto.statistics.FollowUpRateDto;
import com.xinelu.manage.vo.shortmessagesendrecord.ShortMessageSendRecordVo;
import com.xinelu.manage.vo.statistics.MessageSendVo;
import com.xinelu.manage.vo.subscribemessagesendrecord.RecordNum;
import org.apache.ibatis.annotations.Param;
@ -31,6 +33,14 @@ public interface ShortMessageSendRecordMapper {
*/
List<ShortMessageSendRecord> selectShortMessageSendRecordList(ShortMessageSendRecord shortMessageSendRecord);
/**
* 查询短信发送结果记录列表
*
* @param shortMessageSendRecord 短信发送结果记录
* @return 短信发送结果记录集合
*/
List<ShortMessageSendRecordVo> selectShortMessageSendRecords(ShortMessageSendRecordVo shortMessageSendRecord);
/**
* 新增短信发送结果记录
*
@ -72,4 +82,20 @@ public interface ShortMessageSendRecordMapper {
List<RecordNum> selectShortMessageRecordCountByManageRouteNodeIds(@Param("manageRouteNodeIds") List<Long> manageRouteNodeIds);
List<MessageSendVo> getStatisticNum(FollowUpRateDto queryDto);
/**
* 根据账单id查询短信推送记录
*
* @param billId 账单id
* @return BillInfoDto
*/
List<BillInfoDto> selectShortMessageRecordByBillId(Long billId);
/**
* 批量新增短信发送结果记录
*
* @param shortMessageSendRecords 短信发送结果记录
* @return 结果
*/
int insertShortMessageSendRecords(List<ShortMessageSendRecord> shortMessageSendRecords);
}

View File

@ -173,6 +173,15 @@ public interface SignPatientManageRouteNodeMapper {
*/
int updateNodeExecuteStatusByIds(@Param("manageRouteNodeIds") List<Long> manageRouteNodeIds, @Param("nodeExecuteStatus") String nodeExecuteStatus, @Param("appletStatus") String appletStatus, @Param("messageStatus") String messageStatus, @Param("officialStatus") String officialStatus, @Param("nodeFinishDate") LocalDateTime nodeFinishDate);
/**
* 修改执行状态
*
* @param manageRouteNodeIds 节点id
* @param taskIdExt 第三方返回的任务ID
* @return int
*/
int updateTaskIdExtBuIds(@Param("manageRouteNodeIds") List<Long> manageRouteNodeIds, @Param("taskIdExt") String taskIdExt);
/**
* 根据创建时间查询任务数量
*
@ -197,7 +206,7 @@ public interface SignPatientManageRouteNodeMapper {
*
* @return PatientAndNode
*/
List<PatientAndNode> selectNodeExecuteStatus();
List<PatientAndNode> selectNodeExecuteStatus(Long hospitalAgencyId);
List<PatientFollowUpPlanVo> getFollowUpPlan(FollowUpRateDto queryDto);

View File

@ -100,4 +100,11 @@ public interface TextMessageMapper {
* 检查除当前记录之外是否存在同名的短信模板名称
*/
int countByTextMessageNameExcludingId(@Param("id") Long id, @Param("departmentId") Long departmentId, @Param("textMessageName") String textMessageName);
/**
* 查询短信模板信息列表
*
* @return 短信模板信息集合
*/
List<TextMessageVO> selectTextMessages();
}

View File

@ -1,11 +1,24 @@
package com.xinelu.manage.service.aiob.impl;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.xinelu.common.exception.ServiceException;
import com.xinelu.manage.domain.aiob.AIOBCallbackEntity;
import com.xinelu.manage.mapper.aiob.AIOBCallbackMapper;
import com.xinelu.manage.service.aiob.IAIOBCallbackService;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
/**
* @description: 阿里云服务器百度外呼回调Service实现
@ -13,16 +26,46 @@ import org.springframework.stereotype.Service;
* @create: 2025-12-23 15:30
**/
@Service
@Slf4j
public class AIOBCallbackServiceImpl implements IAIOBCallbackService {
@Resource
private AIOBCallbackMapper aiobCallbackMapper;
@Value("${aiob.callBackUrl}")
private String callBackUrl;
@Override
public List<AIOBCallbackEntity> getList(AIOBCallbackEntity query) {
return aiobCallbackMapper.getList(query);
// 接口获取外呼回调数据app
List<AIOBCallbackEntity> callbackEntityList = new ArrayList<>();
HttpEntity<JSONObject> requestEntity = new HttpEntity<>((JSONObject) JSON.toJSON(query));
RestTemplate restTemplate = new RestTemplate();
ResponseEntity<String> responseEntity = restTemplate.exchange(callBackUrl + "/getList", HttpMethod.POST, requestEntity, String.class);
JSONObject object = JSON.parseObject(responseEntity.getBody());
if (object == null || object.getInteger("code") == null || object.getInteger("code") != 0) {
return null;
}
if (object.containsKey("data")) {
JSONArray data = object.getJSONArray("data");
if (data != null && data.size() > 0) {
callbackEntityList = data.toJavaList(AIOBCallbackEntity.class);
}
}
return callbackEntityList;
}
@Override public Integer updateReadState(Integer readState, Integer id) {
return aiobCallbackMapper.updateReadState(readState, id);
log.info("修改百度外呼回调数据已读状态--id{}", id);
JSONObject TaskCallbackUpdateDto = new JSONObject();
TaskCallbackUpdateDto.fluentPut("id", id).fluentPut("readState", readState);
HttpEntity<JSONObject> requestEntity = new HttpEntity<>(TaskCallbackUpdateDto);
RestTemplate restTemplate = new RestTemplate();
ResponseEntity<String> responseEntity = restTemplate.exchange(callBackUrl + "/updateReadState", HttpMethod.POST, requestEntity, String.class);
JSONObject object = JSON.parseObject(responseEntity.getBody());
if (object == null || object.getInteger("code") == null || object.getInteger("code") != 0) {
log.info("修改百度外呼回调数据已读状态失败--id{},原因:{}", id, object.getString("message"));
return null;
}
log.info("修改百度外呼回调数据已读状态成功--id{}", id);
return 1;
}
@Override public Integer deleteData() {

View File

@ -5,7 +5,6 @@ import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.aliyuncs.exceptions.ClientException;
import com.sun.media.jfxmedia.logging.Logger;
import com.xinelu.common.config.AliYunSmsTwoConfig;
import com.xinelu.common.config.SystemBusinessConfig;
import com.xinelu.common.constant.*;
@ -13,6 +12,7 @@ import com.xinelu.common.core.redis.RedisCache;
import com.xinelu.common.enums.*;
import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.StringUtils;
import com.xinelu.manage.domain.batchsendtaskinfo.BatchSendTaskInfo;
import com.xinelu.manage.domain.patientinfo.PatientInfo;
import com.xinelu.manage.domain.patientquestionoptionresult.PatientQuestionOptionResult;
import com.xinelu.manage.domain.patientquestionsubjectresult.PatientQuestionSubjectResult;
@ -31,6 +31,7 @@ import com.xinelu.manage.domain.textmessage.TextMessage;
import com.xinelu.manage.dto.aiob.*;
import com.xinelu.manage.dto.patientquestionsubmitresult.PatientQuestionSubmitResultDTO;
import com.xinelu.manage.dto.smssend.SmsInfoDTO;
import com.xinelu.manage.mapper.batchsendtaskinfo.BatchSendTaskInfoMapper;
import com.xinelu.manage.mapper.labelfieldcontent.LabelFieldContentMapper;
import com.xinelu.manage.mapper.patientinfo.PatientInfoMapper;
import com.xinelu.manage.mapper.patientquestionoptionresult.PatientQuestionOptionResultMapper;
@ -143,6 +144,8 @@ public class AIOBServiceImpl implements IAIOBService {
private ScriptInfoTaskInfoMapper scriptInfoTaskInfoMapper;
@Resource
private PatientVisitRecordMapper patientVisitRecordMapper;
@Resource
private BatchSendTaskInfoMapper batchSendTaskInfoMapper;
/**
* @description 获取外呼平台accessToken
@ -366,7 +369,6 @@ public class AIOBServiceImpl implements IAIOBService {
signPatientManageRouteNode.setNodeFinishStatus(NodeExecuteResultStatusEnum.FAILURE.getInfo());
}
}
}
} else {
signPatientManageRouteNode.setPhoneNodeExecuteResultStatus(NodeExecuteResultStatusEnum.SUCCESS.getInfo());
@ -398,24 +400,25 @@ public class AIOBServiceImpl implements IAIOBService {
patientTaskExecuteRecord.setPatientId(signPatientManageRoute.getPatientId());
patientTaskExecuteRecord.setPatientName(signPatientManageRoute.getPatientName());
// 签约记录
SignPatientRecord signPatientRecord = signPatientRecordMapper.selectByPrimaryKey(signPatientManageRoute.getSignPatientRecordId());
SignPatientRecord signPatientRecord = new SignPatientRecord();
//针对batch_send_task_info表未签约未存patient_info表处理
if (Objects.nonNull(signPatientManageRoute.getSignPatientRecordId())){
signPatientRecord = signPatientRecordMapper.selectByPrimaryKey(signPatientManageRoute.getSignPatientRecordId());
}
if (ObjectUtils.isNotEmpty(signPatientRecord)) {
patientTaskExecuteRecord.setVisitRecordId(signPatientRecord.getPatientVisitRecordId());
}
// 发送短信
if (needSendSms) {
//System.out.println("发送短信-------------------------------------------");
sendSms(signPatientManageRoute.getPatientId(), signPatientManageRouteNode);
sendSms(signPatientManageRoute.getPatientId(), signPatientManageRouteNode, signPatientManageRoute.getBatchSendTaskId());
}
// 重拨
if (needRedial) {
if (ObjectUtils.isNotEmpty(signPatientRecord)) {
PatientVisitRecord patientVisitRecord = patientVisitRecordMapper.selectPatientVisitRecordById(signPatientRecord.getPatientVisitRecordId());
redialInfoSave(signPatientManageRouteNode, patientVisitRecord);
}
else
{
} else {
redialInfoSave(signPatientManageRouteNode, null);
}
}
@ -445,10 +448,12 @@ public class AIOBServiceImpl implements IAIOBService {
phoneDialRecordMapper.insertPhoneDialRecord(phoneDialRecord);
// 修改任务统计表数据
if (patientTaskExecuteRecordMapper.insertPatientTaskExecuteRecord(patientTaskExecuteRecord) > 0) {
// 修改任务统计表数据 添加getPatientId判断针对batch_send_task_info表未签约未存patient_info表处理
if (Objects.nonNull(patientTaskExecuteRecord.getPatientId()) && patientTaskExecuteRecordMapper.insertPatientTaskExecuteRecord(patientTaskExecuteRecord) > 0) {
// 任务统计表修改
patientTaskStatisticsService.updateNum(signPatientManageRoute.getPatientId(), TaskStatisticsTypeConstants.TASK_EXECUTE_NUM, 1);
if (Objects.nonNull(signPatientManageRoute.getPatientId())){
patientTaskStatisticsService.updateNum(signPatientManageRoute.getPatientId(), TaskStatisticsTypeConstants.TASK_EXECUTE_NUM, 1);
}
}
//接通状态1-已接通
@ -503,12 +508,21 @@ public class AIOBServiceImpl implements IAIOBService {
return obj.getOrDefault("downloadUrl", null).toString();
}
private void sendSms(Long patientId, SignPatientManageRouteNode signPatientManageRouteNode) throws ClientException {
private void sendSms(Long patientId, SignPatientManageRouteNode signPatientManageRouteNode, Long batchSendTaskId) throws ClientException {
TextMessage textMessage = textMessageMapper.selectTextMessageById(signPatientManageRouteNode.getPhoneMessageTemplateId());
if (ObjectUtils.isNotEmpty(textMessage)) {
// 发送短信
SmsInfoDTO smsInfoDTO = new SmsInfoDTO();
String patientPhone = signPatientManageRouteMapper.selectPatientPhone(patientId);
String patientPhone = null;
//添加PatientId判断针对batch_send_task_info表未签约未存patient_info表处理
if (Objects.nonNull(patientId)){
patientPhone = signPatientManageRouteMapper.selectPatientPhone(patientId);
}
if (Objects.nonNull(patientId)){
//批量推送任务表没有同步到患者表所以分开查询
BatchSendTaskInfo batchSendTaskInfo = batchSendTaskInfoMapper.selectBatchSendTaskInfoById(batchSendTaskId);
patientPhone = batchSendTaskInfo.getPatientPhone();
}
smsInfoDTO.setPhoneNumbers(patientPhone);
smsInfoDTO.setSignName(aliYunSmsTwoConfig.getSignName());
smsInfoDTO.setTemplateCode(textMessage.getTextMessageId());

View File

@ -0,0 +1,91 @@
package com.xinelu.manage.service.batchsendtaskinfo;
import com.aliyuncs.exceptions.ClientException;
import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.manage.domain.batchsendtaskinfo.BatchSendTaskInfo;
import com.xinelu.manage.dto.batchsendtaskinfo.BatchSendTaskDto;
import com.xinelu.manage.dto.batchsendtaskrecordinfo.BatchSendTaskRecordDto;
import java.util.List;
/**
* 批量推送任务信息Service接口
*
* @author zh
* @date 2026-04-26
*/
public interface IBatchSendTaskInfoService {
/**
* 查询批量推送任务信息
*
* @param id 批量推送任务信息主键
* @return 批量推送任务信息
*/
BatchSendTaskInfo selectBatchSendTaskInfoById(Long id);
/**
* 查询批量推送任务信息列表
*
* @param batchSendTaskInfo 批量推送任务信息
* @return 批量推送任务信息集合
*/
List<BatchSendTaskInfo> selectBatchSendTaskInfoList(BatchSendTaskDto batchSendTaskInfo);
/**
* 新增批量推送任务信息
*
* @param batchSendTaskInfo 批量推送任务信息
* @return 结果
*/
int insertBatchSendTaskInfo(BatchSendTaskInfo batchSendTaskInfo);
/**
* 修改批量推送任务信息
*
* @param batchSendTaskInfo 批量推送任务信息
* @return 结果
*/
int updateBatchSendTaskInfo(BatchSendTaskInfo batchSendTaskInfo);
/**
* 批量删除批量推送任务信息
*
* @param ids 需要删除的批量推送任务信息主键集合
* @return 结果
*/
int deleteBatchSendTaskInfoByIds(Long[] ids);
/**
* 删除批量推送任务信息信息
*
* @param id 批量推送任务信息主键
* @return 结果
*/
int deleteBatchSendTaskInfoById(Long id);
/**
* 患者导入
*
* @param list 患者信息结合
* @param isDistinct 1表示自动去重0表示不去重
* @param filename 附件名称
* @return AjaxResult
*/
AjaxResult batchSendTaskUpload(List<BatchSendTaskInfo> list, Integer isDistinct, String filename, String importName);
/**
* 创建批量推送任务
*
* @param batchSendTaskRecordDto 任务信息
* @return AjaxResult
* @throws ClientException
*/
AjaxResult batchSend(BatchSendTaskRecordDto batchSendTaskRecordDto) throws ClientException, IllegalAccessException;
/**
* 搜素框添加 标签信息
*
* @return String
*/
List<String> getPhysicalExaminationLabel();
}

View File

@ -0,0 +1,611 @@
package com.xinelu.manage.service.batchsendtaskinfo.impl;
import com.alibaba.fastjson2.JSONObject;
import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
import com.aliyuncs.dysmsapi.model.v20170525.SendSmsRequest;
import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse;
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.profile.DefaultProfile;
import com.aliyuncs.profile.IClientProfile;
import com.xinelu.common.config.AliYunSmsTwoConfig;
import com.xinelu.common.constant.Constants;
import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.core.domain.entity.SysDictData;
import com.xinelu.common.core.domain.entity.SysUser;
import com.xinelu.common.enums.*;
import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.BracketExtractor;
import com.xinelu.common.utils.SecurityUtils;
import com.xinelu.common.utils.regex.RegexUtil;
import com.xinelu.manage.domain.agency.Agency;
import com.xinelu.manage.domain.batchsendtaskinfo.BatchSendTaskInfo;
import com.xinelu.manage.domain.batchsendtasklabelinfo.BatchSendTaskLabelInfo;
import com.xinelu.manage.domain.batchsendtaskrecordinfo.BatchSendTaskRecordInfo;
import com.xinelu.manage.domain.batchsendtaskvariableinfo.BatchSendTaskVariableInfo;
import com.xinelu.manage.domain.dialtime.DialTime;
import com.xinelu.manage.domain.signpatientmanageroute.SignPatientManageRoute;
import com.xinelu.manage.domain.signpatientmanageroutenode.SignPatientManageRouteNode;
import com.xinelu.manage.dto.aiob.CreateTaskDto;
import com.xinelu.manage.dto.aiob.CustomerInfoDto;
import com.xinelu.manage.dto.aiob.ImportTaskDto;
import com.xinelu.manage.dto.aiob.RetryRuleList;
import com.xinelu.manage.dto.batchsendtaskinfo.BatchSendTaskDto;
import com.xinelu.manage.dto.batchsendtaskrecordinfo.BatchSendTaskRecordDto;
import com.xinelu.manage.dto.smssend.SmsInfoDTO;
import com.xinelu.manage.mapper.agency.AgencyMapper;
import com.xinelu.manage.mapper.batchsendtaskinfo.BatchSendTaskInfoMapper;
import com.xinelu.manage.mapper.batchsendtasklabelinfo.BatchSendTaskLabelInfoMapper;
import com.xinelu.manage.mapper.batchsendtaskrecordinfo.BatchSendTaskRecordInfoMapper;
import com.xinelu.manage.mapper.batchsendtaskvariableinfo.BatchSendTaskVariableInfoMapper;
import com.xinelu.manage.mapper.patientinfoimportmain.PatientInfoImportMainMapper;
import com.xinelu.manage.mapper.scriptInfo.ScriptInfoMapper;
import com.xinelu.manage.mapper.signpatientmanageroute.SignPatientManageRouteMapper;
import com.xinelu.manage.mapper.signpatientmanageroutenode.SignPatientManageRouteNodeMapper;
import com.xinelu.manage.service.aiob.IAIOBService;
import com.xinelu.manage.service.batchsendtaskinfo.IBatchSendTaskInfoService;
import com.xinelu.system.mapper.SysUserMapper;
import com.xinelu.system.service.ISysDictTypeService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.ListUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.lang.reflect.Field;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;
/**
* 批量推送任务信息Service业务层处理
*
* @author zh
* @date 2026-04-26
*/
@Slf4j
@Service
public class BatchSendTaskInfoServiceImpl implements IBatchSendTaskInfoService {
@Resource
private BatchSendTaskInfoMapper batchSendTaskInfoMapper;
@Resource
private SysUserMapper sysUserMapper;
@Resource
private AgencyMapper agencyMapper;
@Resource
private SignPatientManageRouteMapper signPatientManageRouteMapper;
@Resource
private BatchSendTaskRecordInfoMapper batchSendTaskRecordInfoMapper;
@Resource
private BatchSendTaskVariableInfoMapper batchSendTaskVariableInfoMapper;
@Resource
private SignPatientManageRouteNodeMapper signPatientManageRouteNodeMapper;
@Resource
private IAIOBService aiobService;
@Resource
private PatientInfoImportMainMapper patientInfoImportMainMapper;
@Resource
private ISysDictTypeService iSysDictTypeService;
@Resource
private RegexUtil regexUtil;
@Resource
private AliYunSmsTwoConfig aliYunSmsTwoConfig;
@Value("${aiob.callBackUrl}")
private String callBackUrl;
@Resource
private BatchSendTaskLabelInfoMapper batchSendTaskLabelInfoMapper;
@Resource
private ScriptInfoMapper scriptInfoMapper;
private static final String SUCCESS = "OK";
/**
* 查询批量推送任务信息
*
* @param id 批量推送任务信息主键
* @return 批量推送任务信息
*/
@Override
public BatchSendTaskInfo selectBatchSendTaskInfoById(Long id) {
return batchSendTaskInfoMapper.selectBatchSendTaskInfoById(id);
}
/**
* 查询批量推送任务信息列表
*
* @param batchSendTaskInfo 批量推送任务信息
* @return 批量推送任务信息
*/
@Override
public List<BatchSendTaskInfo> selectBatchSendTaskInfoList(BatchSendTaskDto batchSendTaskInfo) {
List<BatchSendTaskInfo> batchSendTaskInfos = batchSendTaskInfoMapper.selectBatchSendTaskInfoList(batchSendTaskInfo);
if (CollectionUtils.isEmpty(batchSendTaskInfos)) {
return new ArrayList<>();
}
for (BatchSendTaskInfo sendTaskInfo : batchSendTaskInfos) {
if (sendTaskInfo.getPersonnelType().equals(PersonnelTypeEnum.DISCHARGED.getCode())) {
sendTaskInfo.setPersonnelType(PersonnelTypeEnum.DISCHARGED.getInfo());
}
if (sendTaskInfo.getPersonnelType().equals(PersonnelTypeEnum.OUTPATIENT.getCode())) {
sendTaskInfo.setPersonnelType(PersonnelTypeEnum.OUTPATIENT.getInfo());
}
if (sendTaskInfo.getPersonnelType().equals(PersonnelTypeEnum.IN_HOSPITAL.getCode())) {
sendTaskInfo.setPersonnelType(PersonnelTypeEnum.IN_HOSPITAL.getInfo());
}
if (sendTaskInfo.getPersonnelType().equals(PersonnelTypeEnum.PHYSICAL_EXAMINATION.getCode())) {
sendTaskInfo.setPersonnelType(PersonnelTypeEnum.PHYSICAL_EXAMINATION.getInfo());
}
}
return batchSendTaskInfos;
}
/**
* 新增批量推送任务信息
*
* @param batchSendTaskInfo 批量推送任务信息
* @return 结果
*/
@Override
public int insertBatchSendTaskInfo(BatchSendTaskInfo batchSendTaskInfo) {
batchSendTaskInfo.setCreateTime(LocalDateTime.now());
if (batchSendTaskInfo.getPersonnelType().equals(PersonnelTypeEnum.DISCHARGED.getInfo())) {
batchSendTaskInfo.setPersonnelType(PersonnelTypeEnum.DISCHARGED.getCode());
}
if (batchSendTaskInfo.getPersonnelType().equals(PersonnelTypeEnum.OUTPATIENT.getInfo())) {
batchSendTaskInfo.setPersonnelType(PersonnelTypeEnum.OUTPATIENT.getCode());
}
if (batchSendTaskInfo.getPersonnelType().equals(PersonnelTypeEnum.IN_HOSPITAL.getInfo())) {
batchSendTaskInfo.setPersonnelType(PersonnelTypeEnum.IN_HOSPITAL.getCode());
}
if (batchSendTaskInfo.getPersonnelType().equals(PersonnelTypeEnum.PHYSICAL_EXAMINATION.getInfo())) {
batchSendTaskInfo.setPersonnelType(PersonnelTypeEnum.PHYSICAL_EXAMINATION.getCode());
}
return batchSendTaskInfoMapper.insertBatchSendTaskInfo(batchSendTaskInfo);
}
/**
* 修改批量推送任务信息
*
* @param batchSendTaskInfo 批量推送任务信息
* @return 结果
*/
@Override
public int updateBatchSendTaskInfo(BatchSendTaskInfo batchSendTaskInfo) {
return batchSendTaskInfoMapper.updateBatchSendTaskInfo(batchSendTaskInfo);
}
/**
* 批量删除批量推送任务信息
*
* @param ids 需要删除的批量推送任务信息主键
* @return 结果
*/
@Override
public int deleteBatchSendTaskInfoByIds(Long[] ids) {
return batchSendTaskInfoMapper.deleteBatchSendTaskInfoByIds(ids);
}
/**
* 删除批量推送任务信息信息
*
* @param id 批量推送任务信息主键
* @return 结果
*/
@Override
public int deleteBatchSendTaskInfoById(Long id) {
return batchSendTaskInfoMapper.deleteBatchSendTaskInfoById(id);
}
@Override
public AjaxResult batchSendTaskUpload(List<BatchSendTaskInfo> list, Integer isDistinct, String filename, String importName) {
if (CollectionUtils.isEmpty(list) || list.size() == 0) {
return AjaxResult.success("导入数据列表是空!");
}
if (Objects.isNull(isDistinct) || isDistinct == 1) {
list = list.stream().filter(Objects::nonNull).distinct().collect(Collectors.toList());
}
List<BatchSendTaskInfo> collect = list.stream().filter(Objects::nonNull).filter(item -> StringUtils.isEmpty(item.getPatientName()) || StringUtils.isEmpty(item.getPatientPhone()) || StringUtils.isEmpty(item.getPersonnelType())).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(collect)) {
return AjaxResult.error("用户信息不完整,姓名均不允许为空,请完善后重试;");
}
SysUser sysUser = sysUserMapper.selectUserById(SecurityUtils.getUserId());
Agency agency = agencyMapper.selectAgencyById(sysUser.getHospitalAgencyId());
if (Objects.isNull(agency) || StringUtils.isEmpty(agency.getNodeType())) {
return AjaxResult.error("该账号无所属医院信息,请先配置该账号所属的医院信息!");
}
//流水号
String sn = "batch_" + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"));
List<String> stringList = new ArrayList<>();
//遍历塞值
for (BatchSendTaskInfo batchSendTaskInfo : list) {
batchSendTaskInfo.setSn(sn);
batchSendTaskInfo.setHospitalAgencyId(agency.getId());
batchSendTaskInfo.setHospitalAgencyName(agency.getAgencyName());
batchSendTaskInfo.setImportName(importName);
batchSendTaskInfo.setCreateTime(LocalDateTime.now());
batchSendTaskInfo.setCreateBy(SecurityUtils.getUsername());
batchSendTaskInfo.setDelFlag(0);
if (batchSendTaskInfo.getPersonnelType().equals(PersonnelTypeEnum.DISCHARGED.getInfo())) {
batchSendTaskInfo.setPersonnelType(PersonnelTypeEnum.DISCHARGED.getCode());
}
if (batchSendTaskInfo.getPersonnelType().equals(PersonnelTypeEnum.OUTPATIENT.getInfo())) {
batchSendTaskInfo.setPersonnelType(PersonnelTypeEnum.OUTPATIENT.getCode());
}
if (batchSendTaskInfo.getPersonnelType().equals(PersonnelTypeEnum.IN_HOSPITAL.getInfo())) {
batchSendTaskInfo.setPersonnelType(PersonnelTypeEnum.IN_HOSPITAL.getCode());
}
if (batchSendTaskInfo.getPersonnelType().equals(PersonnelTypeEnum.PHYSICAL_EXAMINATION.getInfo())) {
batchSendTaskInfo.setPersonnelType(PersonnelTypeEnum.PHYSICAL_EXAMINATION.getCode());
}
if (StringUtils.isBlank(batchSendTaskInfo.getDepartmentName())) {
batchSendTaskInfo.setDepartmentName("");
}
if (StringUtils.isBlank(batchSendTaskInfo.getTeamName())) {
batchSendTaskInfo.setTeamName("");
}
//取标签
if (StringUtils.isNotBlank(batchSendTaskInfo.getPhysicalExaminationSummary())) {
String[] strings = BracketExtractor.extractToArray(batchSendTaskInfo.getPhysicalExaminationSummary());
stringList.addAll(Arrays.asList(strings));
String result = Arrays.toString(strings).replaceAll("^\\[|\\]$", "");
batchSendTaskInfo.setPhysicalExaminationLabel(result);
if (batchSendTaskInfo.getPhysicalExaminationSummary().length() > 999) {
batchSendTaskInfo.setPhysicalExaminationSummary(batchSendTaskInfo.getPhysicalExaminationSummary().substring(0, 999));
}
}
}
//处理标签
List<BatchSendTaskLabelInfo> batchSendTaskLabelInfos = batchSendTaskLabelInfoMapper.selectBatchSendTaskLabelInfoList(null);
List<String> data = batchSendTaskLabelInfos.stream().filter(Objects::nonNull).map(BatchSendTaskLabelInfo::getPhysicalExaminationLabel).collect(Collectors.toList());
List<String> collect1 = stringList.stream().filter(Objects::nonNull).distinct().collect(Collectors.toList());
List<String> subtract = ListUtils.subtract(collect1, data);
if (CollectionUtils.isNotEmpty(subtract)) {
batchSendTaskLabelInfoMapper.insertBatchSendTaskLabelInfList(subtract);
}
batchSendTaskInfoMapper.insertBatchSendTaskInfoList(list);
return AjaxResult.success();
}
/**
* 创建批量推送任务
*
* @param batchSendTaskRecordDto 任务信息
* @return AjaxResult
* @throws ClientException
*/
@Override
public AjaxResult batchSend(BatchSendTaskRecordDto batchSendTaskRecordDto) throws ClientException, IllegalAccessException {
log.info("开始创建批量推送任务---------------");
//新增批量推送任务记录
BatchSendTaskRecordInfo batchSendTaskRecordInfo = new BatchSendTaskRecordInfo();
batchSendTaskRecordInfo.setBatchTaskName(batchSendTaskRecordDto.getManageRouteName());
//新增批量推送任务记录编号 上传平台数据的任务名称
String batchTaskNumber = null;
if (batchSendTaskRecordDto.getBatchTaskSource().equals(BillSourceEnum.MESSAGE.getInfo())) {
batchTaskNumber = "hkqdermyy_message_batch" + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"));
batchSendTaskRecordInfo.setTemplateId(batchSendTaskRecordDto.getMessageTemplateId().toString());
batchSendTaskRecordInfo.setTemplateName(batchSendTaskRecordDto.getMessageTemplateName());
batchSendTaskRecordInfo.setRobotPublishId(batchSendTaskRecordDto.getMessageTemplateCode());
}
if (batchSendTaskRecordDto.getBatchTaskSource().equals(BillSourceEnum.TELEPHONE.getInfo())) {
batchTaskNumber = "hkqdermyy_phone_batch" + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"));
batchSendTaskRecordInfo.setTemplateId(batchSendTaskRecordDto.getPhoneTemplateId());
batchSendTaskRecordInfo.setTemplateName(batchSendTaskRecordDto.getPhoneTemplateName());
batchSendTaskRecordInfo.setRobotPublishId(batchSendTaskRecordDto.getRobotPublishId());
}
batchSendTaskRecordInfo.setNodeExecuteStatus(NodeExecuteStatusEnum.EXECUTING.getInfo());
batchSendTaskRecordInfo.setNodeContent(batchSendTaskRecordDto.getNodeContent());
batchSendTaskRecordInfo.setBatchTaskNumber(batchTaskNumber);
batchSendTaskRecordInfo.setTaskExecuteType(TaskExcuteTypeEnum.BATCH_TASK.getInfo());
batchSendTaskRecordInfo.setNodePlanTime(batchSendTaskRecordDto.getNodePlanTime());
batchSendTaskRecordInfo.setCreateBy(SecurityUtils.getUsername());
batchSendTaskRecordInfo.setBatchTaskSource(batchSendTaskRecordDto.getBatchTaskSource());
batchSendTaskRecordInfo.setCreateTime(LocalDateTime.now());
batchSendTaskRecordInfo.setPhysicalExaminationLabel(batchSendTaskRecordDto.getPhysicalExaminationLabel());
batchSendTaskRecordInfo.setDelFlag(0);
int insertBatchSendTaskRecord = batchSendTaskRecordInfoMapper.insertBatchSendTaskRecordInfo(batchSendTaskRecordInfo);
if (insertBatchSendTaskRecord <= 0) {
log.info("新增批量推送任务记录失败");
return AjaxResult.error("上传任务失败!请联系管理员!");
}
//保存短信变量
List<BatchSendTaskVariableInfo> batchSendTaskVariableInfos = new ArrayList<>();
if (Objects.nonNull(batchSendTaskRecordDto.getVars()) && batchSendTaskRecordDto.getBatchTaskSource().equals(BillSourceEnum.MESSAGE.getInfo())) {
Set<String> keys = batchSendTaskRecordDto.getVars().keySet();
for (String key : keys) {
BatchSendTaskVariableInfo batchSendTaskVariableInfo = new BatchSendTaskVariableInfo();
batchSendTaskVariableInfo.setBatchSendTaskRecordId(batchSendTaskRecordInfo.getId());
batchSendTaskVariableInfo.setVariable(key);
batchSendTaskVariableInfo.setVariableAttribute(batchSendTaskRecordDto.getVars().get(key));
batchSendTaskVariableInfo.setCreateBy(SecurityUtils.getUsername());
batchSendTaskRecordInfo.setCreateTime(LocalDateTime.now());
batchSendTaskVariableInfos.add(batchSendTaskVariableInfo);
}
}
List<SignPatientManageRoute> signPatientManageRoutes = new ArrayList<>();
List<SignPatientManageRouteNode> signPatientManageRouteNodes = new ArrayList<>();
String[] keys = new String[0];
if (batchSendTaskRecordDto.getBatchTaskSource().equals(BillSourceEnum.TELEPHONE.getInfo())) {
String s1 = scriptInfoMapper.selectVariablesByRobotPublishId(batchSendTaskRecordDto.getRobotPublishId());
keys = s1.split("\\|");
}
for (BatchSendTaskInfo batchSendTaskInfo : batchSendTaskRecordDto.getList()) {
//节点主表
SignPatientManageRoute signPatientManageRoute = new SignPatientManageRoute();
signPatientManageRoute.setRouteName(batchSendTaskRecordDto.getManageRouteName());
signPatientManageRoute.setTaskCreateType(TaskCreateTypeEnum.MANUAL_CREATE.getInfo());
signPatientManageRoute.setCreateBy(SecurityUtils.getUsername());
signPatientManageRoute.setCreateTime(LocalDateTime.now());
signPatientManageRoute.setTaskExcuteType(TaskExcuteTypeEnum.BATCH_TASK.getInfo());
signPatientManageRoute.setPatientName(batchSendTaskInfo.getPatientName());
signPatientManageRoute.setBatchSendTaskRecordId(batchSendTaskRecordInfo.getId());
signPatientManageRoute.setBatchSendTaskId(batchSendTaskInfo.getId());
signPatientManageRoutes.add(signPatientManageRoute);
//节点node表
SignPatientManageRouteNode signPatientManageRouteNode = new SignPatientManageRouteNode();
signPatientManageRouteNode.setManageRouteName(batchSendTaskRecordDto.getManageRouteName());
signPatientManageRouteNode.setSn(batchTaskNumber);
signPatientManageRouteNode.setDialStatus(DialStatusEnum.NODIALED.getInfo());
signPatientManageRouteNode.setTaskExcuteType(TaskExcuteTypeEnum.BATCH_TASK.getInfo());
signPatientManageRouteNode.setNodePlanTime(batchSendTaskRecordDto.getNodePlanTime());
if (batchSendTaskRecordDto.getBatchTaskSource().equals(BillSourceEnum.TELEPHONE.getInfo())) {
signPatientManageRouteNode.setTaskNodeType(TaskNodeTypeEnum.PHONE_OUTBOUND.getInfo());
signPatientManageRouteNode.setPhonePushSign(1);
signPatientManageRouteNode.setScriptInfoId(Objects.isNull(batchSendTaskRecordDto.getScriptInfoId()) ? null : batchSendTaskRecordDto.getScriptInfoId());
signPatientManageRouteNode.setRobotPublishId(batchSendTaskRecordDto.getRobotPublishId());
signPatientManageRouteNode.setPhoneTemplateId(Objects.isNull(batchSendTaskRecordDto.getPhoneTemplateId()) ? null : batchSendTaskRecordDto.getPhoneTemplateId());
signPatientManageRouteNode.setPhoneTemplateName(StringUtils.isBlank(batchSendTaskRecordDto.getPhoneTemplateName()) ? null : batchSendTaskRecordDto.getPhoneTemplateName());
signPatientManageRouteNode.setPhoneNodeContent(StringUtils.isBlank(batchSendTaskRecordDto.getPhoneNodeContent()) ? null : batchSendTaskRecordDto.getPhoneNodeContent());
signPatientManageRouteNode.setPhoneRedialTimes(StringUtils.isBlank(batchSendTaskRecordDto.getPhoneRedialTimes()) ? null : batchSendTaskRecordDto.getPhoneRedialTimes());
signPatientManageRouteNode.setPhoneTimeInterval(Objects.isNull(batchSendTaskRecordDto.getPhoneTimeInterval()) ? null : batchSendTaskRecordDto.getPhoneTimeInterval());
signPatientManageRouteNode.setPhoneMessageRemind(StringUtils.isBlank(batchSendTaskRecordDto.getPhoneMessageRemind()) ? null : batchSendTaskRecordDto.getPhoneMessageRemind());
signPatientManageRouteNode.setPhoneMessageTemplateId(Objects.isNull(batchSendTaskRecordDto.getPhoneMessageTemplateId()) ? null : batchSendTaskRecordDto.getPhoneMessageTemplateId());
signPatientManageRouteNode.setPhoneMessageTemplateName(StringUtils.isBlank(batchSendTaskRecordDto.getPhoneMessageTemplateName()) ? null : batchSendTaskRecordDto.getPhoneMessageTemplateName());
signPatientManageRouteNode.setPhoneDialMethod(PhoneDialMethodEnum.AI.getInfo());
}
if (batchSendTaskRecordDto.getBatchTaskSource().equals(BillSourceEnum.MESSAGE.getInfo())) {
signPatientManageRouteNode.setTaskNodeType(TaskNodeTypeEnum.TEXT_REMIND.getInfo());
signPatientManageRouteNode.setMessagePushSign(1);
signPatientManageRouteNode.setMessageTemplateId(Objects.isNull(batchSendTaskRecordDto.getMessageTemplateId()) ? null : batchSendTaskRecordDto.getMessageTemplateId());
signPatientManageRouteNode.setMessageTemplateCode(Objects.isNull(batchSendTaskRecordDto.getMessageTemplateCode()) ? null : batchSendTaskRecordDto.getMessageTemplateCode());
signPatientManageRouteNode.setMessageTemplateName(StringUtils.isBlank(batchSendTaskRecordDto.getMessageTemplateName()) ? null : batchSendTaskRecordDto.getMessageTemplateName());
signPatientManageRouteNode.setMessageNodeContent(batchSendTaskRecordDto.getMessageNodeContent());
}
signPatientManageRouteNode.setRouteCheckStatus(RouteCheckStatusEnum.AGREE.getInfo());
signPatientManageRouteNode.setNodeExecuteStatus(NodeExecuteStatusEnum.EXECUTING.getInfo());
signPatientManageRouteNode.setDelFlag(0);
signPatientManageRouteNode.setCreateBy(SecurityUtils.getUsername());
signPatientManageRouteNode.setCreateTime(LocalDateTime.now());
signPatientManageRouteNodes.add(signPatientManageRouteNode);
//电话变量
if (batchSendTaskRecordDto.getBatchTaskSource().equals(BillSourceEnum.TELEPHONE.getInfo())) {
for (String key : keys) {
// 获取对象的Class对象
Class<?> objClass = batchSendTaskInfo.getClass();
// 获取所有属性
Field[] fields = objClass.getDeclaredFields();
//匹配属性名
Field field = Arrays.stream(fields).filter(Objects::nonNull).filter(s -> Objects.equals(s.getName().toUpperCase(), key.replaceAll("_", "").toUpperCase())).findFirst().orElse(null);
if (Objects.isNull(field)) {
return AjaxResult.error("该模板变量" + key + "不存在!");
}
BatchSendTaskVariableInfo batchSendTaskVariableInfo = new BatchSendTaskVariableInfo();
batchSendTaskVariableInfo.setBatchSendTaskRecordId(batchSendTaskRecordInfo.getId());
batchSendTaskVariableInfo.setBatchSendTaskId(batchSendTaskInfo.getId());
batchSendTaskVariableInfo.setVariable(key);
// 设置可以访问私有变量
field.setAccessible(true);
batchSendTaskVariableInfo.setVariableAttribute(field.get(batchSendTaskInfo).toString());
batchSendTaskVariableInfo.setCreateBy(SecurityUtils.getUsername());
batchSendTaskRecordInfo.setCreateTime(LocalDateTime.now());
batchSendTaskVariableInfos.add(batchSendTaskVariableInfo);
}
}
}
//新增节点表主表
signPatientManageRouteMapper.insertBatch(signPatientManageRoutes);
//筛如节点表主表id
for (int i = 0; i < signPatientManageRouteNodes.size(); i++) {
signPatientManageRouteNodes.get(i).setManageRouteId(signPatientManageRoutes.get(i).getId());
}
//新增节点明细表
signPatientManageRouteNodeMapper.insertBatch(signPatientManageRouteNodes);
//新增变量表
if (CollectionUtils.isNotEmpty(batchSendTaskVariableInfos)) {
batchSendTaskVariableInfoMapper.insertBatchSendTaskVariableInfos(batchSendTaskVariableInfos);
}
//电话推送
if (batchSendTaskRecordDto.getBatchTaskSource().equals(BillSourceEnum.TELEPHONE.getInfo())) {
//获取医院拨打时间限制
SysUser sysUser = sysUserMapper.selectUserById(SecurityUtils.getUserId());
Agency agency = agencyMapper.selectAgencyById(sysUser.getHospitalAgencyId());
DialTime dialTime = patientInfoImportMainMapper.selectDialTimeById(agency.getId());
LocalTime localStartTime;
LocalTime localEndTime;
LocalTime dateStartTime;
LocalTime dateEndTime;
if (Objects.nonNull(dialTime)) {
localStartTime = LocalTime.parse(dialTime.getDialStartTime());
localEndTime = LocalTime.parse(dialTime.getDialEndTime());
} else {
localStartTime = LocalTime.parse("08:00");
localEndTime = LocalTime.parse("19:00");
}
List<SysDictData> sysDictDataList = iSysDictTypeService.selectDictDataByType(Constants.DIAL_TIME);
if (CollectionUtils.isEmpty(sysDictDataList) || sysDictDataList.size() != 2) {
dateStartTime = LocalTime.parse("08:00");
dateEndTime = LocalTime.parse("19:00");
} else {
dateStartTime = LocalTime.parse(sysDictDataList.get(0).getDictValue());
dateEndTime = LocalTime.parse(sysDictDataList.get(1).getDictValue());
}
if (dateStartTime.isAfter(localStartTime)) {
localStartTime = dateStartTime;
}
if (dateEndTime.isBefore(localEndTime)) {
localEndTime = dateEndTime;
}
log.info("创建批量电话推送任务---------------");
CreateTaskDto createTaskDto = new CreateTaskDto();
//临时重复测试用
String taskName = batchTaskNumber + "-" + batchSendTaskRecordDto.getPhoneTemplateName();
log.info("任务名称:" + taskName);
createTaskDto.setTaskName(taskName);
createTaskDto.setRobotId(batchSendTaskRecordDto.getRobotPublishId());
createTaskDto.setDialStartDate(batchSendTaskRecordDto.getNodePlanTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
//默认为空表示不限制终止时间
createTaskDto.setDialEndDate(batchSendTaskRecordDto.getNodePlanTime().plusDays(2).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
createTaskDto.setForbidDialDate(Arrays.asList(99));
List<RetryRuleList> retryRuleLists = new ArrayList<>();
RetryRuleList retryRuleList = new RetryRuleList();
retryRuleList.setForbidDialStartTime("11:50");
retryRuleList.setForbidDialEndTime("13:30");
createTaskDto.setForbidDialTime(retryRuleLists);
createTaskDto.setRetryTimes(StringUtils.isBlank(batchSendTaskRecordDto.getPhoneRedialTimes()) ? 0 : PhoneRedialTimesEnum.getValueByInfo(batchSendTaskRecordDto.getPhoneRedialTimes()).getValue());
createTaskDto.setRetryInterval(batchSendTaskRecordDto.getPhoneTimeInterval());
createTaskDto.setNumTypeFilterList(Arrays.asList(1, 2));
createTaskDto.setTaskDataCallback(true);
createTaskDto.setCallBackUrl(callBackUrl + "/taskCallBack");
createTaskDto.setDialStartTime(localStartTime.format(DateTimeFormatter.ofPattern("HH:mm")));
createTaskDto.setDialEndTime(localEndTime.format(DateTimeFormatter.ofPattern("HH:mm")));
//1.创建任务
String taskId = aiobService.createTask(createTaskDto);
//2.任务状态变更
aiobService.updateTaskStatus(taskId, 2);
//3.导入名单
List<CustomerInfoDto> customerInfoList = new ArrayList<>();
signPatientManageRouteNodes.forEach(node -> {
CustomerInfoDto customerInfoDto = new CustomerInfoDto();
customerInfoDto.setExtJson(node.getId().toString());
SignPatientManageRoute signPatientManageRoute = signPatientManageRoutes.stream().filter(Objects::nonNull).filter(item -> item.getId().equals(node.getManageRouteId())).findFirst().orElse(new SignPatientManageRoute());
BatchSendTaskInfo batchSendTaskInfo = batchSendTaskRecordDto.getList().stream().filter(Objects::nonNull).filter(item -> item.getId().equals(signPatientManageRoute.getBatchSendTaskId())).findFirst().orElse(new BatchSendTaskInfo());
List<BatchSendTaskVariableInfo> batchSendTaskVariableList = batchSendTaskVariableInfos.stream().filter(Objects::nonNull).filter(item -> item.getBatchSendTaskId().equals(batchSendTaskInfo.getId())).collect(Collectors.toList());
//校验手机号
if (StringUtils.isNotBlank(batchSendTaskInfo.getPatientPhone())) {
if (regexUtil.regexPhone(batchSendTaskInfo.getPatientPhone())) {
customerInfoDto.setMobile(batchSendTaskInfo.getPatientPhone());
// 处理变量
JSONObject jsonObject = new JSONObject();
if (CollectionUtils.isNotEmpty(batchSendTaskVariableList)) {
batchSendTaskVariableList.forEach(variable -> {
jsonObject.fluentPut(variable.getVariable(), ObjectUtils.isEmpty(variable.getVariableAttribute()) ? "" : variable.getVariableAttribute());
});
}
customerInfoDto.setVar(jsonObject);
customerInfoList.add(customerInfoDto);
}
}
});
//3.1上传名单
log.info("任务导入客户名单......");
ImportTaskDto importTaskDto = new ImportTaskDto();
importTaskDto.setTaskId(taskId);
importTaskDto.setSecretType(2);
importTaskDto.setCustomerInfoList(customerInfoList);
aiobService.importTask(importTaskDto);
//根据机器人id查询智能外呼系统的任务id
log.info("创建批量电话推送任务执行完成......");
return AjaxResult.success("创建批量电话推送任务执行完成");
}
if (batchSendTaskRecordDto.getBatchTaskSource().equals(BillSourceEnum.MESSAGE.getInfo())) {
log.info("创建批量短信推送任务---------------");
SmsInfoDTO smsInfoDTO = new SmsInfoDTO();
List<String> phones = batchSendTaskRecordDto.getList().stream().filter(Objects::nonNull).map(BatchSendTaskInfo::getPatientPhone).distinct().collect(Collectors.toList());
String phoneString = String.join(",", phones);
smsInfoDTO.setPhoneNumbers(phoneString);
smsInfoDTO.setSignName(aliYunSmsTwoConfig.getSignName());
// 处理变量
JSONObject jsonObject = new JSONObject();
if (Objects.nonNull(batchSendTaskRecordDto.getVars())) {
Set<String> keySet = batchSendTaskRecordDto.getVars().keySet();
keySet.forEach(variable -> {
jsonObject.fluentPut(variable, ObjectUtils.isEmpty(batchSendTaskRecordDto.getVars().get(variable)) ? "" : batchSendTaskRecordDto.getVars().get(variable));
});
}
smsInfoDTO.setTemplateParam(jsonObject);
// 根据模版id发送
smsInfoDTO.setTemplateCode(batchSendTaskRecordDto.getMessageTemplateCode());
smsInfoDTO.setOutId(batchSendTaskRecordInfo.getId().toString());
Boolean aBoolean = sendSms(smsInfoDTO);
if (!aBoolean) {
return AjaxResult.error("短信上传失败");
}
log.info("创建批量短信推送任务执行完成......");
return AjaxResult.success("短信上传成功");
}
return AjaxResult.success();
}
/**
* 搜素框添加 标签信息
*
* @return String
*/
@Override
public List<String> getPhysicalExaminationLabel() {
List<BatchSendTaskLabelInfo> batchSendTaskLabelInfos = batchSendTaskLabelInfoMapper.selectBatchSendTaskLabelInfoList(null);
if (CollectionUtils.isEmpty(batchSendTaskLabelInfos)) {
return new ArrayList<>();
}
return batchSendTaskLabelInfos.stream().filter(Objects::nonNull).map(BatchSendTaskLabelInfo::getPhysicalExaminationLabel).collect(Collectors.toList());
}
/**
* 变量替换值发送短信
*/
public Boolean sendSms(SmsInfoDTO smsInfoDTO) throws ClientException, ServiceException {
try {
// 短信发送参数非空性判断
if (ObjectUtils.isEmpty(smsInfoDTO)) {
throw new ServiceException("短信发送参数不能为空!");
}
if (StringUtils.isBlank(smsInfoDTO.getPhoneNumbers())) {
throw new ServiceException("待发送手机号不能为空!");
}
if (StringUtils.isBlank(smsInfoDTO.getSignName())) {
throw new ServiceException("短信签名不能为空!");
}
if (StringUtils.isBlank(smsInfoDTO.getTemplateCode())) {
throw new ServiceException("短信模板Code不能为空!");
}
// 设置系统的默认连接超时时间和读取超时时间
System.setProperty("sun.net.client.defaultConnectTimeout", "10000");
System.setProperty("sun.net.client.defaultReadTimeout", "10000");
// 初始化acsClient暂不支持region化
IClientProfile profile = DefaultProfile.getProfile(aliYunSmsTwoConfig.getRegionId(), aliYunSmsTwoConfig.getAccessKeyId(), aliYunSmsTwoConfig.getAccessKeySecret());
DefaultProfile.addEndpoint(aliYunSmsTwoConfig.getRegionId(), aliYunSmsTwoConfig.getProduct(), aliYunSmsTwoConfig.getDomain());
IAcsClient acsClient = new DefaultAcsClient(profile);
// 组装请求对象
SendSmsRequest request = new SendSmsRequest();
request.setPhoneNumbers(smsInfoDTO.getPhoneNumbers());
request.setSignName(smsInfoDTO.getSignName());
request.setTemplateCode(smsInfoDTO.getTemplateCode());
request.setTemplateParam(smsInfoDTO.getTemplateParam().toJSONString());
request.setOutId(smsInfoDTO.getOutId());
SendSmsResponse sendSmsResponse = acsClient.getAcsResponse(request);
// 判断响应的结果
if (!SUCCESS.equals(sendSmsResponse.getCode())) {
SmsErrorCodeEnum errorCode = SmsErrorCodeEnum.getMsgByCode(sendSmsResponse.getCode());
log.error("短信发送失败,错误码:{},错误信息:{}", sendSmsResponse.getCode(), errorCode.getMessage());
return false;
}
log.info("短信发送成功code{}", sendSmsResponse.getCode());
return true;
} catch (ClientException e) {
log.error("发送短信出现异常,异常信息:{}", e.getMessage());
throw e;
}
}
}

View File

@ -0,0 +1,62 @@
package com.xinelu.manage.service.batchsendtasklabelinfo;
import com.xinelu.manage.domain.batchsendtasklabelinfo.BatchSendTaskLabelInfo;
import java.util.List;
/**
* 批量推送任务标签信息表Service接口
*
* @author xinelu
* @date 2026-04-29
*/
public interface IBatchSendTaskLabelInfoService {
/**
* 查询批量推送任务标签信息表
*
* @param id 批量推送任务标签信息表主键
* @return 批量推送任务标签信息表
*/
BatchSendTaskLabelInfo selectBatchSendTaskLabelInfoById(Long id);
/**
* 查询批量推送任务标签信息表列表
*
* @param batchSendTaskLabelInfo 批量推送任务标签信息表
* @return 批量推送任务标签信息表集合
*/
List<BatchSendTaskLabelInfo> selectBatchSendTaskLabelInfoList(BatchSendTaskLabelInfo batchSendTaskLabelInfo);
/**
* 新增批量推送任务标签信息表
*
* @param batchSendTaskLabelInfo 批量推送任务标签信息表
* @return 结果
*/
int insertBatchSendTaskLabelInfo(BatchSendTaskLabelInfo batchSendTaskLabelInfo);
/**
* 修改批量推送任务标签信息表
*
* @param batchSendTaskLabelInfo 批量推送任务标签信息表
* @return 结果
*/
int updateBatchSendTaskLabelInfo(BatchSendTaskLabelInfo batchSendTaskLabelInfo);
/**
* 批量删除批量推送任务标签信息表
*
* @param ids 需要删除的批量推送任务标签信息表主键集合
* @return 结果
*/
int deleteBatchSendTaskLabelInfoByIds(Long[] ids);
/**
* 删除批量推送任务标签信息表信息
*
* @param id 批量推送任务标签信息表主键
* @return 结果
*/
int deleteBatchSendTaskLabelInfoById(Long id);
}

View File

@ -0,0 +1,87 @@
package com.xinelu.manage.service.batchsendtasklabelinfo.impl;
import com.xinelu.manage.domain.batchsendtasklabelinfo.BatchSendTaskLabelInfo;
import com.xinelu.manage.mapper.batchsendtasklabelinfo.BatchSendTaskLabelInfoMapper;
import com.xinelu.manage.service.batchsendtasklabelinfo.IBatchSendTaskLabelInfoService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* 批量推送任务标签信息表Service业务层处理
*
* @author xinelu
* @date 2026-04-29
*/
@Service
public class BatchSendTaskLabelInfoServiceImpl implements IBatchSendTaskLabelInfoService {
@Resource
private BatchSendTaskLabelInfoMapper batchSendTaskLabelInfoMapper;
/**
* 查询批量推送任务标签信息表
*
* @param id 批量推送任务标签信息表主键
* @return 批量推送任务标签信息表
*/
@Override
public BatchSendTaskLabelInfo selectBatchSendTaskLabelInfoById(Long id) {
return batchSendTaskLabelInfoMapper.selectBatchSendTaskLabelInfoById(id);
}
/**
* 查询批量推送任务标签信息表列表
*
* @param batchSendTaskLabelInfo 批量推送任务标签信息表
* @return 批量推送任务标签信息表
*/
@Override
public List<BatchSendTaskLabelInfo> selectBatchSendTaskLabelInfoList(BatchSendTaskLabelInfo batchSendTaskLabelInfo) {
return batchSendTaskLabelInfoMapper.selectBatchSendTaskLabelInfoList(batchSendTaskLabelInfo);
}
/**
* 新增批量推送任务标签信息表
*
* @param batchSendTaskLabelInfo 批量推送任务标签信息表
* @return 结果
*/
@Override
public int insertBatchSendTaskLabelInfo(BatchSendTaskLabelInfo batchSendTaskLabelInfo) {
return batchSendTaskLabelInfoMapper.insertBatchSendTaskLabelInfo(batchSendTaskLabelInfo);
}
/**
* 修改批量推送任务标签信息表
*
* @param batchSendTaskLabelInfo 批量推送任务标签信息表
* @return 结果
*/
@Override
public int updateBatchSendTaskLabelInfo(BatchSendTaskLabelInfo batchSendTaskLabelInfo) {
return batchSendTaskLabelInfoMapper.updateBatchSendTaskLabelInfo(batchSendTaskLabelInfo);
}
/**
* 批量删除批量推送任务标签信息表
*
* @param ids 需要删除的批量推送任务标签信息表主键
* @return 结果
*/
@Override
public int deleteBatchSendTaskLabelInfoByIds(Long[] ids) {
return batchSendTaskLabelInfoMapper.deleteBatchSendTaskLabelInfoByIds(ids);
}
/**
* 删除批量推送任务标签信息表信息
*
* @param id 批量推送任务标签信息表主键
* @return 结果
*/
@Override
public int deleteBatchSendTaskLabelInfoById(Long id) {
return batchSendTaskLabelInfoMapper.deleteBatchSendTaskLabelInfoById(id);
}
}

View File

@ -0,0 +1,71 @@
package com.xinelu.manage.service.batchsendtaskrecordinfo;
import com.xinelu.manage.domain.batchsendtaskrecordinfo.BatchSendTaskRecordInfo;
import com.xinelu.manage.vo.batchsendtaskrecordinfo.BatchSendTaskRecordVo;
import java.util.List;
/**
* 批量推送任务记录Service接口
*
* @author zh
* @date 2026-04-26
*/
public interface IBatchSendTaskRecordInfoService {
/**
* 查询批量推送任务记录
*
* @param id 批量推送任务记录主键
* @return 批量推送任务记录
*/
BatchSendTaskRecordVo selectBatchSendTaskRecordInfoById(Long id);
/**
* 查询批量推送任务记录列表
*
* @param batchSendTaskRecordInfo 批量推送任务记录
* @return 批量推送任务记录集合
*/
List<BatchSendTaskRecordInfo> selectBatchSendTaskRecordInfoList(BatchSendTaskRecordInfo batchSendTaskRecordInfo);
/**
* 新增批量推送任务记录
*
* @param batchSendTaskRecordInfo 批量推送任务记录
* @return 结果
*/
int insertBatchSendTaskRecordInfo(BatchSendTaskRecordInfo batchSendTaskRecordInfo);
/**
* 修改批量推送任务记录
*
* @param batchSendTaskRecordInfo 批量推送任务记录
* @return 结果
*/
int updateBatchSendTaskRecordInfo(BatchSendTaskRecordInfo batchSendTaskRecordInfo);
/**
* 批量删除批量推送任务记录
*
* @param ids 需要删除的批量推送任务记录主键集合
* @return 结果
*/
int deleteBatchSendTaskRecordInfoByIds(Long[] ids);
/**
* 删除批量推送任务记录信息
*
* @param id 批量推送任务记录主键
* @return 结果
*/
int deleteBatchSendTaskRecordInfoById(Long id);
/**
* 获取短信或电话模板
*
* @param batchTaskSource 短信或电话
* @return BatchSendTaskRecordInfo
*/
List<BatchSendTaskRecordInfo> getTemplate(String batchTaskSource);
}

View File

@ -0,0 +1,161 @@
package com.xinelu.manage.service.batchsendtaskrecordinfo.impl;
import com.xinelu.common.annotation.DataScope;
import com.xinelu.common.enums.BillSourceEnum;
import com.xinelu.common.enums.NodeExecuteStatusEnum;
import com.xinelu.manage.domain.batchsendtaskrecordinfo.BatchSendTaskRecordInfo;
import com.xinelu.manage.domain.scriptInfo.ScriptInfo;
import com.xinelu.manage.mapper.batchsendtaskrecordinfo.BatchSendTaskRecordInfoMapper;
import com.xinelu.manage.mapper.scriptInfo.ScriptInfoMapper;
import com.xinelu.manage.mapper.textmessage.TextMessageMapper;
import com.xinelu.manage.service.batchsendtaskrecordinfo.IBatchSendTaskRecordInfoService;
import com.xinelu.manage.vo.batchsendtaskrecordinfo.BatchSendTaskRecordVo;
import com.xinelu.manage.vo.textmessage.TextMessageVO;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
/**
* 批量推送任务记录Service业务层处理
*
* @author zh
* @date 2026-04-26
*/
@Service
public class BatchSendTaskRecordInfoServiceImpl implements IBatchSendTaskRecordInfoService {
@Resource
private BatchSendTaskRecordInfoMapper batchSendTaskRecordInfoMapper;
@Resource
private ScriptInfoMapper scriptInfoMapper;
@Resource
private TextMessageMapper textMessageMapper;
/**
* 查询批量推送任务记录
*
* @param id 批量推送任务记录主键
* @return 批量推送任务记录
*/
@Override
public BatchSendTaskRecordVo selectBatchSendTaskRecordInfoById(Long id) {
return batchSendTaskRecordInfoMapper.selectBatchSendTaskRecordVoById(id);
}
/**
* 查询批量推送任务记录列表
*
* @param batchSendTaskRecordInfo 批量推送任务记录
* @return 批量推送任务记录
*/
@Override
public List<BatchSendTaskRecordInfo> selectBatchSendTaskRecordInfoList(BatchSendTaskRecordInfo batchSendTaskRecordInfo) {
List<BatchSendTaskRecordInfo> batchSendTaskRecordInfos = batchSendTaskRecordInfoMapper.selectBatchSendTaskRecordInfoList(batchSendTaskRecordInfo);
if (CollectionUtils.isEmpty(batchSendTaskRecordInfos)) {
return new ArrayList<>();
}
for (BatchSendTaskRecordInfo sendTaskRecordInfo : batchSendTaskRecordInfos) {
if (StringUtils.isNotBlank(sendTaskRecordInfo.getNodeExecuteStatus()) && sendTaskRecordInfo.getNodeExecuteStatus().equals(NodeExecuteStatusEnum.EXECUTED.getInfo())) {
sendTaskRecordInfo.setNodeExecuteStatus(NodeExecuteStatusEnum.EXECUTED.getCode());
}
if (StringUtils.isNotBlank(sendTaskRecordInfo.getNodeExecuteStatus()) && sendTaskRecordInfo.getNodeExecuteStatus().equals(NodeExecuteStatusEnum.UNEXECUTED.getInfo())) {
sendTaskRecordInfo.setNodeExecuteStatus(NodeExecuteStatusEnum.UNEXECUTED.getCode());
}
if (StringUtils.isNotBlank(sendTaskRecordInfo.getNodeExecuteStatus()) && sendTaskRecordInfo.getNodeExecuteStatus().equals(NodeExecuteStatusEnum.EXECUTING.getInfo())) {
sendTaskRecordInfo.setNodeExecuteStatus(NodeExecuteStatusEnum.EXECUTING.getCode());
}
if (StringUtils.isNotBlank(sendTaskRecordInfo.getBatchTaskSource()) && sendTaskRecordInfo.getBatchTaskSource().equals(BillSourceEnum.TELEPHONE.getInfo())) {
sendTaskRecordInfo.setBatchTaskSource(BillSourceEnum.TELEPHONE.getCode());
}
if (StringUtils.isNotBlank(sendTaskRecordInfo.getBatchTaskSource()) && sendTaskRecordInfo.getBatchTaskSource().equals(BillSourceEnum.MESSAGE.getInfo())) {
sendTaskRecordInfo.setBatchTaskSource(BillSourceEnum.MESSAGE.getCode());
}
}
return batchSendTaskRecordInfos;
}
/**
* 新增批量推送任务记录
*
* @param batchSendTaskRecordInfo 批量推送任务记录
* @return 结果
*/
@Override
public int insertBatchSendTaskRecordInfo(BatchSendTaskRecordInfo batchSendTaskRecordInfo) {
batchSendTaskRecordInfo.setCreateTime(LocalDateTime.now());
return batchSendTaskRecordInfoMapper.insertBatchSendTaskRecordInfo(batchSendTaskRecordInfo);
}
/**
* 修改批量推送任务记录
*
* @param batchSendTaskRecordInfo 批量推送任务记录
* @return 结果
*/
@Override
public int updateBatchSendTaskRecordInfo(BatchSendTaskRecordInfo batchSendTaskRecordInfo) {
return batchSendTaskRecordInfoMapper.updateBatchSendTaskRecordInfo(batchSendTaskRecordInfo);
}
/**
* 批量删除批量推送任务记录
*
* @param ids 需要删除的批量推送任务记录主键
* @return 结果
*/
@Override
public int deleteBatchSendTaskRecordInfoByIds(Long[] ids) {
return batchSendTaskRecordInfoMapper.deleteBatchSendTaskRecordInfoByIds(ids);
}
/**
* 删除批量推送任务记录信息
*
* @param id 批量推送任务记录主键
* @return 结果
*/
@Override
public int deleteBatchSendTaskRecordInfoById(Long id) {
return batchSendTaskRecordInfoMapper.deleteBatchSendTaskRecordInfoById(id);
}
/**
* 获取短信或电话模板
*
* @param batchTaskSource 短信或电话
* @return BatchSendTaskRecordInfo
*/
@DataScope(agencyAlias = "d")
@Override
public List<BatchSendTaskRecordInfo> getTemplate(String batchTaskSource) {
if (StringUtils.isBlank(batchTaskSource)) {
return new ArrayList<>();
}
List<BatchSendTaskRecordInfo> batchSendTaskRecordInfos = new ArrayList<>();
if (batchTaskSource.equals(BillSourceEnum.TELEPHONE.getInfo())) {
List<ScriptInfo> scriptInfos = scriptInfoMapper.selectScriptInfos();
for (ScriptInfo scriptInfo : scriptInfos) {
BatchSendTaskRecordInfo batchSendTaskRecordInfo = new BatchSendTaskRecordInfo();
batchSendTaskRecordInfo.setTemplateId(scriptInfo.getScriptId());
batchSendTaskRecordInfo.setRobotPublishId(scriptInfo.getRobotPublishId());
batchSendTaskRecordInfo.setTemplateName(scriptInfo.getScriptName());
batchSendTaskRecordInfos.add(batchSendTaskRecordInfo);
}
}
if (batchTaskSource.equals(BillSourceEnum.MESSAGE.getInfo())) {
List<TextMessageVO> textMessageVOS = textMessageMapper.selectTextMessages();
for (TextMessageVO textMessageVO : textMessageVOS) {
BatchSendTaskRecordInfo batchSendTaskRecordInfo = new BatchSendTaskRecordInfo();
batchSendTaskRecordInfo.setTemplateId(textMessageVO.getId().toString());
batchSendTaskRecordInfo.setRobotPublishId(textMessageVO.getTextMessageId());
batchSendTaskRecordInfo.setTemplateName(textMessageVO.getTextMessageName());
batchSendTaskRecordInfos.add(batchSendTaskRecordInfo);
}
}
return batchSendTaskRecordInfos;
}
}

View File

@ -0,0 +1,61 @@
package com.xinelu.manage.service.batchsendtaskvariableinfo;
import com.xinelu.manage.domain.batchsendtaskvariableinfo.BatchSendTaskVariableInfo;
import java.util.List;
/**
* 批量推送任务记录变量属性Service接口
*
* @author zh
* @date 2026-04-26
*/
public interface IBatchSendTaskVariableInfoService {
/**
* 查询批量推送任务记录变量属性
*
* @param id 批量推送任务记录变量属性主键
* @return 批量推送任务记录变量属性
*/
BatchSendTaskVariableInfo selectBatchSendTaskVariableInfoById(Long id);
/**
* 查询批量推送任务记录变量属性列表
*
* @param batchSendTaskVariableInfo 批量推送任务记录变量属性
* @return 批量推送任务记录变量属性集合
*/
List<BatchSendTaskVariableInfo> selectBatchSendTaskVariableInfoList(BatchSendTaskVariableInfo batchSendTaskVariableInfo);
/**
* 新增批量推送任务记录变量属性
*
* @param batchSendTaskVariableInfo 批量推送任务记录变量属性
* @return 结果
*/
int insertBatchSendTaskVariableInfo(BatchSendTaskVariableInfo batchSendTaskVariableInfo);
/**
* 修改批量推送任务记录变量属性
*
* @param batchSendTaskVariableInfo 批量推送任务记录变量属性
* @return 结果
*/
int updateBatchSendTaskVariableInfo(BatchSendTaskVariableInfo batchSendTaskVariableInfo);
/**
* 批量删除批量推送任务记录变量属性
*
* @param ids 需要删除的批量推送任务记录变量属性主键集合
* @return 结果
*/
int deleteBatchSendTaskVariableInfoByIds(Long[] ids);
/**
* 删除批量推送任务记录变量属性信息
*
* @param id 批量推送任务记录变量属性主键
* @return 结果
*/
int deleteBatchSendTaskVariableInfoById(Long id);
}

View File

@ -0,0 +1,89 @@
package com.xinelu.manage.service.batchsendtaskvariableinfo.impl;
import com.xinelu.manage.domain.batchsendtaskvariableinfo.BatchSendTaskVariableInfo;
import com.xinelu.manage.mapper.batchsendtaskvariableinfo.BatchSendTaskVariableInfoMapper;
import com.xinelu.manage.service.batchsendtaskvariableinfo.IBatchSendTaskVariableInfoService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List;
/**
* 批量推送任务记录变量属性Service业务层处理
*
* @author zh
* @date 2026-04-26
*/
@Service
public class BatchSendTaskVariableInfoServiceImpl implements IBatchSendTaskVariableInfoService {
@Resource
private BatchSendTaskVariableInfoMapper batchSendTaskVariableInfoMapper;
/**
* 查询批量推送任务记录变量属性
*
* @param id 批量推送任务记录变量属性主键
* @return 批量推送任务记录变量属性
*/
@Override
public BatchSendTaskVariableInfo selectBatchSendTaskVariableInfoById(Long id) {
return batchSendTaskVariableInfoMapper.selectBatchSendTaskVariableInfoById(id);
}
/**
* 查询批量推送任务记录变量属性列表
*
* @param batchSendTaskVariableInfo 批量推送任务记录变量属性
* @return 批量推送任务记录变量属性
*/
@Override
public List<BatchSendTaskVariableInfo> selectBatchSendTaskVariableInfoList(BatchSendTaskVariableInfo batchSendTaskVariableInfo) {
return batchSendTaskVariableInfoMapper.selectBatchSendTaskVariableInfoList(batchSendTaskVariableInfo);
}
/**
* 新增批量推送任务记录变量属性
*
* @param batchSendTaskVariableInfo 批量推送任务记录变量属性
* @return 结果
*/
@Override
public int insertBatchSendTaskVariableInfo(BatchSendTaskVariableInfo batchSendTaskVariableInfo) {
batchSendTaskVariableInfo.setCreateTime(LocalDateTime.now());
return batchSendTaskVariableInfoMapper.insertBatchSendTaskVariableInfo(batchSendTaskVariableInfo);
}
/**
* 修改批量推送任务记录变量属性
*
* @param batchSendTaskVariableInfo 批量推送任务记录变量属性
* @return 结果
*/
@Override
public int updateBatchSendTaskVariableInfo(BatchSendTaskVariableInfo batchSendTaskVariableInfo) {
return batchSendTaskVariableInfoMapper.updateBatchSendTaskVariableInfo(batchSendTaskVariableInfo);
}
/**
* 批量删除批量推送任务记录变量属性
*
* @param ids 需要删除的批量推送任务记录变量属性主键
* @return 结果
*/
@Override
public int deleteBatchSendTaskVariableInfoByIds(Long[] ids) {
return batchSendTaskVariableInfoMapper.deleteBatchSendTaskVariableInfoByIds(ids);
}
/**
* 删除批量推送任务记录变量属性信息
*
* @param id 批量推送任务记录变量属性主键
* @return 结果
*/
@Override
public int deleteBatchSendTaskVariableInfoById(Long id) {
return batchSendTaskVariableInfoMapper.deleteBatchSendTaskVariableInfoById(id);
}
}

View File

@ -0,0 +1,70 @@
package com.xinelu.manage.service.billinfo;
import com.xinelu.manage.domain.billinfo.BillInfo;
import com.xinelu.manage.dto.billinfo.BillInfoDto;
import java.util.List;
/**
* 账单信息Service接口
*
* @author zh
* @date 2026-04-16
*/
public interface IBillInfoService {
/**
* 查询账单信息
*
* @param id 账单信息主键
* @return 账单信息
*/
BillInfo selectBillInfoById(Long id);
/**
* 查询账单信息列表
*
* @param billInfo 账单信息
* @return 账单信息集合
*/
List<BillInfo> selectBillInfoList(BillInfo billInfo);
/**
* 新增账单信息
*
* @param billInfo 账单信息
* @return 结果
*/
int insertBillInfo(BillInfo billInfo);
/**
* 修改账单信息
*
* @param billInfo 账单信息
* @return 结果
*/
int updateBillInfo(BillInfo billInfo);
/**
* 批量删除账单信息
*
* @param ids 需要删除的账单信息主键集合
* @return 结果
*/
int deleteBillInfoByIds(Long[] ids);
/**
* 删除账单信息信息
*
* @param id 账单信息主键
* @return 结果
*/
int deleteBillInfoById(Long id);
/**
* 账单明细信息列表
*
* @param code 账单编号
* @return BillInfoDto
*/
List<BillInfoDto> selectBillDetails(String code);
}

View File

@ -0,0 +1,130 @@
package com.xinelu.manage.service.billinfo.impl;
import com.xinelu.common.enums.BillSourceEnum;
import com.xinelu.manage.domain.billinfo.BillInfo;
import com.xinelu.manage.dto.billinfo.BillInfoDto;
import com.xinelu.manage.mapper.billinfo.BillInfoMapper;
import com.xinelu.manage.mapper.phonedialrecord.PhoneDialRecordMapper;
import com.xinelu.manage.mapper.shortmessagesendrecord.ShortMessageSendRecordMapper;
import com.xinelu.manage.service.billinfo.IBillInfoService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
* 账单信息Service业务层处理
*
* @author zh
* @date 2026-04-16
*/
@Service
public class BillInfoServiceImpl implements IBillInfoService {
@Resource
private BillInfoMapper billInfoMapper;
@Resource
private PhoneDialRecordMapper phoneDialRecordMapper;
@Resource
private ShortMessageSendRecordMapper shortMessageSendRecordMapper;
/**
* 查询账单信息
*
* @param id 账单信息主键
* @return 账单信息
*/
@Override
public BillInfo selectBillInfoById(Long id) {
return billInfoMapper.selectBillInfoById(id);
}
/**
* 查询账单信息列表
*
* @param billInfo 账单信息
* @return 账单信息
*/
@Override
public List<BillInfo> selectBillInfoList(BillInfo billInfo) {
return billInfoMapper.selectBillInfoList(billInfo);
}
/**
* 新增账单信息
*
* @param billInfo 账单信息
* @return 结果
*/
@Override
public int insertBillInfo(BillInfo billInfo) {
billInfo.setCreateTime(LocalDateTime.now());
return billInfoMapper.insertBillInfo(billInfo);
}
/**
* 修改账单信息
*
* @param billInfo 账单信息
* @return 结果
*/
@Override
public int updateBillInfo(BillInfo billInfo) {
return billInfoMapper.updateBillInfo(billInfo);
}
/**
* 批量删除账单信息
*
* @param ids 需要删除的账单信息主键
* @return 结果
*/
@Override
public int deleteBillInfoByIds(Long[] ids) {
return billInfoMapper.deleteBillInfoByIds(ids);
}
/**
* 删除账单信息信息
*
* @param id 账单信息主键
* @return 结果
*/
@Override
public int deleteBillInfoById(Long id) {
return billInfoMapper.deleteBillInfoById(id);
}
/**
* 账单明细信息列表
*
* @param code 账单编号
* @return BillInfoDto
*/
@Override
public List<BillInfoDto> selectBillDetails(String code) {
//查询总账单信息
BillInfo billInfo = billInfoMapper.selectBillInfoByCode(code);
if (Objects.isNull(billInfo) || StringUtils.isBlank(billInfo.getBillSource())) {
return new ArrayList<>();
}
BillInfoDto billInfoDto = new BillInfoDto();
billInfoDto.setPatientName("总计");
billInfoDto.setPushLength(billInfo.getPushLength());
billInfoDto.setExpense(billInfo.getBillExpense());
List<BillInfoDto> bills = new ArrayList<>();
//根据账单查询数据
if (billInfo.getBillSource().equals(BillSourceEnum.TELEPHONE.getInfo())) {
bills = phoneDialRecordMapper.selectPhoneDialStatisticByBillId(billInfo.getId());
bills.add(billInfoDto);
}
if (billInfo.getBillSource().equals(BillSourceEnum.MESSAGE.getInfo())) {
bills = shortMessageSendRecordMapper.selectShortMessageRecordByBillId(billInfo.getId());
bills.add(billInfoDto);
}
return bills;
}
}

View File

@ -1,13 +1,18 @@
package com.xinelu.manage.service.homepage.impl;
import com.xinelu.common.core.domain.entity.SysUser;
import com.xinelu.common.enums.NodeExecuteStatusEnum;
import com.xinelu.common.enums.PhoneDialMethodEnum;
import com.xinelu.common.utils.SecurityUtils;
import com.xinelu.manage.domain.agency.Agency;
import com.xinelu.manage.mapper.agency.AgencyMapper;
import com.xinelu.manage.mapper.patientinfo.PatientInfoMapper;
import com.xinelu.manage.mapper.patientprehospitalization.PatientPreHospitalizationMapper;
import com.xinelu.manage.mapper.signpatientmanageroutenode.SignPatientManageRouteNodeMapper;
import com.xinelu.manage.mapper.signpatientrecord.SignPatientRecordMapper;
import com.xinelu.manage.service.homepage.SystemHomePageService;
import com.xinelu.manage.vo.homepage.*;
import com.xinelu.system.mapper.SysUserMapper;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
@ -38,6 +43,10 @@ public class SystemHomePageServiceImpl implements SystemHomePageService {
private SignPatientManageRouteNodeMapper signPatientManageRouteNodeMapper;
@Resource
private SignPatientRecordMapper signPatientRecordMapper;
@Resource
private SysUserMapper sysUserMapper;
@Resource
private AgencyMapper agencyMapper;
/**
* 顶部统计
@ -47,23 +56,31 @@ public class SystemHomePageServiceImpl implements SystemHomePageService {
@Override
public TopStatisticsVO topStatistics() {
LocalDate now = LocalDate.now();
Long hospitalAgencyId = null;
SysUser sysUser = sysUserMapper.selectUserById(SecurityUtils.getUserId());
if(Objects.nonNull(sysUser.getHospitalAgencyId())){
Agency agency = agencyMapper.selectAgencyById(sysUser.getHospitalAgencyId());
if (Objects.nonNull(agency.getId())){
hospitalAgencyId = agency.getId();
}
}
TopStatisticsVO topStatisticsVO = new TopStatisticsVO();
//本月第一天
LocalDate firstDay = now.with(TemporalAdjusters.firstDayOfMonth());
//本月患者数量
int createPatientCount = patientInfoMapper.getPatientInfoCountByCreateTime(firstDay, now);
int createPatientCount = patientInfoMapper.getPatientInfoCountByCreateTime(firstDay, now, hospitalAgencyId);
//本月预住院数量
int patientPreHospitalizationCount = patientPreHospitalizationMapper.getPatientPreHospitalizationCountByCreateTime(firstDay, now);
int patientPreHospitalizationCount = patientPreHospitalizationMapper.getPatientPreHospitalizationCountByCreateTime(firstDay, now, hospitalAgencyId);
//本月患者数
topStatisticsVO.setThisMonthPatient(createPatientCount + patientPreHospitalizationCount);
//本月本月出院患者数 统计门诊/出院的 患者数量
topStatisticsVO.setThisMonthDischargePatient(createPatientCount);
//本月签约数
topStatisticsVO.setSignPatientCount(patientInfoMapper.selectPatientInfoCountBySignTime(firstDay, now));
topStatisticsVO.setSignPatientCount(patientInfoMapper.selectPatientInfoCountBySignTime(firstDay, now, hospitalAgencyId));
//本月任务数
topStatisticsVO.setNodeCount(signPatientManageRouteNodeMapper.selectNodeCountByCreateTime(firstDay, now));
//已签约总数
topStatisticsVO.setPatientSignCount(patientInfoMapper.selectPatientSignTotalCount());
topStatisticsVO.setPatientSignCount(patientInfoMapper.selectPatientSignTotalCount(hospitalAgencyId));
//服务中患者数
topStatisticsVO.setPatientSignServiceCount(patientInfoMapper.selectPatientSignServiceCount());
return topStatisticsVO;
@ -77,6 +94,14 @@ public class SystemHomePageServiceImpl implements SystemHomePageService {
@Override
public List<SignPatientCount> signPatientCount() {
//时间集合
Long hospitalAgencyId = null;
SysUser sysUser = sysUserMapper.selectUserById(SecurityUtils.getUserId());
if(Objects.nonNull(sysUser.getHospitalAgencyId())){
Agency agency = agencyMapper.selectAgencyById(sysUser.getHospitalAgencyId());
if (Objects.nonNull(agency.getId())){
hospitalAgencyId = agency.getId();
}
}
List<LocalDate> localDates = new ArrayList<>();
List<SignPatientCount> signPatientCounts = new ArrayList<>();
LocalDate now = LocalDate.now();
@ -90,11 +115,11 @@ public class SystemHomePageServiceImpl implements SystemHomePageService {
LocalDate firstDay = localDate.with(TemporalAdjusters.firstDayOfMonth());
LocalDate lastDay = localDate.with(TemporalAdjusters.lastDayOfMonth());
//患者数量
int createPatientCount = patientInfoMapper.getPatientInfoCountByCreateTime(firstDay, lastDay);
int patientPreHospitalizationCount = patientPreHospitalizationMapper.getPatientPreHospitalizationCountByCreateTime(firstDay, lastDay);
int i = patientInfoMapper.selectPatientInfoCountBySignTime(firstDay, lastDay);
int createPatientCount = patientInfoMapper.getPatientInfoCountByCreateTime(firstDay, lastDay,hospitalAgencyId);
int patientPreHospitalizationCount = patientPreHospitalizationMapper.getPatientPreHospitalizationCountByCreateTime(firstDay, lastDay,hospitalAgencyId);
int i = patientInfoMapper.selectPatientInfoCountBySignTime(firstDay, lastDay,hospitalAgencyId);
//签约
int signPatient = patientInfoMapper.selectPatientInfoCountBySignTime(firstDay, now);
int signPatient = patientInfoMapper.selectPatientInfoCountBySignTime(firstDay, now,hospitalAgencyId);
signPatientCount.setTime(localDate);
signPatientCount.setPatientCount(createPatientCount + patientPreHospitalizationCount);
signPatientCount.setSignPatientCount(signPatient);
@ -149,6 +174,14 @@ public class SystemHomePageServiceImpl implements SystemHomePageService {
*/
@Override
public List<TaskSituation> taskSituation() {
Long hospitalAgencyId = null;
SysUser sysUser = sysUserMapper.selectUserById(SecurityUtils.getUserId());
if(Objects.nonNull(sysUser.getHospitalAgencyId())){
Agency agency = agencyMapper.selectAgencyById(sysUser.getHospitalAgencyId());
if (Objects.nonNull(agency.getId())){
hospitalAgencyId = agency.getId();
}
}
LocalDate now = LocalDate.now();
List<TaskSituation> taskSituations = new ArrayList<>();
//未审核
@ -156,7 +189,7 @@ public class SystemHomePageServiceImpl implements SystemHomePageService {
//全部
int signTimeCount = signPatientRecordMapper.selectCheckStatus(null, "SERVICE_CENTER");
//任务
List<PatientAndNode> patientAndNodes = signPatientManageRouteNodeMapper.selectNodeExecuteStatus();
List<PatientAndNode> patientAndNodes = signPatientManageRouteNodeMapper.selectNodeExecuteStatus(hospitalAgencyId);
//未审核
int unExecutedCount = 0;
//全部

View File

@ -1,6 +1,7 @@
package com.xinelu.manage.service.phonedialrecord;
import com.xinelu.manage.domain.phonedialrecord.PhoneDialRecord;
import com.xinelu.manage.vo.phonedialrecord.BillPhoneDialVo;
import java.util.List;
@ -25,7 +26,7 @@ public interface IPhoneDialRecordService {
* @param phoneDialRecord 电话拨打记录
* @return 电话拨打记录集合
*/
List<PhoneDialRecord> selectPhoneDialRecordList(PhoneDialRecord phoneDialRecord);
List<BillPhoneDialVo> selectPhoneDialRecordList(BillPhoneDialVo phoneDialRecord);
/**
* 新增电话拨打记录

View File

@ -3,6 +3,7 @@ package com.xinelu.manage.service.phonedialrecord.impl;
import com.xinelu.manage.domain.phonedialrecord.PhoneDialRecord;
import com.xinelu.manage.mapper.phonedialrecord.PhoneDialRecordMapper;
import com.xinelu.manage.service.phonedialrecord.IPhoneDialRecordService;
import com.xinelu.manage.vo.phonedialrecord.BillPhoneDialVo;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@ -38,8 +39,8 @@ public class PhoneDialRecordServiceImpl implements IPhoneDialRecordService {
* @return 电话拨打记录
*/
@Override
public List<PhoneDialRecord> selectPhoneDialRecordList(PhoneDialRecord phoneDialRecord) {
return phoneDialRecordMapper.selectPhoneDialRecordList(phoneDialRecord);
public List<BillPhoneDialVo> selectPhoneDialRecordList(BillPhoneDialVo phoneDialRecord) {
return phoneDialRecordMapper.selectPhoneDialRecords(phoneDialRecord);
}
/**

View File

@ -78,4 +78,9 @@ public interface IScriptInfoService {
* 新增话术节点
*/
AjaxResult updateScriptEdgeNode(ScriptVO scriptVO);
/**
* 查询话术变量
*/
AjaxResult selectScriptVariable(Long id);
}

View File

@ -8,7 +8,6 @@ import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.SecurityUtils;
import com.xinelu.common.utils.file.FileUploadUtils;
import com.xinelu.common.utils.file.MimeTypeUtils;
import com.xinelu.common.utils.uuid.IdUtils;
import com.xinelu.manage.domain.scriptInfo.ScriptInfo;
import com.xinelu.manage.domain.scriptinfoedge.ScriptInfoEdge;
import com.xinelu.manage.dto.script.ScriptInfoDto;
@ -19,17 +18,16 @@ import com.xinelu.manage.service.scriptInfo.IScriptInfoService;
import com.xinelu.manage.vo.scriptInfo.Edge;
import com.xinelu.manage.vo.scriptInfo.Node;
import com.xinelu.manage.vo.scriptInfo.ScriptVO;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import javax.annotation.Resource;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.*;
/**
* 话术信息Service业务层处理
*
@ -292,4 +290,18 @@ public class ScriptInfoServiceImpl implements IScriptInfoService {
}
return AjaxResult.success();
}
@Override
public AjaxResult selectScriptVariable(Long id) {
ScriptInfo scriptInfo = scriptInfoMapper.selectScriptInfoById(id);
if (Objects.isNull(scriptInfo) || StringUtils.isBlank(scriptInfo.getVariables())) {
return AjaxResult.success();
}
List<String> variables = Arrays.asList(scriptInfo.getVariables().split("\\|"));
Map<String, String> variablehMap = new HashMap<>();
for (String variable : variables) {
variablehMap.put(variable, null);
}
return AjaxResult.success(variablehMap);
}
}

View File

@ -1,6 +1,7 @@
package com.xinelu.manage.service.shortmessagesendrecord;
import com.xinelu.manage.domain.shortmessagesendrecord.ShortMessageSendRecord;
import com.xinelu.manage.vo.shortmessagesendrecord.ShortMessageSendRecordVo;
import java.util.List;
@ -25,7 +26,7 @@ public interface IShortMessageSendRecordService {
* @param shortMessageSendRecord 短信发送结果记录
* @return 短信发送结果记录集合
*/
List<ShortMessageSendRecord> selectShortMessageSendRecordList(ShortMessageSendRecord shortMessageSendRecord);
List<ShortMessageSendRecordVo> selectShortMessageSendRecordList(ShortMessageSendRecordVo shortMessageSendRecord);
/**
* 新增短信发送结果记录

View File

@ -3,6 +3,7 @@ package com.xinelu.manage.service.shortmessagesendrecord.impl;
import com.xinelu.manage.domain.shortmessagesendrecord.ShortMessageSendRecord;
import com.xinelu.manage.mapper.shortmessagesendrecord.ShortMessageSendRecordMapper;
import com.xinelu.manage.service.shortmessagesendrecord.IShortMessageSendRecordService;
import com.xinelu.manage.vo.shortmessagesendrecord.ShortMessageSendRecordVo;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@ -38,8 +39,8 @@ public class ShortMessageSendRecordServiceImpl implements IShortMessageSendRecor
* @return 短信发送结果记录
*/
@Override
public List<ShortMessageSendRecord> selectShortMessageSendRecordList(ShortMessageSendRecord shortMessageSendRecord) {
return shortMessageSendRecordMapper.selectShortMessageSendRecordList(shortMessageSendRecord);
public List<ShortMessageSendRecordVo> selectShortMessageSendRecordList(ShortMessageSendRecordVo shortMessageSendRecord) {
return shortMessageSendRecordMapper.selectShortMessageSendRecords(shortMessageSendRecord);
}
/**

View File

@ -200,7 +200,7 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
SignPatientManageRouteNodeDto signPatientManageRouteNode = new SignPatientManageRouteNodeDto();
signPatientManageRouteNode.setNodePlanTime(LocalDateTime.now());
List<SignPatientManageRouteNode> signPatientManageRouteNodes = signPatientManageRouteNodeMapper.selectSignPatientManageRouteNodeList(signPatientManageRouteNode);
if (CollectionUtils.isNotEmpty(signPatientManageRouteNodes) && signPatientManageRouteNodes.size() >= 100) {
if (CollectionUtils.isNotEmpty(signPatientManageRouteNodes) && signPatientManageRouteNodes.size() >= 1000) {
return AjaxResult.error("今日创建任务已达上线,请改日创建任务!");
}
//获取患者信息
@ -208,10 +208,10 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
PatientInfoDto patientInfo = new PatientInfoDto();
patientInfo.setSn(signPatientManageRoute.getSn());
listPatient = patientInfoMapper.getPatientList(patientInfo);
if (CollectionUtils.isNotEmpty(listPatient) && listPatient.size() > 100) {
if (CollectionUtils.isNotEmpty(listPatient) && listPatient.size() > 1000) {
return AjaxResult.error("创建任务数量超出当日上限,请减少创建任务数量!");
}
if (CollectionUtils.isNotEmpty(listPatient) && CollectionUtils.isNotEmpty(signPatientManageRouteNodes) && (listPatient.size() + signPatientManageRouteNodes.size()) > 100) {
if (CollectionUtils.isNotEmpty(listPatient) && CollectionUtils.isNotEmpty(signPatientManageRouteNodes) && (listPatient.size() + signPatientManageRouteNodes.size()) > 1000) {
return AjaxResult.error("创建任务数量超出当日上限,请减少创建任务数量!");
}
for (PatientInfoVo patientInfoVo : listPatient) {
@ -274,10 +274,7 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
if (insertBatchCount < 0) {
return AjaxResult.error(901, "新增签约患者管理任务路径失败!请联系管理员!");
}
SignPatientRecord signPatientRecord = new SignPatientRecord();
// if(Objects.isNull(signPatientManageRoute.getSignPatientRecordId())) {
// //更新 签约记录的 审核状态为 已审核适用场景手动创建任务 zyk 20241204
// signPatientRecord.setRouteCheckStatus(RouteCheckStatusEnum.AGREE.getInfo());
@ -301,12 +298,10 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
LabelField labelField = new LabelField();
labelField.setLabelFieldAndPartitionDictList(labelFieldAndPartitionDictList);
labelFieldContentService.insertLabelField(labelField);
// 替换手动生成的任务中的标签
signPatientManageRouteNodeService.manualCreateTaskLabelReplaceByPatientId(signPatientManageRoute.getPatientId());
}
return AjaxResult.success();
}
@ -1452,10 +1447,9 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
if (StringUtils.isNotBlank(signPatientManageRoute.getSn())) {
signPatientManageRouteNode.setTaskExcuteType(TaskExcuteTypeEnum.BATCH_TASK.getInfo());
signPatientManageRouteNode.setSn(signPatientManageRoute.getSn());
} else
signPatientManageRouteNode.setTaskExcuteType(TaskExcuteTypeEnum.ACTUAL_TIME_TASK.getInfo());
signPatientManageRouteNode.setNodePlanTime(routeNode.getNodePlanTime());
signPatientManageRouteNode.setNodePlanTime(routeNode.getNodePlanTime());
//电话外呼
if (Objects.nonNull(routeNode) && TaskNodeTypeEnum.PHONE_OUTBOUND.getInfo().equals(routeNode.getTaskNodeType())) {
@ -1515,7 +1509,6 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
signPatientManageRouteNode.setMessagePushSign(Objects.isNull(routeNode.getMessagePushSign()) ? null : routeNode.getMessagePushSign());
signPatientManageRouteNode.setMessageTemplateId(Objects.isNull(routeNode.getMessageTemplateId()) ? null : routeNode.getMessageTemplateId());
signPatientManageRouteNode.setMessageTemplateCode(Objects.isNull(routeNode.getMessageTemplateCode()) ? null : routeNode.getMessageTemplateCode());
;
signPatientManageRouteNode.setMessageTemplateName(StringUtils.isBlank(routeNode.getMessageTemplateName()) ? null : routeNode.getMessageTemplateName());
//公众号
signPatientManageRouteNode.setOfficialPushSign(Objects.isNull(routeNode.getOfficialPushSign()) ? null : routeNode.getOfficialPushSign());
@ -1561,7 +1554,7 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
/**
* 发送短信
* 发送短信(无变量)
*/
@Override
public Boolean sendSms(SmsInfoDTO smsInfoDTO) throws ClientException, ServiceException {

View File

@ -13,11 +13,13 @@ import com.xinelu.common.constant.TemplateTypeConstants;
import com.xinelu.common.constant.TriggerConditionOperatorConstants;
import com.xinelu.common.constant.TriggerLogicConstants;
import com.xinelu.common.constant.VisitMethodConstants;
import com.xinelu.common.core.domain.entity.SysUser;
import com.xinelu.common.enums.*;
import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.SecurityUtils;
import com.xinelu.common.utils.StringUtils;
import com.xinelu.common.utils.bean.BeanUtils;
import com.xinelu.manage.domain.agency.Agency;
import com.xinelu.manage.domain.patientinfo.PatientAllInfoViewUppercase;
import com.xinelu.manage.domain.patientinfo.PatientInfo;
import com.xinelu.manage.domain.patientnodeparamscurrent.PatientNodeParamsCurrent;
@ -39,6 +41,7 @@ import com.xinelu.manage.domain.textmessage.TextMessage;
import com.xinelu.manage.domain.wechattemplate.WechatTemplate;
import com.xinelu.manage.dto.patientinfo.PatientInfoDto;
import com.xinelu.manage.dto.signpatientmanageroutenode.*;
import com.xinelu.manage.mapper.agency.AgencyMapper;
import com.xinelu.manage.mapper.labelfieldcontent.LabelFieldContentMapper;
import com.xinelu.manage.mapper.patientinfo.PatientAllInfoViewMapper;
import com.xinelu.manage.mapper.patientinfo.PatientInfoMapper;
@ -87,6 +90,8 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import com.xinelu.system.mapper.SysUserMapper;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.jsoup.Jsoup;
@ -148,6 +153,10 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage
private PhoneDialRecordMapper phoneDialRecordMapper;
@Resource
private IAIOBService aiobService;
@Resource
private SysUserMapper sysUserMapper;
@Resource
private AgencyMapper agencyMapper;
/**
* 查询签约患者管理任务路径节点
@ -1409,6 +1418,14 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage
if (Objects.nonNull(uploadRobotPublishRecordDto)){
uploadRobotPublishRecordDto.setQuestionType(QuestionTypeEnum.FEEDBACK_BLANKS_SUBJECT.getInfo());
}
//登录用户科室信息
SysUser sysUser = sysUserMapper.selectUserById(SecurityUtils.getUserId());
if (Objects.nonNull(sysUser) && Objects.nonNull(sysUser.getHospitalAgencyId())){
Agency agency = agencyMapper.selectAgencyById(sysUser.getHospitalAgencyId());
if (Objects.nonNull(agency) && Objects.nonNull(agency.getId())){
uploadRobotPublishRecordDto.setHospitalAgencyId(agency.getId());
}
}
List<UploadRobotPublishRecordVo> uploadRobotPublishRecordVos = signPatientManageRouteNodeMapper.selectTaskContented(uploadRobotPublishRecordDto);
//总分为0设为null
if(CollectionUtils.isNotEmpty(uploadRobotPublishRecordVos)){

View File

@ -1,10 +1,9 @@
package com.xinelu.manage.service.textmessage;
import com.xinelu.common.core.page.TableDataInfo;
import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.manage.dto.textmessage.TextMessageDTO;
import com.xinelu.manage.dto.textmessage.TextMessageTaskDTO;
import com.xinelu.manage.vo.textmessage.TextMessageTaskVO;
import com.xinelu.manage.vo.textmessage.TextMessageVO;
import java.util.List;
@ -62,4 +61,9 @@ public interface ITextMessageService {
* @return 结果
*/
public int deleteTextMessageById(Long id);
/**
* 查询话术变量
*/
AjaxResult selectTextMessageVariable(Long id);
}

View File

@ -1,11 +1,11 @@
package com.xinelu.manage.service.textmessage.impl;
import com.xinelu.common.annotation.DataScope;
import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.core.domain.entity.SysDictData;
import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.SecurityUtils;
import com.xinelu.common.utils.bean.BeanUtils;
import com.xinelu.common.utils.uuid.IdUtils;
import com.xinelu.manage.domain.textmessage.TextMessage;
import com.xinelu.manage.domain.textmessagesuittask.TextMessageSuitTask;
import com.xinelu.manage.dto.textmessage.TextMessageDTO;
@ -15,13 +15,13 @@ import com.xinelu.manage.service.textmessage.ITextMessageService;
import com.xinelu.manage.vo.textmessage.TextMessageTaskVO;
import com.xinelu.manage.vo.textmessage.TextMessageVO;
import com.xinelu.system.mapper.SysDictDataMapper;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
/**
@ -218,4 +218,21 @@ public class TextMessageServiceImpl implements ITextMessageService {
public int deleteTextMessageById(Long id) {
return textMessageMapper.deleteTextMessageById(id);
}
/**
* 查询话术变量
*/
@Override
public AjaxResult selectTextMessageVariable(Long id) {
TextMessage textMessage = textMessageMapper.selectTextMessageById(id);
if (Objects.isNull(textMessage) || StringUtils.isBlank(textMessage.getVariables())) {
return AjaxResult.success();
}
List<String> variables = Arrays.asList(textMessage.getVariables().split("\\|"));
Map<String, String> variablehMap = new HashMap<>();
for (String variable : variables) {
variablehMap.put(variable, null);
}
return AjaxResult.success(variablehMap);
}
}

View File

@ -0,0 +1,38 @@
package com.xinelu.manage.vo.batchsendtaskinfo;
import com.xinelu.manage.domain.batchsendtaskinfo.BatchSendTaskInfo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 批量推送任务查看vo
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class BatchSendTaskVo extends BatchSendTaskInfo {
@ApiModelProperty(value = "拨打状态DIALED,已拨打NODIALED:未拨打默认NULL表示未拨打")
private String dialStatus;
/**
* 节点任务执行状态已执行EXECUTED未执行UNEXECUTED
*/
@ApiModelProperty(value = "节点任务执行状态已执行EXECUTED未执行UNEXECUTED")
private String nodeExecuteStatus;
@ApiModelProperty(value = "默认已接通CONNECTED未接通:NOTCONNECTED")
private String phoneConnectStatus;
/**
* 电话拨通情况SUCCESS成功FAILURE失败EXPIRED超期自动作废如超期一周NULL或空字符串缺省值表示未执行
*/
@ApiModelProperty(value = "电话拨通情况")
private String phoneNodeExecuteResultStatus;
/**
* 短信发送情况SUCCESS成功FAILURE失败EXPIRED超期自动作废如超期一周NULL或空字符串缺省值表示未执行
*/
@ApiModelProperty(value = "短信发送情况")
private String messageNodeExecuteResultStatus;
}

View File

@ -0,0 +1,18 @@
package com.xinelu.manage.vo.batchsendtaskrecordinfo;
import com.xinelu.manage.domain.batchsendtaskrecordinfo.BatchSendTaskRecordInfo;
import com.xinelu.manage.vo.batchsendtaskinfo.BatchSendTaskVo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
/**
* 批量推送任务查看vo
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class BatchSendTaskRecordVo extends BatchSendTaskRecordInfo {
List<BatchSendTaskVo> batchSendTaskInfos;
}

View File

@ -0,0 +1,125 @@
package com.xinelu.manage.vo.phonedialrecord;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.xinelu.common.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* 电话账单信息
*/
@Data
public class BillPhoneDialVo {
/**
* 主键id
*/
private Long id;
/**
* 患者id
*/
@ApiModelProperty(value = "患者id")
private Long patientId;
/**
* 患者姓名
*/
@ApiModelProperty(value = "患者姓名")
@Excel(name = "姓名")
private String patientName;
/**
* 签约患者管理任务节点表id
*/
@ApiModelProperty(value = "签约患者管理任务节点表id")
private Long manageRouteNodeId;
/**
* 患者手机号
*/
@ApiModelProperty(value = "患者手机号")
@Excel(name = "手机号")
private String patientPhone;
/**
* 呼叫时间
*/
@ApiModelProperty(value = "呼叫时间")
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "呼叫时间", width = 30, dateFormat = "yyyy-MM-dd")
private LocalDateTime dialTime;
/**
* 电话模板id
*/
@ApiModelProperty(value = "电话模板id")
private String phoneTemplateId;
/**
* 电话模板名称
*/
@ApiModelProperty(value = "电话模板名称")
@Excel(name = "模板名称")
private String phoneTemplateName;
/**
* 替换标签之后的电话内容
*/
@ApiModelProperty(value = "替换标签之后的电话内容")
private String messageNodeContent;
/**
* AI 自动外呼 COMMON人工随访电话否则为空
*/
@ApiModelProperty(value = "AI :自动外呼 或 COMMON人工随访电话否则为空")
private String phoneDialMethod;
/**
* 生成通话录音唯一标识,可通过该标识获取录音
*/
@ApiModelProperty(value = "生成通话录音唯一标识,可通过该标识,获取录音")
private String ctUuid;
/**
* 通话录音存储路径
*/
@ApiModelProperty(value = "通话录音存储路径")
private String phoneDialRecordVideo;
/**
* 通话时长
*/
@ApiModelProperty(value = "通话时长")
@Excel(name = "通话时长")
private BigDecimal phoneDuration;
/**
* 通话费用
*/
@ApiModelProperty(value = "单价")
@Excel(name = "单价")
private BigDecimal phoneUnitPrice;
/**
* 通话费用
*/
@ApiModelProperty(value = "通话费用")
@Excel(name = "通话费用")
private BigDecimal phoneExpense;
/**
* 关联账单id
*/
@ApiModelProperty(value = "关联账单id")
private Long billId;
/**
* 关联账单名称
*/
@ApiModelProperty(value = "关联账单名称")
private Long billName;
}

View File

@ -0,0 +1,114 @@
package com.xinelu.manage.vo.shortmessagesendrecord;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.xinelu.common.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* 账单短信
*/
@Data
public class ShortMessageSendRecordVo {
/**
* 主键id
*/
private Long id;
/**
* 患者id
*/
@ApiModelProperty(value = "患者id")
private Long patientId;
/**
* 患者姓名
*/
@ApiModelProperty(value = "患者姓名")
@Excel(name = "姓名")
private String patientName;
/**
* 签约患者管理任务节点表id
*/
@ApiModelProperty(value = "签约患者管理任务节点表id")
private Long manageRouteNodeId;
/**
* 患者手机号
*/
@ApiModelProperty(value = "患者手机号")
@Excel(name = "手机号")
private String patientPhone;
/**
* 消息发送时间
*/
@ApiModelProperty(value = "消息发送时间")
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "消息发送时间", width = 30, dateFormat = "yyyy-MM-dd")
private LocalDateTime sendTime;
/**
* 消息模板id
*/
@ApiModelProperty(value = "消息模板id")
private String messageTemplateId;
/**
* 电话模板名称
*/
@ApiModelProperty(value = "电话模板名称")
@Excel(name = "模板名称")
private String template;
/**
* 消息内容
*/
@ApiModelProperty(value = "消息内容")
private String messageNodeContent;
/**
* 短信长度
*/
@ApiModelProperty(value = "短信长度")
@Excel(name = "短信长度")
private Long messageLength;
/**
* 短信数量
*/
@ApiModelProperty(value = "短信数量")
@Excel(name = "短信数量")
private Long messageQuantity;
/**
* 短信单价
*/
@ApiModelProperty(value = "短信单价")
@Excel(name = "短信单价")
private BigDecimal messageUnitPrice;
/**
* 短信价格
*/
@ApiModelProperty(value = "短信价格")
@Excel(name = "短信价格")
private BigDecimal messageExpense;
/**
* 关联账单id
*/
@ApiModelProperty(value = "关联账单id")
private Long billId;
/**
* 关联账单名称
*/
@ApiModelProperty(value = "关联账单名称")
private Long billName;
}

View File

@ -122,4 +122,9 @@ public class TextMessageTaskVO {
* 短信模版code手动创建人任务使用
*/
private String messageTemplateCode;
/**
* 短信变量竖线隔开来源于创建短息任务页面
*/
private String variables;
}

View File

@ -122,4 +122,9 @@ public class TextMessageVO extends BaseEntity {
* 短信模版code手动创建人任务使用
*/
private String messageTemplateCode;
/**
* 短信变量竖线隔开来源于创建短息任务页面
*/
private String variables;
}

View File

@ -0,0 +1,388 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xinelu.manage.mapper.batchsendtaskinfo.BatchSendTaskInfoMapper">
<resultMap type="com.xinelu.manage.domain.batchsendtaskinfo.BatchSendTaskInfo" id="BatchSendTaskInfoResult">
<result property="id" column="id"/>
<result property="orderNum" column="order_num"/>
<result property="sn" column="sn"/>
<result property="importName" column="import_name"/>
<result property="teamName" column="team_name"/>
<result property="hospitalAgencyId" column="hospital_agency_id"/>
<result property="hospitalAgencyName" column="hospital_agency_name"/>
<result property="departmentId" column="department_id"/>
<result property="departmentName" column="department_name"/>
<result property="visitDate" column="visit_date"/>
<result property="inHospitalNumber" column="in_hospital_number"/>
<result property="patientName" column="patient_name"/>
<result property="patientPhone" column="patient_phone"/>
<result property="age" column="age"/>
<result property="sex" column="sex"/>
<result property="cardNo" column="card_no"/>
<result property="personnelType" column="personnel_type"/>
<result property="crowdId" column="crowd_id"/>
<result property="crowdName" column="crowd_name"/>
<result property="physicalExaminationSummary" column="physical_examination_summary"/>
<result property="physicalExaminationLabel" column="physical_examination_label"/>
<result property="delFlag" column="del_flag"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
</resultMap>
<sql id="selectBatchSendTaskInfoVo">
select id,
order_num,
sn,
import_name,
team_name,
hospital_agency_id,
hospital_agency_name,
department_id,
department_name,
visit_date,
in_hospital_number,
patient_name,
patient_phone,
age,
sex,
card_no,
personnel_type,
crowd_id,
crowd_name,
physical_examination_summary,
physical_examination_label,
create_by,
create_time,
del_flag
from batch_send_task_info
</sql>
<select id="selectBatchSendTaskInfoList"
parameterType="com.xinelu.manage.dto.batchsendtaskinfo.BatchSendTaskDto"
resultMap="BatchSendTaskInfoResult">
<include refid="selectBatchSendTaskInfoVo"/>
<where>
del_flag = 0
<if test="orderNum != null ">
and order_num = #{orderNum}
</if>
<if test="sn != null and sn != ''">
and sn = #{sn}
</if>
<if test="importName != null and importName != ''">
and import_name like concat('%', #{importName}, '%')
</if>
<if test="teamName != null and teamName != ''">
and team_name like concat('%', #{teamName}, '%')
</if>
<if test="hospitalAgencyId != null ">
and hospital_agency_id = #{hospitalAgencyId}
</if>
<if test="hospitalAgencyName != null and hospitalAgencyName != ''">
and hospital_agency_name like concat('%', #{hospitalAgencyName}, '%')
</if>
<if test="departmentId != null ">
and department_id = #{departmentId}
</if>
<if test="departmentName != null and departmentName != ''">
and department_name like concat('%', #{departmentName}, '%')
</if>
<if test="visitDate != null ">
and visit_date = #{visitDate}
</if>
<if test="startDate != null ">
and date_format(visit_date, '%y%m%d') >= date_format(#{startDate}, '%y%m%d')
</if>
<if test="endDate != null ">
and date_format(visit_date, '%y%m%d') &lt;= date_format(#{endDate}, '%y%m%d')
</if>
<if test="inHospitalNumber != null and inHospitalNumber != ''">
and in_hospital_number = #{inHospitalNumber}
</if>
<if test="patientName != null and patientName != ''">
and patient_name like concat('%', #{patientName}, '%')
</if>
<if test="patientPhone != null and patientPhone != ''">
and patient_phone = #{patientPhone}
</if>
<if test="age != null ">
and age = #{age}
</if>
<if test="sex != null">
and sex = #{sex}
</if>
<if test="cardNo != null and cardNo != ''">
and card_no = #{cardNo}
</if>
<if test="personnelType != null and personnelType != ''">
and personnel_type = #{personnelType}
</if>
<if test="crowdId != null ">
and crowd_id = #{crowdId}
</if>
<if test="crowdName != null and crowdName != ''">
and crowd_name like concat('%', #{crowdName}, '%')
</if>
<if test="physicalExaminationSummary != null and physicalExaminationSummary != ''">
and physical_examination_summary = #{physicalExaminationSummary}
</if>
<if test="physicalExaminationLabel != null and physicalExaminationLabel != ''">
and physical_examination_label like concat('%', #{physicalExaminationLabel}, '%')
</if>
</where>
</select>
<select id="selectBatchSendTaskInfoById" parameterType="Long"
resultMap="BatchSendTaskInfoResult">
<include refid="selectBatchSendTaskInfoVo"/>
where id = #{id}
</select>
<insert id="insertBatchSendTaskInfo" parameterType="com.xinelu.manage.domain.batchsendtaskinfo.BatchSendTaskInfo"
useGeneratedKeys="true"
keyProperty="id">
insert into batch_send_task_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="orderNum != null">order_num,
</if>
<if test="sn != null and sn != ''">sn,
</if>
<if test="importName != null">import_name,
</if>
<if test="teamName != null">team_name,
</if>
<if test="hospitalAgencyId != null">hospital_agency_id,
</if>
<if test="hospitalAgencyName != null">hospital_agency_name,
</if>
<if test="departmentId != null">department_id,
</if>
<if test="departmentName != null">department_name,
</if>
<if test="visitDate != null">visit_date,
</if>
<if test="inHospitalNumber != null and inHospitalNumber != ''">in_hospital_number,
</if>
<if test="patientName != null and patientName != ''">patient_name,
</if>
<if test="patientPhone != null and patientPhone != ''">patient_phone,
</if>
<if test="age != null">age,
</if>
<if test="sex != null">sex,
</if>
<if test="cardNo != null">card_no,
</if>
<if test="personnelType != null">personnel_type,
</if>
<if test="crowdId != null">crowd_id,
</if>
<if test="crowdName != null">crowd_name,
</if>
<if test="physicalExaminationSummary != null">physical_examination_summary,
</if>
<if test="physicalExaminationLabel != null">physical_examination_label,
</if>
<if test="createBy != null">create_by,
</if>
<if test="createTime != null">create_time,
</if>
<if test="delFlag != null">del_flag,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderNum != null">#{orderNum},
</if>
<if test="sn != null and sn != ''">#{sn},
</if>
<if test="importName != null">#{importName},
</if>
<if test="teamName != null">#{teamName},
</if>
<if test="hospitalAgencyId != null">#{hospitalAgencyId},
</if>
<if test="hospitalAgencyName != null">#{hospitalAgencyName},
</if>
<if test="departmentId != null">#{departmentId},
</if>
<if test="departmentName != null">#{departmentName},
</if>
<if test="visitDate != null">#{visitDate},
</if>
<if test="inHospitalNumber != null and inHospitalNumber != ''">#{inHospitalNumber},
</if>
<if test="patientName != null and patientName != ''">#{patientName},
</if>
<if test="patientPhone != null and patientPhone != ''">#{patientPhone},
</if>
<if test="age != null">#{age},
</if>
<if test="sex != null">#{sex},
</if>
<if test="cardNo != null">#{cardNo},
</if>
<if test="personnelType != null">#{personnelType},
</if>
<if test="crowdId != null">#{crowdId},
</if>
<if test="crowdName != null">#{crowdName},
</if>
<if test="physicalExaminationSummary != null">#{physicalExaminationSummary},
</if>
<if test="physicalExaminationLabel != null">#{physicalExaminationLabel},
</if>
<if test="createBy != null">#{createBy},
</if>
<if test="createTime != null">#{createTime},
</if>
<if test="delFlag != null">#{delFlag},
</if>
</trim>
</insert>
<update id="updateBatchSendTaskInfo" parameterType="com.xinelu.manage.domain.batchsendtaskinfo.BatchSendTaskInfo">
update batch_send_task_info
<trim prefix="SET" suffixOverrides=",">
<if test="orderNum != null">order_num =
#{orderNum},
</if>
<if test="sn != null and sn != ''">sn =
#{sn},
</if>
<if test="importName != null">import_name =
#{importName},
</if>
<if test="teamName != null">team_name =
#{teamName},
</if>
<if test="hospitalAgencyId != null">hospital_agency_id =
#{hospitalAgencyId},
</if>
<if test="hospitalAgencyName != null">hospital_agency_name =
#{hospitalAgencyName},
</if>
<if test="departmentId != null">department_id =
#{departmentId},
</if>
<if test="departmentName != null">department_name =
#{departmentName},
</if>
<if test="visitDate != null">visit_date =
#{visitDate},
</if>
<if test="inHospitalNumber != null and inHospitalNumber != ''">in_hospital_number =
#{inHospitalNumber},
</if>
<if test="patientName != null and patientName != ''">patient_name =
#{patientName},
</if>
<if test="patientPhone != null and patientPhone != ''">patient_phone =
#{patientPhone},
</if>
<if test="age != null">age =
#{age},
</if>
<if test="sex != null">
sex = #{sex},
</if>
<if test="cardNo != null">card_no =
#{cardNo},
</if>
<if test="personnelType != null">personnel_type =
#{personnelType},
</if>
<if test="crowdId != null">crowd_id =
#{crowdId},
</if>
<if test="crowdName != null">crowd_name =
#{crowdName},
</if>
<if test="physicalExaminationSummary != null">physical_examination_summary =
#{physicalExaminationSummary},
</if>
<if test="physicalExaminationLabel != null">physical_examination_label =
#{physicalExaminationLabel},
</if>
<if test="createBy != null">create_by =
#{createBy},
</if>
<if test="createTime != null">create_time =
#{createTime},
</if>
<if test="delFlag != null">del_flag =
#{delFlag},
</if>
</trim>
where id = #{id}
</update>
<delete id="deleteBatchSendTaskInfoById" parameterType="Long">
delete
from batch_send_task_info
where id = #{id}
</delete>
<delete id="deleteBatchSendTaskInfoByIds" parameterType="String">
delete from batch_send_task_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<insert id="insertBatchSendTaskInfoList" useGeneratedKeys="true" keyProperty="id">
insert into batch_send_task_info(
order_num,
sn,
import_name,
team_name,
hospital_agency_id,
hospital_agency_name,
department_id,
department_name,
visit_date,
in_hospital_number,
patient_name,
patient_phone,
age,
sex,
card_no,
personnel_type,
crowd_id,
crowd_name,
physical_examination_summary,
physical_examination_label,
del_flag,
create_by,
create_time
) values
<foreach item="BatchSendTaskInfo" index="index" collection="list" separator=",">
(
#{BatchSendTaskInfo.orderNum},
#{BatchSendTaskInfo.sn},
#{BatchSendTaskInfo.importName},
#{BatchSendTaskInfo.teamName},
#{BatchSendTaskInfo.hospitalAgencyId},
#{BatchSendTaskInfo.hospitalAgencyName},
#{BatchSendTaskInfo.departmentId},
#{BatchSendTaskInfo.departmentName},
#{BatchSendTaskInfo.visitDate},
#{BatchSendTaskInfo.inHospitalNumber},
#{BatchSendTaskInfo.patientName},
#{BatchSendTaskInfo.patientPhone},
#{BatchSendTaskInfo.age},
#{BatchSendTaskInfo.sex},
#{BatchSendTaskInfo.cardNo},
#{BatchSendTaskInfo.personnelType},
#{BatchSendTaskInfo.crowdId},
#{BatchSendTaskInfo.crowdName},
#{BatchSendTaskInfo.physicalExaminationSummary},
#{BatchSendTaskInfo.physicalExaminationLabel},
#{BatchSendTaskInfo.delFlag},
#{BatchSendTaskInfo.createBy},
#{BatchSendTaskInfo.createTime}
)
</foreach>
</insert>
</mapper>

View File

@ -0,0 +1,79 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xinelu.manage.mapper.batchsendtasklabelinfo.BatchSendTaskLabelInfoMapper">
<resultMap type="BatchSendTaskLabelInfo" id="BatchSendTaskLabelInfoResult">
<result property="id" column="id"/>
<result property="physicalExaminationLabel" column="physical_examination_label"/>
</resultMap>
<sql id="selectBatchSendTaskLabelInfoVo">
select id, physical_examination_label
from batch_send_task_label_info
</sql>
<select id="selectBatchSendTaskLabelInfoList" parameterType="BatchSendTaskLabelInfo"
resultMap="BatchSendTaskLabelInfoResult">
<include refid="selectBatchSendTaskLabelInfoVo"/>
<where>
<if test="physicalExaminationLabel != null and physicalExaminationLabel != ''">
and physical_examination_label = #{physicalExaminationLabel}
</if>
</where>
</select>
<select id="selectBatchSendTaskLabelInfoById" parameterType="Long"
resultMap="BatchSendTaskLabelInfoResult">
<include refid="selectBatchSendTaskLabelInfoVo"/>
where id = #{id}
</select>
<insert id="insertBatchSendTaskLabelInfo" parameterType="BatchSendTaskLabelInfo" useGeneratedKeys="true"
keyProperty="id">
insert into batch_send_task_label_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="physicalExaminationLabel != null">physical_examination_label,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="physicalExaminationLabel != null">#{physicalExaminationLabel},
</if>
</trim>
</insert>
<update id="updateBatchSendTaskLabelInfo" parameterType="BatchSendTaskLabelInfo">
update batch_send_task_label_info
<trim prefix="SET" suffixOverrides=",">
<if test="physicalExaminationLabel != null">physical_examination_label =
#{physicalExaminationLabel},
</if>
</trim>
where id = #{id}
</update>
<delete id="deleteBatchSendTaskLabelInfoById" parameterType="Long">
delete
from batch_send_task_label_info
where id = #{id}
</delete>
<delete id="deleteBatchSendTaskLabelInfoByIds" parameterType="String">
delete from batch_send_task_label_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<insert id="insertBatchSendTaskLabelInfList">
insert into batch_send_task_label_info(
physical_examination_label
)
values
<foreach collection="list" item="label" separator=",">
(#{label})
</foreach>
</insert>
</mapper>

View File

@ -0,0 +1,306 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xinelu.manage.mapper.batchsendtaskrecordinfo.BatchSendTaskRecordInfoMapper">
<resultMap type="com.xinelu.manage.domain.batchsendtaskrecordinfo.BatchSendTaskRecordInfo"
id="BatchSendTaskRecordInfoResult">
<result property="id" column="id"/>
<result property="batchTaskNumber" column="batch_task_number"/>
<result property="batchTaskName" column="batch_task_name"/>
<result property="taskExecuteType" column="task_execute_type"/>
<result property="nodePlanTime" column="node_plan_time"/>
<result property="batchTaskSource" column="batch_task_source"/>
<result property="templateId" column="template_id"/>
<result property="templateName" column="template_name"/>
<result property="nodeContent" column="node_content"/>
<result property="nodeExecuteStatus" column="node_execute_status"/>
<result property="physicalExaminationLabel" column="physical_examination_label"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
</resultMap>
<resultMap type="com.xinelu.manage.vo.batchsendtaskrecordinfo.BatchSendTaskRecordVo"
id="BatchSendTaskRecordVoResult">
<result property="id" column="id"/>
<result property="batchTaskNumber" column="batch_task_number"/>
<result property="batchTaskName" column="batch_task_name"/>
<result property="taskExecuteType" column="task_execute_type"/>
<result property="nodePlanTime" column="node_plan_time"/>
<result property="batchTaskSource" column="batch_task_source"/>
<result property="templateId" column="template_id"/>
<result property="templateName" column="template_name"/>
<result property="nodeContent" column="node_content"/>
<result property="nodeExecuteStatus" column="node_execute_status"/>
<result property="physicalExaminationLabel" column="physical_examination_label"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<collection property="batchSendTaskInfos" javaType="java.util.List"
resultMap="BatchSendTaskVoResult"/>
</resultMap>
<resultMap type="com.xinelu.manage.vo.batchsendtaskinfo.BatchSendTaskVo" id="BatchSendTaskVoResult">
<result property="id" column="id"/>
<result property="orderNum" column="order_num"/>
<result property="sn" column="sn"/>
<result property="importName" column="import_name"/>
<result property="teamName" column="team_name"/>
<result property="hospitalAgencyId" column="hospital_agency_id"/>
<result property="hospitalAgencyName" column="hospital_agency_name"/>
<result property="departmentId" column="department_id"/>
<result property="departmentName" column="department_name"/>
<result property="visitDate" column="visit_date"/>
<result property="inHospitalNumber" column="in_hospital_number"/>
<result property="patientName" column="patient_name"/>
<result property="patientPhone" column="patient_phone"/>
<result property="age" column="age"/>
<result property="sex" column="sex"/>
<result property="cardNo" column="card_no"/>
<result property="personnelType" column="personnel_type"/>
<result property="crowdId" column="crowd_id"/>
<result property="crowdName" column="crowd_name"/>
<result property="physicalExaminationLabel" column="physical_examination_label"/>
<result property="dialStatus" column="dial_status"/>
<result property="phoneNodeExecuteResultStatus" column="phone_node_execute_result_status"/>
<result property="messageNodeExecuteResultStatus" column="message_node_execute_result_status"/>
<result property="nodeExecuteStatus" column="node_execute_status"/>
<result property="phoneConnectStatus" column="phone_connect_status"/>
</resultMap>
<sql id="selectBatchSendTaskRecordInfoVo">
select id,
batch_task_number,
batch_task_name,
task_execute_type,
node_plan_time,
batch_task_source,
template_id,
template_name,
robot_publish_id,
node_content,
node_execute_status,
physical_examination_label,
del_flag,
create_by,
create_time
from batch_send_task_record_info
</sql>
<select id="selectBatchSendTaskRecordInfoList" parameterType="BatchSendTaskRecordInfo"
resultMap="BatchSendTaskRecordInfoResult">
<include refid="selectBatchSendTaskRecordInfoVo"/>
<where>
<if test="batchTaskNumber != null ">
and batch_task_number = #{batchTaskNumber}
</if>
<if test="batchTaskName != null and batchTaskName != ''">
and batch_task_name like concat('%', #{batchTaskName}, '%')
</if>
<if test="taskExecuteType != null and taskExecuteType != ''">
and task_execute_type = #{taskExecuteType}
</if>
<if test="nodePlanTime != null ">
and node_plan_time = #{nodePlanTime}
</if>
<if test="batchTaskSource != null and batchTaskSource != ''">
and batch_task_source = #{batchTaskSource}
</if>
<if test="templateId != null and templateId != ''">
and template_id = #{templateId}
</if>
<if test="templateName != null and templateName != ''">
and template_name like concat('%', #{templateName}, '%')
</if>
<if test="nodeContent != null and nodeContent != ''">
and node_content = #{nodeContent}
</if>
<if test="nodeExecuteStatus != null and nodeExecuteStatus != ''">
and node_execute_status = #{nodeExecuteStatus}
</if>
<if test="physicalExaminationLabel != null and physicalExaminationLabel != ''">
and physical_examination_label = #{physicalExaminationLabel}
</if>
</where>
</select>
<select id="selectBatchSendTaskRecordInfoById" parameterType="Long"
resultMap="BatchSendTaskRecordInfoResult">
<include refid="selectBatchSendTaskRecordInfoVo"/>
where id = #{id}
</select>
<insert id="insertBatchSendTaskRecordInfo" parameterType="BatchSendTaskRecordInfo" useGeneratedKeys="true"
keyProperty="id">
insert into batch_send_task_record_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="batchTaskNumber != null">batch_task_number,
</if>
<if test="batchTaskName != null">batch_task_name,
</if>
<if test="taskExecuteType != null">task_execute_type,
</if>
<if test="nodePlanTime != null">node_plan_time,
</if>
<if test="batchTaskSource != null">batch_task_source,
</if>
<if test="templateId != null">template_id,
</if>
<if test="templateName != null">template_name,
</if>
<if test="robotPublishId != null">robot_publish_id,
</if>
<if test="nodeContent != null">node_content,
</if>
<if test="nodeExecuteStatus != null">node_execute_status,
</if>
<if test="physicalExaminationLabel != null">physical_examination_label,
</if>
<if test="delFlag != null">del_flag,
</if>
<if test="createBy != null">create_by,
</if>
<if test="createTime != null">create_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="batchTaskNumber != null">#{batchTaskNumber},
</if>
<if test="batchTaskName != null">#{batchTaskName},
</if>
<if test="taskExecuteType != null">#{taskExecuteType},
</if>
<if test="nodePlanTime != null">#{nodePlanTime},
</if>
<if test="batchTaskSource != null">#{batchTaskSource},
</if>
<if test="templateId != null">#{templateId},
</if>
<if test="templateName != null">#{templateName},
</if>
<if test="robotPublishId != null">#{robotPublishId},
</if>
<if test="nodeContent != null">#{nodeContent},
</if>
<if test="nodeExecuteStatus != null">#{nodeExecuteStatus},
</if>
<if test="physicalExaminationLabel != null">#{physicalExaminationLabel},
</if>
<if test="delFlag != null">#{delFlag},
</if>
<if test="createBy != null">#{createBy},
</if>
<if test="createTime != null">#{createTime},
</if>
</trim>
</insert>
<update id="updateBatchSendTaskRecordInfo" parameterType="BatchSendTaskRecordInfo">
update batch_send_task_record_info
<trim prefix="SET" suffixOverrides=",">
<if test="batchTaskNumber != null">batch_task_number =
#{batchTaskNumber},
</if>
<if test="batchTaskName != null">batch_task_name =
#{batchTaskName},
</if>
<if test="taskExecuteType != null">task_execute_type =
#{taskExecuteType},
</if>
<if test="nodePlanTime != null">node_plan_time =
#{nodePlanTime},
</if>
<if test="batchTaskSource != null">batch_task_source =
#{batchTaskSource},
</if>
<if test="templateId != null">template_id =
#{templateId},
</if>
<if test="templateName != null">template_name =
#{templateName},
</if>
<if test="robotPublishId != null">robot_publish_id =
#{robotPublishId},
</if>
<if test="nodeContent != null">node_content =
#{nodeContent},
</if>
<if test="nodeExecuteStatus != null">node_execute_status =
#{nodeExecuteStatus},
</if>
<if test="physicalExaminationLabel != null">physical_examination_label =
#{physicalExaminationLabel},
</if>
<if test="delFlag != null">del_flag =
#{delFlag},
</if>
<if test="createBy != null">create_by =
#{createBy},
</if>
<if test="createTime != null">create_time =
#{createTime},
</if>
</trim>
where id = #{id}
</update>
<delete id="deleteBatchSendTaskRecordInfoById" parameterType="Long">
delete
from batch_send_task_record_info
where id = #{id}
</delete>
<delete id="deleteBatchSendTaskRecordInfoByIds" parameterType="String">
delete from batch_send_task_record_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="selectBatchSendTaskRecordVoById"
resultMap="BatchSendTaskRecordVoResult">
select bstri.id,
bstri.batch_task_number,
bstri.batch_task_name,
bstri.task_execute_type,
bstri.node_plan_time,
bstri.batch_task_source,
bstri.template_id,
bstri.template_name,
bstri.node_content,
bstri.node_execute_status,
bstri.physical_examination_label,
bstri.create_by,
bstri.create_time,
bsti.id,
bsti.order_num,
bsti.sn,
bsti.import_name,
bsti.team_name,
bsti.hospital_agency_id,
bsti.hospital_agency_name,
bsti.department_id,
bsti.department_name,
bsti.visit_date,
bsti.in_hospital_number,
bsti.patient_name,
bsti.patient_phone,
bsti.age,
bsti.sex,
bsti.card_no,
bsti.personnel_type,
bsti.crowd_id,
bsti.crowd_name,
bsti.physical_examination_label,
spmrn.dial_status,
spmrn.node_execute_status,
spmrn.phone_connect_status,
spmrn.phone_node_execute_result_status,
spmrn.message_node_execute_result_status
from batch_send_task_record_info bstri
LEFT JOIN sign_patient_manage_route spmr on bstri.id = spmr.batch_send_task_record_id
LEFT JOIN sign_patient_manage_route_node spmrn on spmr.id = spmrn.manage_route_id
LEFT JOIN batch_send_task_info bsti on spmr.batch_send_task_id = bsti.id
where bstri.id = #{id}
</select>
</mapper>

View File

@ -0,0 +1,121 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xinelu.manage.mapper.batchsendtaskvariableinfo.BatchSendTaskVariableInfoMapper">
<resultMap type="com.xinelu.manage.domain.batchsendtaskvariableinfo.BatchSendTaskVariableInfo" id="BatchSendTaskVariableInfoResult">
<result property="id" column="id"/>
<result property="variable" column="variable"/>
<result property="variableAttribute" column="variable_attribute"/>
<result property="batchSendTaskRecordId" column="batch_send_task_record_id"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
</resultMap>
<sql id="selectBatchSendTaskVariableInfoVo">
select id, variable, variable_attribute, batch_send_task_record_id, create_by, create_time from batch_send_task_variable_info
</sql>
<select id="selectBatchSendTaskVariableInfoList" parameterType="com.xinelu.manage.domain.batchsendtaskvariableinfo.BatchSendTaskVariableInfo" resultMap="BatchSendTaskVariableInfoResult">
<include refid="selectBatchSendTaskVariableInfoVo"/>
<where>
<if test="variable != null and variable != ''">
and variable = #{variable}
</if>
<if test="variableAttribute != null and variableAttribute != ''">
and variable_attribute = #{variableAttribute}
</if>
<if test="batchSendTaskRecordId != null ">
and batch_send_task_record_id = #{batchSendTaskRecordId}
</if>
</where>
</select>
<select id="selectBatchSendTaskVariableInfoById" parameterType="Long"
resultMap="BatchSendTaskVariableInfoResult">
<include refid="selectBatchSendTaskVariableInfoVo"/>
where id = #{id}
</select>
<insert id="insertBatchSendTaskVariableInfo" parameterType="com.xinelu.manage.domain.batchsendtaskvariableinfo.BatchSendTaskVariableInfo" useGeneratedKeys="true"
keyProperty="id">
insert into batch_send_task_variable_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="variable != null">variable,
</if>
<if test="variableAttribute != null">variable_attribute,
</if>
<if test="batchSendTaskRecordId != null">batch_send_task_record_id,
</if>
<if test="createBy != null">create_by,
</if>
<if test="createTime != null">create_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="variable != null">#{variable},
</if>
<if test="variableAttribute != null">#{variableAttribute},
</if>
<if test="batchSendTaskRecordId != null">#{batchSendTaskRecordId},
</if>
<if test="createBy != null">#{createBy},
</if>
<if test="createTime != null">#{createTime},
</if>
</trim>
</insert>
<update id="updateBatchSendTaskVariableInfo" parameterType="com.xinelu.manage.domain.batchsendtaskvariableinfo.BatchSendTaskVariableInfo">
update batch_send_task_variable_info
<trim prefix="SET" suffixOverrides=",">
<if test="variable != null">variable =
#{variable},
</if>
<if test="variableAttribute != null">variable_attribute =
#{variableAttribute},
</if>
<if test="batchSendTaskRecordId != null">batch_send_task_record_id =
#{batchSendTaskRecordId},
</if>
<if test="createBy != null">create_by =
#{createBy},
</if>
<if test="createTime != null">create_time =
#{createTime},
</if>
</trim>
where id = #{id}
</update>
<delete id="deleteBatchSendTaskVariableInfoById" parameterType="Long">
delete from batch_send_task_variable_info where id = #{id}
</delete>
<delete id="deleteBatchSendTaskVariableInfoByIds" parameterType="String">
delete from batch_send_task_variable_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<insert id="insertBatchSendTaskVariableInfos">
insert into batch_send_task_variable_info(
variable,
variable_attribute,
batch_send_task_record_id,
create_by,
create_time)
values
<foreach item="BatchSendTaskVariableInfo" index="index" collection="list" separator=",">
(
#{BatchSendTaskVariableInfo.variable},
#{BatchSendTaskVariableInfo.variableAttribute},
#{BatchSendTaskVariableInfo.batchSendTaskRecordId},
#{BatchSendTaskVariableInfo.createBy},
#{BatchSendTaskVariableInfo.createTime}
)
</foreach>
</insert>
</mapper>

View File

@ -0,0 +1,141 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xinelu.manage.mapper.billinfo.BillInfoMapper">
<resultMap type="BillInfo" id="BillInfoResult">
<result property="id" column="id"/>
<result property="billCode" column="bill_code"/>
<result property="billName" column="bill_name"/>
<result property="billMonth" column="bill_month"/>
<result property="billExpense" column="bill_expense"/>
<result property="paymentStatus" column="payment_status"/>
<result property="billSource" column="bill_source"/>
<result property="createTime" column="create_time"/>
</resultMap>
<sql id="selectBillInfoVo">
select id,
bill_code,
bill_name,
bill_month,
bill_expense,
payment_status,
bill_source,
create_time
from bill_info
</sql>
<select id="selectBillInfoList" parameterType="BillInfo" resultMap="BillInfoResult">
<include refid="selectBillInfoVo"/>
<where>
<if test="billCode != null and billCode != ''">
and bill_code = #{billCode}
</if>
<if test="billName != null and billName != ''">
and bill_name like concat('%', #{billName}, '%')
</if>
<if test="billMonth != null and billMonth != ''">
and bill_month = #{billMonth}
</if>
<if test="billExpense != null ">
and bill_expense = #{billExpense}
</if>
<if test="paymentStatus != null and paymentStatus != ''">
and payment_status = #{paymentStatus}
</if>
<if test="billSource != null and billSource != ''">
and bill_source = #{billSource}
</if>
</where>
</select>
<select id="selectBillInfoById" parameterType="Long"
resultMap="BillInfoResult">
<include refid="selectBillInfoVo"/>
where id = #{id}
</select>
<select id="selectBillInfoByCode" resultType="com.xinelu.manage.domain.billinfo.BillInfo">
<include refid="selectBillInfoVo"/>
where bill_code = #{billCode}
</select>
<insert id="insertBillInfo" parameterType="BillInfo" useGeneratedKeys="true"
keyProperty="id">
insert into bill_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="billCode != null and billCode != ''">bill_code,
</if>
<if test="billName != null and billName != ''">bill_name,
</if>
<if test="billMonth != null and billMonth != ''">bill_month,
</if>
<if test="billExpense != null">bill_expense,
</if>
<if test="paymentStatus != null and paymentStatus != ''">payment_status,
</if>
<if test="billSource != null and billSource != ''">bill_source,
</if>
<if test="createTime != null">create_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="billCode != null and billCode != ''">#{billCode},
</if>
<if test="billName != null and billName != ''">#{billName},
</if>
<if test="billMonth != null and billMonth != ''">#{billMonth},
</if>
<if test="billExpense != null">#{billExpense},
</if>
<if test="paymentStatus != null and paymentStatus != ''">#{paymentStatus},
</if>
<if test="billSource != null and billSource != ''">#{billSource},
</if>
<if test="createTime != null">#{createTime},
</if>
</trim>
</insert>
<update id="updateBillInfo" parameterType="BillInfo">
update bill_info
<trim prefix="SET" suffixOverrides=",">
<if test="billCode != null and billCode != ''">bill_code =
#{billCode},
</if>
<if test="billName != null and billName != ''">bill_name =
#{billName},
</if>
<if test="billMonth != null and billMonth != ''">bill_month =
#{billMonth},
</if>
<if test="billExpense != null">bill_expense =
#{billExpense},
</if>
<if test="paymentStatus != null and paymentStatus != ''">payment_status =
#{paymentStatus},
</if>
<if test="billSource != null and billSource != ''">bill_source =
#{billSource},
</if>
<if test="createTime != null">create_time =
#{createTime},
</if>
</trim>
where id = #{id}
</update>
<delete id="deleteBillInfoById" parameterType="Long">
delete
from bill_info
where id = #{id}
</delete>
<delete id="deleteBillInfoByIds" parameterType="String">
delete from bill_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -80,7 +80,7 @@
or tpd.apply_range = 'PUBLIC'
</if>
</where>
group by task_partition_dict_id
group by lfi.task_partition_dict_id,lfi.task_partition_dict_name
order by ttd.task_type_sort,tpd.task_partition_sort
</select>

View File

@ -837,6 +837,9 @@
<if test="firstDay != null">
and DATE(create_time) &lt;= #{now}
</if>
<if test="hospitalAgencyId != null">
and hospital_agency_id = #{hospitalAgencyId}
</if>
</select>
<select id="selectPatientInfoCountBySignTime" resultType="java.lang.Integer">
@ -851,6 +854,9 @@
<if test="firstDay != null">
and DATE(sign_time) &lt;= #{now}
</if>
<if test="hospitalAgencyId != null">
and hospital_agency_id = #{hospitalAgencyId}
</if>
</select>
<select id="selectPatientSignTotalCount" resultType="java.lang.Integer">
@ -858,6 +864,9 @@
from patient_info
where del_flag = 0
and (service_status = 'SERVICE_CENTER' or service_status = 'SERVICE_END')
<if test="hospitalAgencyId != null">
and hospital_agency_id = #{hospitalAgencyId}
</if>
</select>
<select id="selectPatientSignServiceCount" resultType="java.lang.Integer">

View File

@ -396,9 +396,11 @@
select
count(1)
from patient_pre_hospitalization
where
del_flag = 0
where del_flag = 0
and create_time >= #{firstDay}
and create_time &lt;= #{now}
<if test="hospitalAgencyId != null">
and hospital_agency_id = #{hospitalAgencyId}
</if>
</select>
</mapper>

View File

@ -20,9 +20,12 @@
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="ctUuid" column="ct_uuid"/>
<result property="phoneDialRecordVideo" column="phone_dial_record_video"/>
<result property="ctUuid" column="ct_uuid"/>
<result property="phoneDialRecordVideo" column="phone_dial_record_video"/>
<result property="phoneDuration" column="phone_duration"/>
<result property="phoneExpense" column="phone_expense"/>
<result property="phoneUnitPrice" column="phone_unit_price"/>
<result property="billId" column="bill_id"/>
</resultMap>
<sql id="selectPhoneDialRecordVo">
@ -42,7 +45,11 @@
update_by,
update_time,
ct_uuid,
phone_dial_record_video
phone_dial_record_video,
phone_duration,
phone_expense,
phone_unit_price,
bill_id
from phone_dial_record
</sql>
@ -79,9 +86,63 @@
<if test="errorStatus != null and errorStatus != ''">
and error_status = #{errorStatus}
</if>
<if test="ctUuid != null and ctUuid != ''">
and ct_uuid = #{ctUuid}
</if>
<if test="phoneDialRecordVideo != null and phoneDialRecordVideo != ''">
and phone_dial_record_video = #{phoneDialRecordVideo}
</if>
<if test="phoneDuration != null ">
and phone_duration = #{phoneDuration}
</if>
<if test="phoneExpense != null ">
and phone_expense = #{phoneExpense}
</if>
<if test="billId != null ">
and bill_id = #{billId}
</if>
</where>
</select>
<select id="selectPhoneDialRecords" resultType="com.xinelu.manage.vo.phonedialrecord.BillPhoneDialVo">
select
record.id,
record.patient_id,
record.manage_route_node_id,
record.patient_phone,
record.dial_time,
record.phone_template_id,
record.phone_template_name,
record.message_node_content,
record.ct_uuid,
record.phone_dial_record_video,
record.phone_duration,
record.phone_expense,
record.phone_unit_price,
record.bill_id,
patient.patient_name,
bill.bill_name
from phone_dial_record record
left join patient_info patient on patient.id = record.patient_id
left join bill_info bill ON record.bill_id = bill.id
where 1 = 1
<if test="patientName != null and patientName != ''">
and patient.patient_name = #{patientName}
</if>
<if test="patientPhone != null and patientPhone != ''">
and record.patient_phone = #{patientPhone}
</if>
<if test="dialTime != null ">
and record.dial_time = #{dialTime}
</if>
<if test="phoneTemplateId != null and phoneTemplateId != ''">
and record.phone_template_id = #{phoneTemplateId}
</if>
<if test="billId != null ">
and record.bill_id = #{billId}
</if>
</select>
<select id="selectPhoneDialRecordById" parameterType="Long"
resultMap="PhoneDialRecordResult">
<include refid="selectPhoneDialRecordVo"/>
@ -120,10 +181,16 @@
</if>
<if test="updateTime != null">update_time,
</if>
<if test="ctUuid != null">ct_uuid,
</if>
<if test="phoneDialRecordVideo != null">phone_dial_record_video,
</if>
<if test="ctUuid != null">ct_uuid,
</if>
<if test="phoneDialRecordVideo != null">phone_dial_record_video,
</if>
<if test="phoneDuration != null">phone_duration,
</if>
<if test="phoneExpense != null">phone_expense,
</if>
<if test="billId != null">bill_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="patientId != null">#{patientId},
@ -154,10 +221,16 @@
</if>
<if test="updateTime != null">#{updateTime},
</if>
<if test="ctUuid != null">#{ctUuid},
</if>
<if test="phoneDialRecordVideo != null">#{phoneDialRecordVideo},
</if>
<if test="ctUuid != null">#{ctUuid},
</if>
<if test="phoneDialRecordVideo != null">#{phoneDialRecordVideo},
</if>
<if test="phoneDuration != null">#{phoneDuration},
</if>
<if test="phoneExpense != null">#{phoneExpense},
</if>
<if test="billId != null">#{billId},
</if>
</trim>
</insert>
@ -206,12 +279,21 @@
<if test="updateTime != null">update_time =
#{updateTime},
</if>
<if test="ctUuid != null">ct_uuid =
#{ctUuid},
</if>
<if test="phoneDialRecordVideo != null">phone_dial_record_video =
#{phoneDialRecordVideo},
</if>
<if test="ctUuid != null">ct_uuid =
#{ctUuid},
</if>
<if test="phoneDialRecordVideo != null">phone_dial_record_video =
#{phoneDialRecordVideo},
</if>
<if test="phoneDuration != null">phone_duration =
#{phoneDuration},
</if>
<if test="phoneExpense != null">phone_expense =
#{phoneExpense},
</if>
<if test="billId != null">bill_id =
#{billId},
</if>
</trim>
where id = #{id}
</update>
@ -282,4 +364,17 @@
</if>
</where>
</select>
<select id="selectPhoneDialStatisticByBillId" resultType="com.xinelu.manage.dto.billinfo.BillInfoDto">
select record.phone_template_name template,
record.send_time pushTime,
record.phone_duration pushLength,
record.phone_expense price,
record.phone_unit_price unitPrice,
patient.patient_name,
patient.patient_phone
from phone_dial_record record
left join patient_info patient on patient.id = record.patient_id
where record.bill_id = #{billId}
</select>
</mapper>

View File

@ -361,4 +361,12 @@
from script_info_edge
where script_info_id = #{id}
</delete>
<select id="selectScriptInfos" resultType="com.xinelu.manage.domain.scriptInfo.ScriptInfo">
<include refid="selectScriptInfoVo"/>
</select>
<select id="selectVariablesByRobotPublishId" resultType="java.lang.String">
select variables from script_info where robot_publish_id = #{robotPublishId}
</select>
</mapper>

View File

@ -19,6 +19,11 @@
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="messageType" column="message_type"/>
<result property="messageLength" column="message_length"/>
<result property="messageQuantity" column="message_quantity"/>
<result property="messageUnitPrice" column="message_unit_price"/>
<result property="messageExpense" column="message_expense"/>
<result property="billId" column="bill_id"/>
</resultMap>
<sql id="selectShortMessageSendRecordVo">
@ -35,7 +40,12 @@
create_time,
update_by,
update_time,
message_type
message_type,
message_length,
message_quantity,
message_unit_price,
message_expense,
bill_id
from short_message_send_record
</sql>
@ -70,9 +80,60 @@
<if test="messageType != null and messageType != ''">
and message_type = #{messageType}
</if>
<if test="messageLength != null ">
and message_length = #{messageLength}
</if>
<if test="messageQuantity != null ">
and message_quantity = #{messageQuantity}
</if>
<if test="messageUnitPrice != null ">
and message_unit_price = #{messageUnitPrice}
</if>
<if test="messageExpense != null ">
and message_expense = #{messageExpense}
</if>
<if test="billId != null ">
and bill_id = #{billId}
</if>
</where>
</select>
<select id="selectShortMessageSendRecords"
resultType="com.xinelu.manage.vo.shortmessagesendrecord.ShortMessageSendRecordVo">
select record.id,
record.patient_id,
record.manage_route_node_id,
record.patient_phone,
record.send_time,
record.message_template_id,
record.message_length,
record.message_quantity,
record.message_unit_price,
record.message_expense,
record.bill_id,
patient.patient_name,
bill.bill_name
from short_message_send_record record
left join patient_info patient on patient.id = record.patient_id
left join bill_info bill ON record.bill_id = bill.id
where 1 = 1
<if test="patientName != null and patientName != ''">
and patient.patient_name = #{patientName}
</if>
<if test="patientPhone != null and patientPhone != ''">
and record.patient_phone = #{patientPhone}
</if>
<if test="sendTime != null ">
and record.send_time = #{sendTime}
</if>
<if test="messageTemplateId != null">
and record.message_template_id = #{messageTemplateId}
</if>
<if test="billId != null ">
and record.bill_id = #{billId}
</if>
</select>
<select id="selectShortMessageSendRecordById" parameterType="Long"
resultMap="ShortMessageSendRecordResult">
<include refid="selectShortMessageSendRecordVo"/>
@ -109,6 +170,16 @@
</if>
<if test="messageType != null">message_type,
</if>
<if test="messageLength != null">message_length,
</if>
<if test="messageQuantity != null">message_quantity,
</if>
<if test="messageUnitPrice != null">message_unit_price,
</if>
<if test="messageExpense != null">message_expense,
</if>
<if test="billId != null">bill_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="patientId != null">#{patientId},
@ -137,6 +208,16 @@
</if>
<if test="messageType != null">#{messageType},
</if>
<if test="messageLength != null">#{messageLength},
</if>
<if test="messageQuantity != null">#{messageQuantity},
</if>
<if test="messageUnitPrice != null">#{messageUnitPrice},
</if>
<if test="messageExpense != null">#{messageExpense},
</if>
<if test="billId != null">#{billId},
</if>
</trim>
</insert>
@ -182,6 +263,21 @@
<if test="messageType != null">message_type =
#{messageType},
</if>
<if test="messageLength != null">message_length =
#{messageLength},
</if>
<if test="messageQuantity != null">message_quantity =
#{messageQuantity},
</if>
<if test="messageUnitPrice != null">message_unit_price =
#{messageUnitPrice},
</if>
<if test="messageExpense != null">message_expense =
#{messageExpense},
</if>
<if test="billId != null">bill_id =
#{billId},
</if>
</trim>
where id = #{id}
</update>
@ -238,4 +334,60 @@
</if>
</where>
</select>
<select id="selectShortMessageRecordByBillId" resultType="com.xinelu.manage.dto.billinfo.BillInfoDto">
select message.text_message_name template,
record.send_time pushTime,
record.message_quantity pushLength,
record.message_expense price,
record.message_unit_price unitPrice,
patient.patient_name,
patient.patient_phone
from short_message_send_record record
left join patient_info patient on patient.id = record.patient_id
left join text_message message on record.message_template_id = message.id
where record.bill_id = #{billId}
</select>
<insert id="insertShortMessageSendRecords">
insert into sign_patient_manage_route(
patient_id,
manage_route_node_id,
patient_phone,
send_time,
message_template_id,
message_node_content,
error_code,
error_status,
create_by,
create_time,
message_type,
message_length,
message_quantity,
message_unit_price,
message_expense,
bill_id
)
values
<foreach item="ShortMessageSendRecord" index="index" collection="list" separator=",">
(
#{ShortMessageSendRecord.patientId},
#{ShortMessageSendRecord.manageRouteNodeId},
#{ShortMessageSendRecord.patientPhone},
#{ShortMessageSendRecord.sendTime},
#{ShortMessageSendRecord.messageTemplateId},
#{ShortMessageSendRecord.messageNodeContent},
#{ShortMessageSendRecord.errorCode},
#{ShortMessageSendRecord.errorStatus},
#{ShortMessageSendRecord.createBy},
#{ShortMessageSendRecord.errorStatus},
#{ShortMessageSendRecord.createTime},
#{ShortMessageSendRecord.messageLength},
#{ShortMessageSendRecord.messageQuantity},
#{ShortMessageSendRecord.messageUnitPrice},
#{ShortMessageSendRecord.messageExpense},
#{ShortMessageSendRecord.billId}
)
</foreach>
</insert>
</mapper>

View File

@ -586,7 +586,9 @@
suit_range,
task_excute_type,
create_by,
create_time
create_time,
batch_send_task_record_id,
batch_send_task_id
) values
<foreach item="SignPatientManageRoute" index="index" collection="list" separator=",">
(
@ -599,7 +601,9 @@
#{SignPatientManageRoute.suitRange},
#{SignPatientManageRoute.taskExcuteType},
#{SignPatientManageRoute.createBy},
#{SignPatientManageRoute.createTime}
#{SignPatientManageRoute.createTime},
#{SignPatientManageRoute.batchSendTaskRecordId},
#{SignPatientManageRoute.batchSendTaskId}
)
</foreach>
</insert>

View File

@ -564,27 +564,28 @@
</if>
</trim>
</insert>
<insert id="insertBatch">
insert into sign_patient_manage_route_node(manage_route_id, manage_route_name, route_node_id, route_node_name, route_node_day,sn,task_excute_type,node_plan_time, task_type, task_status, task_subdivision, task_node_type, second_classify_describe,
execute_time, phone_push_sign, script_info_id, robot_publish_id, phone_template_id, phone_template_name, phone_node_content, phone_result_json, phone_redial_times, phone_time_interval, phone_message_remind, phone_message_template_id,
phone_message_template_name, phone_message_template_content,question_info_id, questionnaire_name, questionnaire_content, question_expiration_date, propaganda_info_id, propaganda_title, propaganda_content, message_push_sign,
message_template_id, message_template_code, message_template_name, message_preview, message_node_content, official_push_sign, official_template_id, official_template_code,official_template_name, official_remind_content,
official_node_content, applet_push_sign, applet_template_id, applet_template_code, applet_template_name, applet_remind_content, applet_prompt_description, applet_node_content,
route_check_status, route_check_person, route_check_date, route_check_remark, route_node_remark, node_execute_status, route_handle_remark,phone_connect_status,
route_handle_id, route_handle_person, route_link, text_remind_content,node_content, del_flag, create_by, create_time, update_by, update_time,phone_dial_method,follow_template_id, follow_template_name, task_id_ext)
values
<foreach collection="nodeList" item="item" separator=",">
(#{item.manageRouteId},#{item.manageRouteName},#{item.routeNodeId},#{item.routeNodeName},#{item.routeNodeDay},#{item.sn},#{item.taskExcuteType},#{item.nodePlanTime},#{item.taskType},#{item.taskStatus},#{item.taskSubdivision},#{item.taskNodeType},#{item.secondClassifyDescribe},
#{item.executeTime},#{item.phonePushSign},#{item.scriptInfoId},#{item.robotPublishId},#{item.phoneTemplateId},#{item.phoneTemplateName},#{item.phoneNodeContent},#{item.phoneResultJson},#{item.phoneRedialTimes},#{item.phoneTimeInterval},#{item.phoneMessageRemind},#{item.phoneMessageTemplateId},
#{item.phoneMessageTemplateName},#{item.phoneMessageTemplateContent},
#{item.questionInfoId},#{item.questionnaireName},#{item.questionnaireContent},#{item.questionExpirationDate},#{item.propagandaInfoId},#{item.propagandaTitle},#{item.propagandaContent},#{item.messagePushSign},
#{item.messageTemplateId}, #{item.messageTemplateCode},
#{item.messageTemplateName},#{item.messagePreview},#{item.messageNodeContent},#{item.officialPushSign},#{item.officialTemplateId},#{item.officialTemplateCode},#{item.officialTemplateName},#{item.officialRemindContent},#{item.officialNodeContent},
#{item.appletPushSign},#{item.appletTemplateId},#{item.appletTemplateCode},#{item.appletTemplateName},#{item.appletRemindContent},#{item.appletPromptDescription},#{item.appletNodeContent},
#{item.routeCheckStatus},#{item.routeCheckPerson},#{item.routeCheckDate},#{item.routeCheckRemark},#{item.routeNodeRemark},#{item.nodeExecuteStatus},#{item.routeHandleRemark},#{item.phoneConnectStatus},
#{item.routeHandleId},#{item.routeHandlePerson},#{item.routeLink},#{item.textRemindContent},#{item.nodeContent},0,#{item.createBy},#{item.createTime},#{item.updateBy},#{item.updateTime},#{item.phoneDialMethod},#{item.followTemplateId},#{item.followTemplateName},#{item.taskIdExt})
</foreach>
</insert>
<insert id="insertBatch" useGeneratedKeys="true" keyProperty="id">
insert into sign_patient_manage_route_node(manage_route_id, manage_route_name, route_node_id, route_node_name,route_node_day,sn,dial_status,task_excute_type,node_plan_time, task_type, task_status, task_subdivision, task_node_type, second_classify_describe,
execute_time, phone_push_sign, script_info_id, robot_publish_id, phone_template_id, phone_template_name, phone_node_content, phone_result_json, phone_redial_times, phone_time_interval, phone_message_remind, phone_message_template_id,
phone_message_template_name, phone_message_template_content,question_info_id, questionnaire_name, questionnaire_content, question_expiration_date, propaganda_info_id, propaganda_title, propaganda_content, message_push_sign,
message_template_id, message_template_code, message_template_name, message_preview, message_node_content, official_push_sign, official_template_id, official_template_code,official_template_name, official_remind_content,
official_node_content, applet_push_sign, applet_template_id, applet_template_code, applet_template_name, applet_remind_content, applet_prompt_description, applet_node_content,
route_check_status, route_check_person, route_check_date, route_check_remark, route_node_remark, node_execute_status, route_handle_remark,phone_connect_status,
route_handle_id, route_handle_person, route_link, text_remind_content,node_content, del_flag, create_by, create_time, update_by, update_time,phone_dial_method,follow_template_id, follow_template_name, task_id_ext)
values
<foreach collection="nodeList" item="item" separator=",">
(#{item.manageRouteId},#{item.manageRouteName},#{item.routeNodeId},#{item.routeNodeName},#{item.routeNodeDay},#{item.sn},#{item.dialStatus},#{item.taskExcuteType},#{item.nodePlanTime},#{item.taskType},#{item.taskStatus},#{item.taskSubdivision},#{item.taskNodeType},#{item.secondClassifyDescribe},
#{item.executeTime},#{item.phonePushSign},#{item.scriptInfoId},#{item.robotPublishId},#{item.phoneTemplateId},#{item.phoneTemplateName},#{item.phoneNodeContent},#{item.phoneResultJson},#{item.phoneRedialTimes},#{item.phoneTimeInterval},#{item.phoneMessageRemind},#{item.phoneMessageTemplateId},
#{item.phoneMessageTemplateName},#{item.phoneMessageTemplateContent},
#{item.questionInfoId},#{item.questionnaireName},#{item.questionnaireContent},#{item.questionExpirationDate},#{item.propagandaInfoId},#{item.propagandaTitle},#{item.propagandaContent},#{item.messagePushSign},
#{item.messageTemplateId}, #{item.messageTemplateCode},
#{item.messageTemplateName},#{item.messagePreview},#{item.messageNodeContent},#{item.officialPushSign},#{item.officialTemplateId},#{item.officialTemplateCode},#{item.officialTemplateName},#{item.officialRemindContent},#{item.officialNodeContent},
#{item.appletPushSign},#{item.appletTemplateId},#{item.appletTemplateCode},#{item.appletTemplateName},#{item.appletRemindContent},#{item.appletPromptDescription},#{item.appletNodeContent},
#{item.routeCheckStatus},#{item.routeCheckPerson},#{item.routeCheckDate},#{item.routeCheckRemark},#{item.routeNodeRemark},#{item.nodeExecuteStatus},#{item.routeHandleRemark},#{item.phoneConnectStatus},
#{item.routeHandleId},#{item.routeHandlePerson},#{item.routeLink},#{item.textRemindContent},#{item.nodeContent},0,#{item.createBy},#{item.createTime},#{item.updateBy},#{item.updateTime},#{item.phoneDialMethod},#{item.followTemplateId},#{item.followTemplateName},#{item.taskIdExt}
)
</foreach>
</insert>
<update id="updateSignPatientManageRouteNode" parameterType="SignPatientManageRouteNode">
update sign_patient_manage_route_node
<trim prefix="SET" suffixOverrides=",">
@ -852,10 +853,10 @@
</update>
<update id="updateDialStatus" parameterType="SignPatientManageRouteNode">
update sign_patient_manage_route_node set dial_status = #{dialStatus}
where
sn = #{sn}
and script_info_id = #{scriptInfoId}
update sign_patient_manage_route_node
set dial_status = #{dialStatus}
where sn = #{sn}
and script_info_id = #{scriptInfoId}
</update>
<update id="updateDialStatusByNodeId" parameterType="SignPatientManageRouteNode">
@ -1045,6 +1046,14 @@
</foreach>
</update>
<update id="updateTaskIdExtBuIds">
update sign_patient_manage_route_node
set task_id_ext = #{taskIdExt}
where id in
<foreach item="manageRouteNodeIds" collection="manageRouteNodeIds" open="(" separator="," close=")">
#{manageRouteNodeIds}
</foreach>
</update>
<select id="selectNodeCountByCreateTime" resultType="java.lang.Integer">
select count(1)
@ -1084,6 +1093,9 @@
and spmrn.phone_push_sign = 1
AND spmrn.route_check_status = 'AGREE'
AND spmrn.task_node_type in ('PHONE_OUTBOUND','QUESTIONNAIRE_SCALE')
<if test="hospitalAgencyId != null">
and pi.hospital_agency_id = #{hospitalAgencyId}
</if>
</select>
<select id="getFollowUpPlan" resultType="com.xinelu.manage.vo.signpatientmanageroutenode.PatientFollowUpPlanVo">
SELECT task.manage_route_node_id as id,
@ -1149,10 +1161,6 @@
spmrn.sn,
spmrn.phone_node_execute_result_status,
CASE
WHEN spmrn.node_execute_status = 'EXECUTED' THEN '已随访'
WHEN spmrn.node_execute_status = 'UNEXECUTED' THEN '未随访'
END AS followUpStatus,
CASE
WHEN spmrn.phone_dial_method = 'AI' THEN 'AI'
WHEN spmrn.phone_dial_method = 'COMMON' THEN spmrn.route_handle_person
END AS phoneDialMethod,
@ -1166,23 +1174,46 @@
pqsr.remarkable_flag,
pqsr.id,
pqsr.total_score,
pi.patient_phone,
pi.patient_name,
CASE
WHEN spmr.patient_id is null THEN bsti.patient_name
WHEN spmr.patient_id is not null THEN pi.patient_name
END AS patientName,
CASE
WHEN spmr.patient_id is null THEN bsti.patient_phone
WHEN spmr.patient_id is not null THEN pi.patient_phone
END AS patientPhone,
CASE
WHEN spmr.patient_id is null THEN bsti.hospital_agency_id
WHEN spmr.patient_id is not null THEN pi.hospital_agency_id
END AS hospitalAgencyId,
CASE
WHEN spmr.patient_id is null THEN bsti.hospital_agency_name
WHEN spmr.patient_id is not null THEN pi.hospital_agency_name
END AS hospitalAgencyName,
CASE
WHEN spmr.patient_id is null THEN bsti.department_name
WHEN spmr.patient_id is not null THEN pi.department_name
END AS departmentName,
CASE
WHEN spmr.patient_id is null THEN bsti.department_id
WHEN spmr.patient_id is not null THEN pi.department_id
END AS departmentId,
CASE
WHEN spmr.patient_id is null THEN bsti.visit_date
WHEN spmr.patient_id is not null THEN pi.visit_date
END AS visitDate,
CASE
WHEN spmr.patient_id is null THEN bsti.age
WHEN spmr.patient_id is not null THEN pi.age
END AS age,
pi.id AS patientId,
pi.department_name,
pi.department_id,
pi.hospital_agency_id,
pi.hospital_agency_name,
pi.visit_date,
pi.age,
pi.patient_visit_record_id,
pvr.main_diagnosis,
CASE
WHEN spmrn.task_node_type = 'PHONE_OUTBOUND' THEN spmrn.script_info_id
WHEN spmrn.task_node_type = 'QUESTIONNAIRE_SCALE' THEN qi.script_info_id
END AS scriptTemplateId,
CASE
WHEN spmrn.task_node_type = 'PHONE_OUTBOUND' THEN si.script_name
WHEN spmrn.task_node_type = 'PHONE_OUTBOUND' THEN spmrn.phone_template_name
WHEN spmrn.task_node_type = 'QUESTIONNAIRE_SCALE' THEN qi.script_name
END AS scriptTemplateName,
(select fill_blanks_answer from patient_question_subject_result
@ -1191,16 +1222,17 @@
LEFT JOIN sign_patient_manage_route spmr ON spmr.id = spmrn.manage_route_id
LEFT JOIN patient_question_submit_result pqsr ON pqsr.manage_route_node_id = spmrn.id
LEFT JOIN patient_info pi ON spmr.patient_id = pi.id
LEFT JOIN patient_visit_record pvr ON pi.id = pvr.patient_id
-- LEFT JOIN patient_visit_record pvr ON pi.id = pvr.patient_id
LEFT JOIN question_info qi on spmrn.question_info_id = qi.id
LEFT JOIN script_info si on si.id = spmrn.script_info_id
-- LEFT JOIN script_info si on si.id = spmrn.script_info_id
LEFT JOIN batch_send_task_info bsti on spmr.batch_send_task_id = bsti.id
WHERE
spmrn.del_flag = 0
spmrn.del_flag = 0 and spmrn.task_node_type in ('PHONE_OUTBOUND', 'QUESTIONNAIRE_SCALE')
<if test="departmentId != null">
and pi.department_id = #{departmentId}
</if>
<if test="hospitalAgencyId != null">
and pi.hospital_agency_id = #{hospitalAgencyId}
and (pi.hospital_agency_id = #{hospitalAgencyId} or bsti.hospital_agency_id = #{hospitalAgencyId})
</if>
<if test="patientId != null">
and pi.id = #{patientId}
@ -1211,9 +1243,6 @@
<if test="patientPhone != null">
and pi.patient_phone = #{patientPhone}
</if>
<if test="taskNodeType != null and taskNodeType != ''">
and spmrn.task_node_type = #{taskNodeType}
</if>
<if test="questionInfoId != null">
AND spmrn.question_info_id = #{questionInfoId}
</if>
@ -1238,17 +1267,17 @@
<if test="contentedFlag != null and contentedFlag != ''">
and pqsr.contented_flag = #{contentedFlag}
</if>
${params.dataScope}
ORDER BY spmrn.create_time DESC
</select>
<select id="questionnaireTaskStatistics"
resultType="com.xinelu.manage.vo.statistics.QuestionnaireTaskStatisticsVo"
resultMap="QuestionnaireTaskStatisticsVoResult">
resultType="com.xinelu.manage.vo.statistics.QuestionnaireTaskStatisticsVo">
select
qi.create_time,
qi.questionnaire_name,
spmrn.id manageRouteNodeId,
spmrn.question_info_id,
pqsjr.question_submit_result_id questionSubmitResultId,
pqsjr.question_subject_id,
pqsjr.question_number,
pqsjr.question_type,
@ -1257,39 +1286,7 @@
pqor.question_subject_option_id questionSubjectOptionId,
pqor.option_name,
pqor.option_sort,
(
SELECT
count( f.option_choose_sign = 0 OR NULL )
FROM
sign_patient_manage_route_node a
LEFT JOIN sign_patient_manage_route b ON b.id = a.manage_route_id
LEFT JOIN patient_info c ON b.patient_id = c.id
LEFT JOIN patient_question_submit_result d ON a.id = d.manage_route_node_id
LEFT JOIN patient_question_subject_result e ON d.id = e.question_submit_result_id
LEFT JOIN patient_question_option_result f ON e.id = f.question_subject_result_id
WHERE
c.del_flag = 0
AND a.question_info_id = spmrn.question_info_id
AND e.question_subject_id = pqsjr.question_subject_id
AND f.question_subject_option_id = pqor.question_subject_option_id
<if test="taskStartTime != null"><!-- 开始时间检索 -->
AND date_format(a.node_finish_date,'%y%m%d') &gt;= date_format(#{taskStartTime},'%y%m%d')
</if>
<if test="taskEndTime != null"><!-- 结束时间检索 -->
AND date_format(a.node_finish_date,'%y%m%d') &lt;= date_format(#{taskEndTime},'%y%m%d')
</if>
<if test="visitStartTime != null and visitEndTime != null">
and( (date_format(c.visit_date, '%y%m%d') >= date_format(#{visitStartTime}, '%y%m%d')
and date_format(c.visit_date, '%y%m%d') &lt;= date_format(#{visitEndTime}, '%y%m%d'))
or (date_format(c.discharge_time,'%y%m%d') >= date_format(#{visitStartTime}, '%y%m%d') and
date_format(c.discharge_time,'%y%m%d') &lt;= date_format(#{visitEndTime}, '%y%m%d')))
</if>
) choiceNumber,
(
SELECT count( 1 ) FROM sign_patient_manage_route_node a
LEFT JOIN patient_question_submit_result d ON a.id = d.manage_route_node_id
WHERE a.question_info_id = spmrn.question_info_id
) total
pqor.option_choose_sign
from sign_patient_manage_route_node spmrn
left join question_info qi on spmrn.question_info_id = qi.id
left join sign_patient_manage_route spmr on spmr.id = spmrn.manage_route_id

View File

@ -18,6 +18,7 @@
<result property="textMessageSort" column="text_message_sort"/>
<result property="textMessageRemark" column="text_message_remark"/>
<result property="sourceTemplateId" column="source_template_id"/>
<result property="variables" column="variables"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
@ -39,6 +40,7 @@
<result column="text_message_sort" property="textMessageSort"/>
<result column="text_message_remark" property="textMessageRemark"/>
<result property="sourceTemplateId" column="source_template_id"/>
<result property="variables" column="variables"/>
<collection property="suitTaskList" ofType="com.xinelu.manage.domain.textmessagesuittask.TextMessageSuitTask">
<id column="taskId" property="id"/>
<result column="message_id" property="messageId"/>
@ -61,6 +63,7 @@
text_message_sort,
text_message_remark,
source_template_id,
variables,
create_by,
create_time,
update_by,
@ -87,6 +90,7 @@
tm.text_message_channel,
tm.text_message_status,
tm.text_message_sort,
tm.variables,
tm.text_message_remark,
tmst.id AS taskId,
tmst.message_id,
@ -114,6 +118,7 @@
tm.text_message_sort,
tm.text_message_remark,
tm.source_template_id,
tm.variables,
tmst.id AS taskId,
tmst.message_id,
tmst.suit_task_type_id,
@ -195,6 +200,8 @@
</if>
<if test="sourceTemplateId != null">source_template_id,
</if>
<if test="variables != null">variables,
</if>
<if test="createBy != null">create_by,
</if>
<if test="createTime != null">create_time,
@ -229,6 +236,8 @@
</if>
<if test="sourceTemplateId != null">#{sourceTemplateId},
</if>
<if test="variables != null">#{variables},
</if>
<if test="createBy != null">#{createBy},
</if>
<if test="createTime != null">#{createTime},
@ -295,6 +304,7 @@
<if test="sourceTemplateId != null">source_template_id =
#{sourceTemplateId},
</if>
variables = #{variables},
<if test="createBy != null">create_by =
#{createBy},
</if>
@ -354,4 +364,8 @@
from text_message_suit_task
where message_id = #{id}
</delete>
<select id="selectTextMessages" resultType="com.xinelu.manage.vo.textmessage.TextMessageVO">
<include refid="selectTextMessageVo"/>
</select>
</mapper>

View File

@ -1,12 +1,23 @@
package com.xinelu.quartz.controller;
import com.alibaba.fastjson2.JSONObject;
import com.aliyuncs.exceptions.ClientException;
import com.xinelu.manage.domain.shortmessagesendrecord.ShortMessageSendRecord;
import com.xinelu.manage.domain.textmessage.SmsReport;
import com.xinelu.manage.mapper.shortmessagesendrecord.ShortMessageSendRecordMapper;
import com.xinelu.quartz.service.SendTextMessageService;
import com.xinelu.quartz.task.SendTextMessageTask;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
* @Description 短信相关定时任务
@ -19,6 +30,10 @@ public class SendTextMessageController {
@Resource
private SendTextMessageTask textMessageTask;
@Resource
private SendTextMessageService sendTextMessageService;
@Resource
private ShortMessageSendRecordMapper shortMessageSendRecordMapper;
/**
* 手动执行短信发送定时任务
@ -27,4 +42,19 @@ public class SendTextMessageController {
public void textMessageSend() throws ClientException {
textMessageTask.automaticSendTextMessageTask();
}
@PostMapping("/textMessageSendBask")
public JSONObject textMessageSendBask(SmsReport data) {
JSONObject retObj = new JSONObject();
retObj.fluentPut("code", 0).fluentPut("msg", "成功");
if (Objects.isNull(data) || StringUtils.isBlank(data.getPhone_number())){
return retObj;
}
List<ShortMessageSendRecord> shortMessageSendRecords = new ArrayList<>();
JSONObject jsonObject = sendTextMessageService.taskTextMessageSendBack(data, shortMessageSendRecords);
if (CollectionUtils.isNotEmpty(shortMessageSendRecords)) {
shortMessageSendRecordMapper.insertShortMessageSendRecords(shortMessageSendRecords);
}
return jsonObject;
}
}

View File

@ -1,6 +1,12 @@
package com.xinelu.quartz.service;
import com.alibaba.fastjson2.JSONObject;
import com.aliyuncs.exceptions.ClientException;
import com.xinelu.manage.domain.shortmessagesendrecord.ShortMessageSendRecord;
import com.xinelu.manage.domain.textmessage.SmsReport;
import com.xinelu.manage.domain.textmessage.TaskMessageBackEntity;
import java.util.List;
/**
* @Description 短信发送定时任务业务层
@ -13,4 +19,18 @@ public interface SendTextMessageService {
* 签约患者管理任务路径节点短信发送定时任务
*/
void sendTextMessageSendTask() throws ClientException;
List<TaskMessageBackEntity> taskMessageBack(TaskMessageBackEntity taskMessageBackEntity);
/**
* 任务执行回调方法
*
* @param data 任务单通电话回调传输data
* @return JSONObject
*/
JSONObject taskTextMessageSendBack(SmsReport data, List<ShortMessageSendRecord> shortMessageSendRecords);
Integer updateReadState(Integer readState, List<Integer> ids);
Integer deleteData();
}

View File

@ -1,10 +1,16 @@
package com.xinelu.quartz.service.impl;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.aliyuncs.exceptions.ClientException;
import com.xinelu.common.config.AliYunSmsTwoConfig;
import com.xinelu.common.config.PushMessageRestrictions;
import com.xinelu.common.enums.*;
import com.xinelu.manage.domain.shortmessagesendrecord.ShortMessageSendRecord;
import com.xinelu.manage.domain.signpatientmanageroutenode.SignPatientManageRouteNode;
import com.xinelu.manage.domain.textmessage.SmsReport;
import com.xinelu.manage.domain.textmessage.TaskMessageBackEntity;
import com.xinelu.manage.dto.smssend.SmsInfoDTO;
import com.xinelu.manage.mapper.shortmessagesendrecord.ShortMessageSendRecordMapper;
import com.xinelu.manage.mapper.signpatientmanageroutenode.SignPatientManageRouteNodeMapper;
@ -15,12 +21,20 @@ import com.xinelu.mobile.utils.SmsSendUtils;
import com.xinelu.quartz.service.SendTextMessageService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
import java.util.*;
import java.util.stream.Collectors;
@ -44,8 +58,10 @@ public class SendTextMessageServiceImpl implements SendTextMessageService {
private PushMessageRestrictions pushMessageRestrictions;
@Resource
private ShortMessageSendRecordMapper shortMessageSendRecordMapper;
@Resource
private IPatientTaskStatisticsService patientTaskStatisticsService;
@Resource
private IPatientTaskStatisticsService patientTaskStatisticsService;
@Value("${aiob.callBackUrl}")
private String callBackUrl;
/**
* 签约患者管理任务路径节点短信发送定时任务
@ -87,7 +103,7 @@ public class SendTextMessageServiceImpl implements SendTextMessageService {
localDate = textMessage.getVisitDate().plusDays(textMessage.getRouteNodeDay());
}
//没有天数按执行时间处理NodePlanTime
if (Objects.isNull(textMessage.getRouteNodeDay()) && Objects.nonNull(textMessage.getNodePlanTime())){
if (Objects.isNull(textMessage.getRouteNodeDay()) && Objects.nonNull(textMessage.getNodePlanTime())) {
localDate = textMessage.getNodePlanTime().toLocalDate();//新加的外呼立即执行没有getRouteNodeDay
}
if (Objects.isNull(localDate)) {
@ -102,7 +118,7 @@ public class SendTextMessageServiceImpl implements SendTextMessageService {
continue;
}
//没有天数按执行时间处理NodePlanTime
if (Objects.isNull(textMessage.getRouteNodeDay()) && now.isBefore(textMessage.getNodePlanTime())){
if (Objects.isNull(textMessage.getRouteNodeDay()) && now.isBefore(textMessage.getNodePlanTime())) {
continue;
}
textMessage.setRouteNodeName(RouteNodeNameEnum.getNameByInfo(textMessage.getRouteNodeName()).getName());
@ -153,7 +169,7 @@ public class SendTextMessageServiceImpl implements SendTextMessageService {
//发送失败ids
List<Long> failSignPatientManageRouteNodeIds = new ArrayList<>();
Set<Long> patientIdSet = new HashSet<>();
Set<Long> patientIdSet = new HashSet<>();
if (CollectionUtils.isNotEmpty(messages)) {
List<Long> ids = new ArrayList<>();
for (TextMessage message : messages) {
@ -189,8 +205,8 @@ public class SendTextMessageServiceImpl implements SendTextMessageService {
}
}
shortMessageSendRecordMapper.insertShortMessageSendRecord(shortMessageSendRecord);
// 修改患者任务统计表
patientIdSet.add(message.getPatientId());
// 修改患者任务统计表
patientIdSet.add(message.getPatientId());
}
//修改节点状态
if (CollectionUtils.isNotEmpty(ids)) {
@ -201,10 +217,87 @@ public class SendTextMessageServiceImpl implements SendTextMessageService {
signPatientManageRouteNodeMapper.updateNodeExecuteStatusByIds(failSignPatientManageRouteNodeIds, NodeExecuteStatusEnum.EXECUTED.getInfo(), null, NodeExecuteResultStatusEnum.FAILURE.getInfo(), null, now);
}
// 患者任务统计表修改
if (CollectionUtils.isNotEmpty(patientIdSet)) {
patientTaskStatisticsService.updateNum(new ArrayList<>(patientIdSet));
}
// 患者任务统计表修改
if (CollectionUtils.isNotEmpty(patientIdSet)) {
patientTaskStatisticsService.updateNum(new ArrayList<>(patientIdSet));
}
}
}
@Override
public List<TaskMessageBackEntity> taskMessageBack(TaskMessageBackEntity taskMessageBackEntity) {
// 接口获取外呼回调数据app
List<TaskMessageBackEntity> taskMessageBackEntityList = new ArrayList<>();
HttpEntity<JSONObject> requestEntity = new HttpEntity<>((JSONObject) JSON.toJSON(taskMessageBackEntityList));
RestTemplate restTemplate = new RestTemplate();
ResponseEntity<String> responseEntity = restTemplate.exchange(callBackUrl + "/getMessageBackList", HttpMethod.POST, requestEntity, String.class);
JSONObject object = JSON.parseObject(responseEntity.getBody());
if (object == null || object.getInteger("code") == null || object.getInteger("code") != 0) {
return null;
}
if (object.containsKey("data")) {
JSONArray data = object.getJSONArray("data");
if (data != null && data.size() > 0) {
taskMessageBackEntityList = data.toJavaList(TaskMessageBackEntity.class);
}
}
return taskMessageBackEntityList;
}
@Override
public JSONObject taskTextMessageSendBack(SmsReport data, List<ShortMessageSendRecord> shortMessageSendRecords) {
JSONObject retObj = new JSONObject();
retObj.fluentPut("code", 0).fluentPut("msg", "成功");
SignPatientManageRouteNode signPatientManageRouteNode = signPatientManageRouteNodeMapper.selectSignPatientManageRouteNodeById(Long.valueOf(data.getOut_id()));
ShortMessageSendRecord shortMessageSendRecord = new ShortMessageSendRecord();
if (ObjectUtils.isNotEmpty(signPatientManageRouteNode) && signPatientManageRouteNode.getMessagePushSign() == 1) {
if (data.getSuccess()) {
// 标记任务执行状态
signPatientManageRouteNode.setNodeExecuteStatus(NodeExecuteStatusEnum.EXECUTED.getInfo());
signPatientManageRouteNode.setMessageNodeExecuteResultStatus(NodeExecuteResultStatusEnum.SUCCESS.getInfo());
signPatientManageRouteNode.setNodeFinishDate(LocalDateTime.parse(data.getReport_time(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
shortMessageSendRecord.setErrorStatus(ErrorStatusEnum.success.getValue());
shortMessageSendRecord.setErrorCode(0L);
} else {
// 标记任务执行状态
signPatientManageRouteNode.setNodeExecuteStatus(NodeExecuteStatusEnum.EXECUTED.getInfo());
signPatientManageRouteNode.setMessageNodeExecuteResultStatus(NodeExecuteResultStatusEnum.FAILURE.getInfo());
signPatientManageRouteNode.setNodeFinishDate(LocalDateTime.parse(data.getReport_time(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
shortMessageSendRecord.setErrorStatus(ErrorStatusEnum.fail.getValue());
shortMessageSendRecord.setErrorCode(1L);
}
shortMessageSendRecord.setManageRouteNodeId(signPatientManageRouteNode.getId());
shortMessageSendRecord.setPatientPhone(data.getPhone_number());
shortMessageSendRecord.setMessageTemplateId(shortMessageSendRecord.getMessageTemplateId());
shortMessageSendRecord.setMessageNodeContent(signPatientManageRouteNode.getMessageNodeContent());
shortMessageSendRecord.setMessageQuantity(Long.valueOf(data.getSms_size()));
shortMessageSendRecord.setMessageUnitPrice(new BigDecimal("0.1"));
shortMessageSendRecord.setMessageExpense(shortMessageSendRecord.getMessageUnitPrice().multiply(new BigDecimal(shortMessageSendRecord.getMessageQuantity())));
shortMessageSendRecords.add(shortMessageSendRecord);
signPatientManageRouteNodeMapper.updateSignPatientManageRouteNode(signPatientManageRouteNode);
}
return retObj;
}
@Override
public Integer updateReadState(Integer readState, List<Integer> ids) {
log.info("修改短信回调数据已读状态--id{}", ids);
JSONObject TaskCallbackUpdateDto = new JSONObject();
TaskCallbackUpdateDto.fluentPut("ids", ids).fluentPut("readState", readState);
HttpEntity<JSONObject> requestEntity = new HttpEntity<>(TaskCallbackUpdateDto);
RestTemplate restTemplate = new RestTemplate();
ResponseEntity<String> responseEntity = restTemplate.exchange(callBackUrl + "/updateMessageBackReadState", HttpMethod.POST, requestEntity, String.class);
JSONObject object = JSON.parseObject(responseEntity.getBody());
if (object == null || object.getInteger("code") == null || object.getInteger("code") != 0) {
log.info("修改百度外呼回调数据已读状态失败--id{},原因:{}", ids, object.getString("message"));
return null;
}
log.info("修改百度外呼回调数据已读状态成功--id{}", ids);
return 1;
}
@Override
public Integer deleteData() {
return null;
}
}

View File

@ -1,12 +1,22 @@
package com.xinelu.quartz.task;
import com.alibaba.fastjson.JSON;
import com.aliyuncs.exceptions.ClientException;
import com.xinelu.manage.domain.shortmessagesendrecord.ShortMessageSendRecord;
import com.xinelu.manage.domain.textmessage.SmsReport;
import com.xinelu.manage.domain.textmessage.TaskMessageBackEntity;
import com.xinelu.manage.mapper.shortmessagesendrecord.ShortMessageSendRecordMapper;
import com.xinelu.quartz.service.SendTextMessageService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
* @Description 短信相关定时任务
@ -19,6 +29,8 @@ public class SendTextMessageTask {
@Resource
private SendTextMessageService sendTextMessageService;
@Resource
private ShortMessageSendRecordMapper shortMessageSendRecordMapper;
/**
* 签约患者管理任务路径节点短信发送定时任务
@ -28,4 +40,40 @@ public class SendTextMessageTask {
sendTextMessageService.sendTextMessageSendTask();
log.info("完成订阅签约患者管理任务路径节点推送定时任务......");
}
public void smsReportBack() {
log.info("开始执行同步短信回调数据定时任务......");
TaskMessageBackEntity taskMessageBackEntity = new TaskMessageBackEntity();
taskMessageBackEntity.setReadState(0);
List<TaskMessageBackEntity> taskMessageBackEntityList = sendTextMessageService.taskMessageBack(taskMessageBackEntity);
List<ShortMessageSendRecord> shortMessageSendRecords = new ArrayList<>();
if (!CollectionUtils.isEmpty(taskMessageBackEntityList)) {
// 回调数据提取
List<SmsReport> smsReports = new ArrayList<>();
taskMessageBackEntityList.forEach(entity -> {
// JSONString SmsReport
smsReports.addAll(JSON.parseArray(entity.getMessageBackData().toString(), SmsReport.class));
});
if (CollectionUtils.isNotEmpty(smsReports)) {
for (SmsReport smsReport : smsReports) {
// 回调数据解析
sendTextMessageService.taskTextMessageSendBack(smsReport, shortMessageSendRecords);
}
}
if (CollectionUtils.isNotEmpty(shortMessageSendRecords)) {
shortMessageSendRecordMapper.insertShortMessageSendRecords(shortMessageSendRecords);
}
List<Integer> ids = taskMessageBackEntityList.stream().filter(Objects::nonNull).map(TaskMessageBackEntity::getId).collect(Collectors.toList());
// 修改阿里云服务器回调数据已读状态
sendTextMessageService.updateReadState(1, ids);
}
log.info("完成同步百度外呼回调数据定时任务......");
}
public void clearCallbackData() {
log.info("开始执行清除过期的百度外呼回调数据定时任务......");
// 清除一个月前的数据
int count = sendTextMessageService.deleteData();
log.info("完成清除过期的百度外呼回调数据定时任务,共清除" + count + "条......");
}
}

View File

@ -161,10 +161,17 @@ public class UploadRobotPublishTask {
if (StringUtils.isBlank(taskId)) {
Long aLong = patientInfoImportMainMapper.selectHospitalAgencyId(sn);
DialTime dialTime = patientInfoImportMainMapper.selectDialTimeById(aLong);
LocalTime localStartTime = LocalTime.parse(dialTime.getDialStartTime());
LocalTime localEndTime = LocalTime.parse(dialTime.getDialEndTime());
LocalTime localStartTime = null;
LocalTime localEndTime = null;
LocalTime dateStartTime;
LocalTime dateEndTime;
if (Objects.nonNull(dialTime)) {
localStartTime = LocalTime.parse(dialTime.getDialStartTime());
localEndTime = LocalTime.parse(dialTime.getDialEndTime());
} else {
localStartTime = LocalTime.parse("08:00");
localEndTime = LocalTime.parse("19:00");
}
List<SysDictData> sysDictDataList = iSysDictTypeService.selectDictDataByType(Constants.DIAL_TIME);
if (CollectionUtils.isEmpty(sysDictDataList) || sysDictDataList.size() != 2) {
dateStartTime = LocalTime.parse("08:00");
@ -173,7 +180,7 @@ public class UploadRobotPublishTask {
dateStartTime = LocalTime.parse(sysDictDataList.get(0).getDictValue());
dateEndTime = LocalTime.parse(sysDictDataList.get(1).getDictValue());
}
if (dateStartTime.isAfter(localStartTime) ) {
if (dateStartTime.isAfter(localStartTime)) {
localStartTime = dateStartTime;
}
if (dateEndTime.isBefore(localEndTime)) {
@ -197,7 +204,7 @@ public class UploadRobotPublishTask {
createTaskDto.setRetryInterval(nodeFirstTemp.getPhoneTimeInterval());
createTaskDto.setNumTypeFilterList(Arrays.asList(1, 2));
createTaskDto.setTaskDataCallback(true);
createTaskDto.setCallBackUrl(callBackUrl);
createTaskDto.setCallBackUrl(callBackUrl+ "/taskCallBack");
createTaskDto.setDialStartTime(localStartTime.format(DateTimeFormatter.ofPattern("HH:mm")));
createTaskDto.setDialEndTime(localEndTime.format(DateTimeFormatter.ofPattern("HH:mm")));
taskId = aiobService.createTask(createTaskDto);