|  |  |  | 
|---|
|  |  |  | if ((Boolean) map.get("succ") == false) { | 
|---|
|  |  |  | serviceSubtaskRecord.setResult("error"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | serviceSubtaskMapper.insertServiceSubtask(serviceSubtask); | 
|---|
|  |  |  | serviceSubtaskMapper.updateServiceSubtask(serviceSubtask); | 
|---|
|  |  |  | serviceSubtaskRecordService.insertServiceSubtaskRecord(serviceSubtaskRecord); | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | String guid = UUID.randomUUID().toString(); | 
|---|
|  |  |  | 
|---|
|  |  |  | serviceSubtask.setGuid(guid); | 
|---|
|  |  |  | serviceSubtask.setSendstate(5L); | 
|---|
|  |  |  | serviceSubtask.setFinishtime(new Date()); | 
|---|
|  |  |  | serviceSubtaskMapper.insertServiceSubtask(serviceSubtask); | 
|---|
|  |  |  | serviceSubtaskMapper.updateServiceSubtask(serviceSubtask); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ApiOperation("导出患者档案列表") | 
|---|
|  |  |  | //@PreAuthorize("@ss.hasPermi('smartor:patarchive:export')") | 
|---|
|  |  |  | @Log(title = "患者档案" , businessType = BusinessType.EXPORT) | 
|---|
|  |  |  | @Log(title = "患者档案", businessType = BusinessType.EXPORT) | 
|---|
|  |  |  | @PostMapping("/export") | 
|---|
|  |  |  | public void export(HttpServletResponse response, PatArchive patArchive) { | 
|---|
|  |  |  | List<PatArchive> list = patArchiveService.selectPatArchiveList(patArchive); | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiOperation("获取患者档案详细信息") | 
|---|
|  |  |  | //@PreAuthorize("@ss.hasPermi('smartor:patarchive:query')") | 
|---|
|  |  |  | @GetMapping(value = "/getInfo/{patid}") | 
|---|
|  |  |  | @ApiImplicitParam(name = "patid" , value = "患者id") | 
|---|
|  |  |  | @ApiImplicitParam(name = "patid", value = "患者id") | 
|---|
|  |  |  | public AjaxResult getInfo(@PathVariable(name = "patid") Long patid) { | 
|---|
|  |  |  | return success(patArchiveService.selectPatArchiveByPatid(patid)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ApiOperation("修改患者档案") | 
|---|
|  |  |  | //@PreAuthorize("@ss.hasPermi('smartor:patarchive:update')") | 
|---|
|  |  |  | @Log(title = "患者档案" , businessType = BusinessType.UPDATE) | 
|---|
|  |  |  | @Log(title = "患者档案", businessType = BusinessType.UPDATE) | 
|---|
|  |  |  | @PostMapping("/update") | 
|---|
|  |  |  | public AjaxResult update(@RequestBody PatArchive patArchive) { | 
|---|
|  |  |  | return toAjax(patArchiveService.update(patArchive)); | 
|---|
|  |  |  | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ApiOperation("新增或修改患者档信息") | 
|---|
|  |  |  | //@PreAuthorize("@ss.hasPermi('smartor:patarchive:edit')") | 
|---|
|  |  |  | @Log(title = "患者档案" , businessType = BusinessType.UPDATE) | 
|---|
|  |  |  | @Log(title = "患者档案", businessType = BusinessType.UPDATE) | 
|---|
|  |  |  | @PostMapping("/saveOrUpdatePatInfo") | 
|---|
|  |  |  | public AjaxResult saveOrUpdatePatInfo(@RequestBody PatArchiveVO patArchiveVO) { | 
|---|
|  |  |  | return toAjax(patArchiveService.saveOrUpdatePatInfo(patArchiveVO)); | 
|---|
|  |  |  | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ApiOperation("删除患者档案") | 
|---|
|  |  |  | //@PreAuthorize("@ss.hasPermi('smartor:patarchive:remove')") | 
|---|
|  |  |  | @Log(title = "患者档案" , businessType = BusinessType.DELETE) | 
|---|
|  |  |  | @Log(title = "患者档案", businessType = BusinessType.DELETE) | 
|---|
|  |  |  | @GetMapping("/remove/{patids}") | 
|---|
|  |  |  | @ApiImplicitParam(name = "patids" , value = "患者id集合" , dataType = "long" , dataTypeClass = Long.class) | 
|---|
|  |  |  | @ApiImplicitParam(name = "patids", value = "患者id集合", dataType = "long", dataTypeClass = Long.class) | 
|---|
|  |  |  | public AjaxResult remove(@PathVariable Long[] patids) { | 
|---|
|  |  |  | return toAjax(patArchiveService.deletePatArchiveByPatids(patids)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ApiOperation("导入患者文件处理") | 
|---|
|  |  |  | @PostMapping("/importFilehandle") | 
|---|
|  |  |  | @ApiImplicitParams({@ApiImplicitParam(name = "tags" , value = "标签"), @ApiImplicitParam(name = "multipartFile" , value = "上传文件")}) | 
|---|
|  |  |  | @ApiImplicitParams({@ApiImplicitParam(name = "tags", value = "标签"), @ApiImplicitParam(name = "multipartFile", value = "上传文件")}) | 
|---|
|  |  |  | public AjaxResult importFilehandle(@RequestParam("tags") String tags, @RequestParam("multipartFile") MultipartFile multipartFile) { | 
|---|
|  |  |  | Executor executor = Executors.newFixedThreadPool(3); | 
|---|
|  |  |  | //获取当前登陆人 | 
|---|
|  |  |  | 
|---|
|  |  |  | @PostMapping("/patInfoByContion") | 
|---|
|  |  |  | public TableDataInfo patInfoByCondition(@RequestBody PatArchiveReq patArchive) { | 
|---|
|  |  |  | PageUtils.startPageByPost(patArchive.getPageNum(), patArchive.getPageSize()); | 
|---|
|  |  |  | if (CollectionUtils.isEmpty(patArchive.getLeavehospitaldistrictcodes()) || patArchive.getLeavehospitaldistrictcodes().size() == 0) { | 
|---|
|  |  |  | patArchive.setLeavehospitaldistrictcodes(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (CollectionUtils.isEmpty(patArchive.getLeaveldeptcodes()) || patArchive.getLeaveldeptcodes().size() == 0) { | 
|---|
|  |  |  | patArchive.setLeaveldeptcodes(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | List<PatArchive> patArchives = patArchiveService.patInfoByContion(patArchive); | 
|---|
|  |  |  | long count = PageUtils.count(new ISelect() { | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | 
|---|
|  |  |  | @PostMapping("/getPatientInfo") | 
|---|
|  |  |  | public TableDataInfo getPatientInfo(@RequestBody PatArchiveReq patArchiveReq) { | 
|---|
|  |  |  | PageUtils.startPageByPost(patArchiveReq.getPageNum(), patArchiveReq.getPageSize()); | 
|---|
|  |  |  | if (CollectionUtils.isEmpty(patArchiveReq.getLeavehospitaldistrictcodes()) || patArchiveReq.getLeavehospitaldistrictcodes().size() == 0) { | 
|---|
|  |  |  | patArchiveReq.setLeavehospitaldistrictcodes(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (CollectionUtils.isEmpty(patArchiveReq.getLeaveldeptcodes()) || patArchiveReq.getLeaveldeptcodes().size() == 0) { | 
|---|
|  |  |  | patArchiveReq.setLeaveldeptcodes(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | List<PatArchiveOthreInfo> patientInfo = patArchiveService.getPatientInfo(patArchiveReq); | 
|---|
|  |  |  | long count = PageUtils.count(new ISelect() { | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | 
|---|
|  |  |  | LoginUser loginUser = getLoginUser(); | 
|---|
|  |  |  | SysUser user = loginUser.getUser(); | 
|---|
|  |  |  | ivrTaskVO.setCreateBy(user.getNickName()); | 
|---|
|  |  |  | return toAjax(serviceSubtaskService.insertOrUpdateTask(ivrTaskVO)); | 
|---|
|  |  |  | return success(serviceSubtaskService.insertOrUpdateTask(ivrTaskVO)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("修改子任务") | 
|---|
|  |  |  | 
|---|
|  |  |  | import com.ruoyi.common.utils.poi.ExcelUtil; | 
|---|
|  |  |  | import com.smartor.domain.ServiceSubtaskDetail; | 
|---|
|  |  |  | import com.smartor.service.IServiceSubtaskDetailService; | 
|---|
|  |  |  | import io.swagger.annotations.ApiOperation; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.security.access.prepost.PreAuthorize; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.*; | 
|---|
|  |  |  | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 语音任务呼叫明细Controller | 
|---|
|  |  |  | * 语音任务结果明细Controller | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @author smartor | 
|---|
|  |  |  | * @date 2023-03-24 | 
|---|
|  |  |  | 
|---|
|  |  |  | * 查询语音任务呼叫明细列表 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | //@PreAuthorize("@ss.hasPermi('smartor:ServiceSubtaskDetail:list')") | 
|---|
|  |  |  | @ApiOperation("查询任务结果明细列表") | 
|---|
|  |  |  | @PostMapping("/list") | 
|---|
|  |  |  | public TableDataInfo list(@RequestBody ServiceSubtaskDetail serviceSubtaskDetail) { | 
|---|
|  |  |  | startPage(); | 
|---|
|  |  |  | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | //@PreAuthorize("@ss.hasPermi('smartor:ServiceSubtaskDetail:export')") | 
|---|
|  |  |  | @Log(title = "语音任务呼叫明细", businessType = BusinessType.EXPORT) | 
|---|
|  |  |  | @ApiOperation("导出任务结果明细列表") | 
|---|
|  |  |  | @PostMapping("/export") | 
|---|
|  |  |  | public void export(HttpServletResponse response, ServiceSubtaskDetail serviceSubtaskDetail) { | 
|---|
|  |  |  | List<ServiceSubtaskDetail> list = ServiceSubtaskDetailService.selectServiceSubtaskDetailList(serviceSubtaskDetail); | 
|---|
|  |  |  | 
|---|
|  |  |  | * 获取语音任务呼叫明细详细信息 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | //@PreAuthorize("@ss.hasPermi('smartor:ServiceSubtaskDetail:query')") | 
|---|
|  |  |  | @GetMapping(value = "/{calldetailid}") | 
|---|
|  |  |  | @ApiOperation("获取任务结果明细详细信息") | 
|---|
|  |  |  | @GetMapping(value = "/getInfo/{calldetailid}") | 
|---|
|  |  |  | public AjaxResult getInfo(@PathVariable("calldetailid") String calldetailid) { | 
|---|
|  |  |  | return success(ServiceSubtaskDetailService.selectServiceSubtaskDetailByCalldetailid(calldetailid)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 新增语音任务呼叫明细 | 
|---|
|  |  |  | * 新增任务结果明细 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | //@PreAuthorize("@ss.hasPermi('smartor:ServiceSubtaskDetail:add')") | 
|---|
|  |  |  | @ApiOperation("新增任务结果明细") | 
|---|
|  |  |  | @Log(title = "语音任务呼叫明细", businessType = BusinessType.INSERT) | 
|---|
|  |  |  | @PostMapping("/add") | 
|---|
|  |  |  | public AjaxResult add(@RequestBody ServiceSubtaskDetail serviceSubtaskDetail) { | 
|---|
|  |  |  | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | //@PreAuthorize("@ss.hasPermi('smartor:ServiceSubtaskDetail:edit')") | 
|---|
|  |  |  | @Log(title = "语音任务呼叫明细", businessType = BusinessType.UPDATE) | 
|---|
|  |  |  | @ApiOperation("修改任务结果明细") | 
|---|
|  |  |  | @PostMapping("/edit") | 
|---|
|  |  |  | public AjaxResult edit(@RequestBody ServiceSubtaskDetail serviceSubtaskDetail) { | 
|---|
|  |  |  | return toAjax(ServiceSubtaskDetailService.updateServiceSubtaskDetail(serviceSubtaskDetail)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("修改任务结果明细通过条件") | 
|---|
|  |  |  | @PostMapping("/editByCondition") | 
|---|
|  |  |  | public AjaxResult updateSSDByCondition(@RequestBody ServiceSubtaskDetail serviceSubtaskDetail) { | 
|---|
|  |  |  | return toAjax(ServiceSubtaskDetailService.updateSSDByCondition(serviceSubtaskDetail)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 删除语音任务呼叫明细 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | 
|---|
|  |  |  | import com.smartor.service.ITemplateDeptService; | 
|---|
|  |  |  | import io.swagger.annotations.Api; | 
|---|
|  |  |  | import io.swagger.annotations.ApiOperation; | 
|---|
|  |  |  | import lombok.extern.slf4j.Slf4j; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.*; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | * @author lihu | 
|---|
|  |  |  | * @date 2024-09-18 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Slf4j | 
|---|
|  |  |  | @Api("模板科室关联") | 
|---|
|  |  |  | @RestController | 
|---|
|  |  |  | @RequestMapping("/smartor/td") | 
|---|
|  |  |  | public class TemplateDeptController extends BaseController | 
|---|
|  |  |  | { | 
|---|
|  |  |  | public class TemplateDeptController extends BaseController { | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private ITemplateDeptService templateDeptService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiOperation("查询模板科室关联列表") | 
|---|
|  |  |  | //@PreAuthorize("@ss.hasPermi('smartor:dept:list')") | 
|---|
|  |  |  | @GetMapping("/list") | 
|---|
|  |  |  | public TableDataInfo list(TemplateDept templateDept) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | public TableDataInfo list(TemplateDept templateDept) { | 
|---|
|  |  |  | startPage(); | 
|---|
|  |  |  | List<TemplateDept> list = templateDeptService.selectTemplateDeptList(templateDept); | 
|---|
|  |  |  | return getDataTable(list); | 
|---|
|  |  |  | 
|---|
|  |  |  | //@PreAuthorize("@ss.hasPermi('smartor:dept:export')") | 
|---|
|  |  |  | @Log(title = "模板科室关联", businessType = BusinessType.EXPORT) | 
|---|
|  |  |  | @PostMapping("/export") | 
|---|
|  |  |  | public void export(HttpServletResponse response, TemplateDept templateDept) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | public void export(HttpServletResponse response, TemplateDept templateDept) { | 
|---|
|  |  |  | List<TemplateDept> list = templateDeptService.selectTemplateDeptList(templateDept); | 
|---|
|  |  |  | ExcelUtil<TemplateDept> util = new ExcelUtil<TemplateDept>(TemplateDept.class); | 
|---|
|  |  |  | util.exportExcel(response, list, "模板科室关联数据"); | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiOperation("获取模板科室关联详细信息") | 
|---|
|  |  |  | //@PreAuthorize("@ss.hasPermi('smartor:dept:query')") | 
|---|
|  |  |  | @GetMapping(value = "/getInfo/{id}") | 
|---|
|  |  |  | public AjaxResult getInfo(@PathVariable("id") Long id) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | public AjaxResult getInfo(@PathVariable("id") Long id) { | 
|---|
|  |  |  | return success(templateDeptService.selectTemplateDeptById(id)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiOperation("新增模板科室关联") | 
|---|
|  |  |  | @Log(title = "模板科室关联", businessType = BusinessType.INSERT) | 
|---|
|  |  |  | @PostMapping("/add") | 
|---|
|  |  |  | public AjaxResult add(@RequestBody List<TemplateDept> templateDepts) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | public AjaxResult add(@RequestBody List<TemplateDept> templateDepts) { | 
|---|
|  |  |  | return toAjax(templateDeptService.insertTemplateDept(templateDepts)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | //@PreAuthorize("@ss.hasPermi('smartor:dept:edit')") | 
|---|
|  |  |  | @Log(title = "模板科室关联", businessType = BusinessType.UPDATE) | 
|---|
|  |  |  | @PostMapping("/edit") | 
|---|
|  |  |  | public AjaxResult edit(@RequestBody TemplateDept templateDept) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | public AjaxResult edit(@RequestBody TemplateDept templateDept) { | 
|---|
|  |  |  | return toAjax(templateDeptService.updateTemplateDept(templateDept)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiOperation("删除模板科室关联") | 
|---|
|  |  |  | //@PreAuthorize("@ss.hasPermi('smartor:dept:remove')") | 
|---|
|  |  |  | @Log(title = "模板科室关联", businessType = BusinessType.DELETE) | 
|---|
|  |  |  | @GetMapping("/remove/{ids}") | 
|---|
|  |  |  | public AjaxResult remove(@PathVariable Long[] ids) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | return toAjax(templateDeptService.deleteTemplateDeptByIds(ids)); | 
|---|
|  |  |  | @GetMapping("/remove/{id}") | 
|---|
|  |  |  | public AjaxResult remove(@PathVariable("id") Long id) { | 
|---|
|  |  |  | log.error("删除的ID为:{}",id); | 
|---|
|  |  |  | return toAjax(templateDeptService.deleteTemplateDeptById(id)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | user.setCreateBy(getUsername()); | 
|---|
|  |  |  | user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); | 
|---|
|  |  |  | return toAjax(userService.insertUser(user)); | 
|---|
|  |  |  | int i = userService.insertUser(user); | 
|---|
|  |  |  | return success(user.getUserId().intValue()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | 
|---|
|  |  |  | @Api("【请填写功能名称】") | 
|---|
|  |  |  | @RestController | 
|---|
|  |  |  | @RequestMapping("/smartor/userdept") | 
|---|
|  |  |  | public class SysUserDeptController extends BaseController | 
|---|
|  |  |  | { | 
|---|
|  |  |  | public class SysUserDeptController extends BaseController { | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private ISysUserDeptService sysUserDeptService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiOperation("查询【请填写功能名称】列表") | 
|---|
|  |  |  | //@PreAuthorize("@ss.hasPermi('smartor:dept:list')") | 
|---|
|  |  |  | @GetMapping("/list") | 
|---|
|  |  |  | public TableDataInfo list(SysUserDept sysUserDept) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | public TableDataInfo list(SysUserDept sysUserDept) { | 
|---|
|  |  |  | startPage(); | 
|---|
|  |  |  | List<SysUserDept> list = sysUserDeptService.selectSysUserDeptList(sysUserDept); | 
|---|
|  |  |  | return getDataTable(list); | 
|---|
|  |  |  | 
|---|
|  |  |  | //@PreAuthorize("@ss.hasPermi('smartor:dept:export')") | 
|---|
|  |  |  | @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT) | 
|---|
|  |  |  | @PostMapping("/export") | 
|---|
|  |  |  | public void export(HttpServletResponse response, SysUserDept sysUserDept) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | public void export(HttpServletResponse response, SysUserDept sysUserDept) { | 
|---|
|  |  |  | List<SysUserDept> list = sysUserDeptService.selectSysUserDeptList(sysUserDept); | 
|---|
|  |  |  | ExcelUtil<SysUserDept> util = new ExcelUtil<SysUserDept>(SysUserDept.class); | 
|---|
|  |  |  | util.exportExcel(response, list, "【请填写功能名称】数据"); | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiOperation("获取【请填写功能名称】详细信息") | 
|---|
|  |  |  | //@PreAuthorize("@ss.hasPermi('smartor:dept:query')") | 
|---|
|  |  |  | @GetMapping(value = "/getInfo/{id}") | 
|---|
|  |  |  | public AjaxResult getInfo(@PathVariable("id") Long id) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | public AjaxResult getInfo(@PathVariable("id") Long id) { | 
|---|
|  |  |  | return success(sysUserDeptService.selectSysUserDeptById(id)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiOperation("导出【请填写功能名称】列表") | 
|---|
|  |  |  | @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT) | 
|---|
|  |  |  | @PostMapping("/add") | 
|---|
|  |  |  | public AjaxResult add(@RequestBody SysUserDept sysUserDept) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | public AjaxResult add(@RequestBody SysUserDept sysUserDept) { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return toAjax(sysUserDeptService.insertSysUserDept(sysUserDept)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | //@PreAuthorize("@ss.hasPermi('smartor:dept:edit')") | 
|---|
|  |  |  | @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE) | 
|---|
|  |  |  | @PostMapping("/edit") | 
|---|
|  |  |  | public AjaxResult edit(@RequestBody SysUserDept sysUserDept) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | public AjaxResult edit(@RequestBody SysUserDept sysUserDept) { | 
|---|
|  |  |  | return toAjax(sysUserDeptService.updateSysUserDept(sysUserDept)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiOperation("删除【请填写功能名称】") | 
|---|
|  |  |  | //@PreAuthorize("@ss.hasPermi('smartor:dept:remove')") | 
|---|
|  |  |  | @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE) | 
|---|
|  |  |  | @GetMapping("/remove/{ids}") | 
|---|
|  |  |  | public AjaxResult remove(@PathVariable Long[] ids) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | @GetMapping("/remove/{ids}") | 
|---|
|  |  |  | public AjaxResult remove(@PathVariable Long[] ids) { | 
|---|
|  |  |  | return toAjax(sysUserDeptService.deleteSysUserDeptByIds(ids)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("删除根据条件") | 
|---|
|  |  |  | @GetMapping("/removeByCode/{userId}/{deptCode}") | 
|---|
|  |  |  | public AjaxResult deleteSysUserDeptByCode(@PathVariable("userId") Long userId, @PathVariable("deptCode") String deptCode) { | 
|---|
|  |  |  | SysUserDept sysUserDept = new SysUserDept(); | 
|---|
|  |  |  | sysUserDept.setUserId(userId); | 
|---|
|  |  |  | sysUserDept.setDeptCode(deptCode); | 
|---|
|  |  |  | return toAjax(sysUserDeptService.deleteSysUserDeptByCode(sysUserDept)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiModelProperty(value = "部门集合") | 
|---|
|  |  |  | private List<Long> depts; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiModelProperty(value = "病区编码集合") | 
|---|
|  |  |  | private List<String> wardCodes; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiModelProperty(value = "部门编码集合") | 
|---|
|  |  |  | private List<String> deptCodes; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 角色对象 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | 
|---|
|  |  |  | return belongDepts; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public List<String> getWardCodes() { | 
|---|
|  |  |  | return wardCodes; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void setWardCodes(List<String> wardCodes) { | 
|---|
|  |  |  | this.wardCodes = wardCodes; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public List<String> getDeptCodes() { | 
|---|
|  |  |  | return deptCodes; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void setDeptCodes(List<String> deptCodes) { | 
|---|
|  |  |  | this.deptCodes = deptCodes; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void setBelongDepts(List<Map<String, Object>> belongDepts) { | 
|---|
|  |  |  | this.belongDepts = belongDepts; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.alibaba.fastjson2.JSON; | 
|---|
|  |  |  | import com.alibaba.fastjson2.JSONObject; | 
|---|
|  |  |  | import com.fasterxml.jackson.databind.JsonNode; | 
|---|
|  |  |  | import com.fasterxml.jackson.databind.ObjectMapper; | 
|---|
|  |  |  | import com.google.common.reflect.TypeToken; | 
|---|
|  |  |  | import com.google.gson.Gson; | 
|---|
|  |  |  | import com.google.gson.JsonArray; | 
|---|
|  |  |  | 
|---|
|  |  |  | import org.springframework.transaction.PlatformTransactionManager; | 
|---|
|  |  |  | import org.springframework.transaction.annotation.Transactional; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.io.IOException; | 
|---|
|  |  |  | import java.io.UnsupportedEncodingException; | 
|---|
|  |  |  | import java.lang.reflect.Type; | 
|---|
|  |  |  | import java.net.URLEncoder; | 
|---|
|  |  |  | import java.nio.charset.StandardCharsets; | 
|---|
|  |  |  | import java.nio.file.Files; | 
|---|
|  |  |  | import java.nio.file.Paths; | 
|---|
|  |  |  | import java.text.ParseException; | 
|---|
|  |  |  | import java.text.SimpleDateFormat; | 
|---|
|  |  |  | import java.time.LocalDate; | 
|---|
|  |  |  | import java.time.LocalDateTime; | 
|---|
|  |  |  | import java.time.ZoneId; | 
|---|
|  |  |  | import java.time.format.DateTimeFormatter; | 
|---|
|  |  |  | import java.util.*; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | System.out.println("执行无参方法"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void importData() { | 
|---|
|  |  |  | //        String filePath = "path/to/your/file.txt"; // 替换为你的文件路径 | 
|---|
|  |  |  | // | 
|---|
|  |  |  | //        try { | 
|---|
|  |  |  | //            // 读取文件内容 | 
|---|
|  |  |  | //            String jsonContent = new String(Files.readAllBytes(Paths.get(filePath))); | 
|---|
|  |  |  | // | 
|---|
|  |  |  | //            // 创建ObjectMapper对象 | 
|---|
|  |  |  | //            ObjectMapper objectMapper = new ObjectMapper(); | 
|---|
|  |  |  | // | 
|---|
|  |  |  | //            // 解析JSON为JsonNode | 
|---|
|  |  |  | //            JsonNode rootNode = objectMapper.readTree(jsonContent); | 
|---|
|  |  |  | //            // 获取resultList | 
|---|
|  |  |  | //            JsonNode resultListNode = rootNode.path("results").path("resultList"); | 
|---|
|  |  |  | //            // 遍历resultList中的每个对象 | 
|---|
|  |  |  | //            for (JsonNode item : resultListNode) { | 
|---|
|  |  |  | //                String userName = item.path("staffNum").asText(); | 
|---|
|  |  |  | //                String idCard = item.path("idCard").asText(); | 
|---|
|  |  |  | //                String personnelStampNum = item.path("defaultWardId").asText(); | 
|---|
|  |  |  | //                String personnelStampNum = item.path("defaultWardName").asText(); | 
|---|
|  |  |  | //                String deptName = item.path("defaultDeptName").asText(); | 
|---|
|  |  |  | //                String deptCode = item.path("defaultDeptId").asText(); | 
|---|
|  |  |  | //                String phonenumber = item.path("telphone").asText(); | 
|---|
|  |  |  | //                String nickName = item.path("staffName").asText(); | 
|---|
|  |  |  | //                String sex = item.path("staffSex").asText(); | 
|---|
|  |  |  | // | 
|---|
|  |  |  | //            } | 
|---|
|  |  |  | // | 
|---|
|  |  |  | //        } catch (IOException e) { | 
|---|
|  |  |  | //            e.printStackTrace(); | 
|---|
|  |  |  | //        } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void analysisData() { | 
|---|
|  |  |  | System.out.println("---------------------------"); | 
|---|
|  |  |  | //数据解析 | 
|---|
|  |  |  | 
|---|
|  |  |  | List<ServiceTask> serviceTasks = serviceTaskMapper.selectServiceTaskList(st); | 
|---|
|  |  |  | log.error("serviceTasks进来了吗?{}", serviceTasks); | 
|---|
|  |  |  | for (ServiceTask serviceTask : serviceTasks) { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //通过taskId,获取未执行的子任务信息 | 
|---|
|  |  |  | ServiceSubtaskVO serviceSubtask = new ServiceSubtaskVO(); | 
|---|
|  |  |  | serviceSubtask.setTaskid(serviceTask.getTaskid()); | 
|---|
|  |  |  | serviceSubtask.setSendstate(2L); | 
|---|
|  |  |  | List<ServiceSubtask> selectServiceSubtaskList = iServiceSubtaskService.selectServiceSubtaskList(serviceSubtask); | 
|---|
|  |  |  | log.error("selectServiceSubtaskList进来了吗?{}", selectServiceSubtaskList); | 
|---|
|  |  |  | if (CollectionUtils.isNotEmpty(selectServiceSubtaskList)) { | 
|---|
|  |  |  | for (ServiceSubtask serviceSubtask1 : selectServiceSubtaskList) { | 
|---|
|  |  |  | //如果患者的发送日期是今天,则进行发送 | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | boolean dateToday = isDateToday(serviceSubtask1.getLongSendTime()); | 
|---|
|  |  |  | if (dateToday) { | 
|---|
|  |  |  | //先判断患者是不是还要发送 | 
|---|
|  |  |  | PatArchive patArchive = patArchiveService.selectPatArchiveByPatid(serviceSubtask1.getPatid()); | 
|---|
|  |  |  | if (!Objects.isNull(patArchive) && patArchive.getNotrequiredFlag() == "1") { | 
|---|
|  |  |  | //不需要发送 | 
|---|
|  |  |  | serviceSubtask1.setResult("error"); | 
|---|
|  |  |  | serviceSubtask1.setRemark(patArchive.getNotrequiredreason()); | 
|---|
|  |  |  | serviceSubtask1.setSendstate(4L); | 
|---|
|  |  |  | serviceSubtask1.setFinishtime(new Date()); | 
|---|
|  |  |  | iServiceSubtaskService.insertServiceSubtask(serviceSubtask1); | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | log.error("dateToday进来了吗?{}", dateToday); | 
|---|
|  |  |  | CommonTaskcallMQ commonTaskcallMQ = new CommonTaskcallMQ(); | 
|---|
|  |  |  | commonTaskcallMQ.setTaskid(serviceTask.getTaskid()); | 
|---|
|  |  |  | commonTaskcallMQ.setPreachform(serviceSubtask1.getServiceform()); | 
|---|
|  |  |  | commonTaskcallMQ.setSendType("2"); | 
|---|
|  |  |  | Map<String, Object> map = sfHandlle(commonTaskcallMQ, localIP); | 
|---|
|  |  |  | //发送完成后,修改状态 | 
|---|
|  |  |  | serviceSubtask1.setSendstate(3L); | 
|---|
|  |  |  | if ((Boolean) map.get("succ") == false) { | 
|---|
|  |  |  | serviceSubtask1.setResult("success"); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | serviceSubtask1.setResult("error"); | 
|---|
|  |  |  | serviceSubtask1.setRemark(map.get("msg").toString()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | iServiceSubtaskService.updateServiceSubtask(serviceSubtask1); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | String guid = UUID.randomUUID().toString(); | 
|---|
|  |  |  | log.error("长期任务,发送失败原因:{},{}", e.getMessage(), guid); | 
|---|
|  |  |  | serviceSubtask1.setResult("error"); | 
|---|
|  |  |  | serviceSubtask1.setRemark("系统错误"); | 
|---|
|  |  |  | serviceSubtask1.setSendstate(5L); | 
|---|
|  |  |  | serviceSubtask1.setFinishtime(new Date()); | 
|---|
|  |  |  | serviceSubtask1.setGuid(guid); | 
|---|
|  |  |  | iServiceSubtaskService.insertServiceSubtask(serviceSubtask1); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | CommonTaskcallMQ commonTaskcallMQ = new CommonTaskcallMQ(); | 
|---|
|  |  |  | commonTaskcallMQ.setTaskid(serviceTask.getTaskid()); | 
|---|
|  |  |  | commonTaskcallMQ.setPreachform(serviceTask.getPreachform()); | 
|---|
|  |  |  | commonTaskcallMQ.setSendType("2"); | 
|---|
|  |  |  | sfHandlle(commonTaskcallMQ, localIP); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public boolean isDateToday(Date date) { | 
|---|
|  |  |  | //如果给的日期小于当前日期,也直接发送 | 
|---|
|  |  |  | LocalDateTime localDateTime = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime(); | 
|---|
|  |  |  | if (localDateTime.isBefore(LocalDateTime.now())) { | 
|---|
|  |  |  | return true; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // 获取当前日期 | 
|---|
|  |  |  | Calendar calendarNow = Calendar.getInstance(); | 
|---|
|  |  |  | int todayYear = calendarNow.get(Calendar.YEAR); | 
|---|
|  |  |  | 
|---|
|  |  |  | return (calendarToCheck.get(Calendar.YEAR) == todayYear && calendarToCheck.get(Calendar.MONTH) == todayMonth && calendarToCheck.get(Calendar.DAY_OF_MONTH) == todayDay); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public Map<String, Object> sfHandlle(CommonTaskcallMQ commonTaskcallMQ, String ip) { | 
|---|
|  |  |  | public void sfHandlle(CommonTaskcallMQ commonTaskcallMQ, String ip) { | 
|---|
|  |  |  | log.error("sfHandlle进来了吗?{}", commonTaskcallMQ); | 
|---|
|  |  |  | //判断一下commonTaskcallMQ中的stopstate是否与ivr_task中的一致,不一致,则说明是暂停了 | 
|---|
|  |  |  | ServiceTask ivrTask1 = serviceTaskMapper.selectServiceTaskByTaskid(commonTaskcallMQ.getTaskid()); | 
|---|
|  |  |  | 
|---|
|  |  |  | //通过任务ID拿到患者信息 | 
|---|
|  |  |  | ServiceSubtaskVO ivrTaskcall = new ServiceSubtaskVO(); | 
|---|
|  |  |  | ivrTaskcall.setTaskid(commonTaskcallMQ.getTaskid()); | 
|---|
|  |  |  | ivrTaskcall.setSendstate(2L); | 
|---|
|  |  |  | List<ServiceSubtask> selectServiceSubtaskList = iServiceSubtaskService.selectServiceSubtaskList(ivrTaskcall); | 
|---|
|  |  |  | if (descByCode.equals("电话")) { | 
|---|
|  |  |  | for (ServiceSubtask serviceSubtask : selectServiceSubtaskList) { | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } else if (descByCode.equals("多媒体")) { | 
|---|
|  |  |  | //多媒体 | 
|---|
|  |  |  | return null; | 
|---|
|  |  |  | } else if (descByCode.equals("纸质")) { | 
|---|
|  |  |  | //纸质 | 
|---|
|  |  |  | return null; | 
|---|
|  |  |  | } else if (descByCode.equals("短信")) { | 
|---|
|  |  |  | //短信 | 
|---|
|  |  |  | //                        http://localhost:8099/followvisit/particty?param1=3¶m2=348 | 
|---|
|  |  |  | 
|---|
|  |  |  | serviceSubtaskRecord.setStartTime(System.currentTimeMillis()); | 
|---|
|  |  |  | serviceSubtaskRecord.setResult(aBoolean == true ? "成功" : "失败"); | 
|---|
|  |  |  | serviceSubtaskRecordService.insertServiceSubtaskRecord(serviceSubtaskRecord); | 
|---|
|  |  |  | return null; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } else if (descByCode.equals("公众号")) { | 
|---|
|  |  |  | log.error("公众号进来了吗?{}", descByCode); | 
|---|
|  |  |  | 
|---|
|  |  |  | String taskId = rsaPublicKeyExample.encryptedData(ivrTask1.getTaskid().toString(), pub_key); | 
|---|
|  |  |  | for (ServiceSubtask serviceSubtask : selectServiceSubtaskList) { | 
|---|
|  |  |  | log.error("serviceSubtask---------进来了吗?{}", serviceSubtask); | 
|---|
|  |  |  | String patid = rsaPublicKeyExample.encryptedData(serviceSubtask.getPatid().toString(), pub_key); | 
|---|
|  |  |  | String url = null; | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | url = ip + ":" + req_path + "/outsideChainwt?param1=" + taskId + "¶m2=" + patid + "¶m3=" + URLEncoder.encode(ivrTask1.getTaskName(), StandardCharsets.UTF_8.toString()) + "¶m5=false"; | 
|---|
|  |  |  | } catch (UnsupportedEncodingException e) { | 
|---|
|  |  |  | e.printStackTrace(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | String wxCode = getWXCode(serviceSubtask.getSfzh(), url, serviceSubtask.getTaskName(), serviceSubtask.getTaskDesc(), "无"); | 
|---|
|  |  |  | Map<String, Object> map = JSONObject.parseObject(wxCode, Map.class); | 
|---|
|  |  |  | boolean dateToday = isDateToday(serviceSubtask.getLongSendTime()); | 
|---|
|  |  |  | if (dateToday) { | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | //先判断患者是不是还要发送 | 
|---|
|  |  |  | PatArchive patArchive = patArchiveService.selectPatArchiveByPatid(serviceSubtask.getPatid()); | 
|---|
|  |  |  | if (!Objects.isNull(patArchive) && patArchive.getNotrequiredFlag() == "1") { | 
|---|
|  |  |  | //不需要发送 | 
|---|
|  |  |  | serviceSubtask.setResult("error"); | 
|---|
|  |  |  | serviceSubtask.setRemark(patArchive.getNotrequiredreason()); | 
|---|
|  |  |  | serviceSubtask.setSendstate(4L); | 
|---|
|  |  |  | serviceSubtask.setFinishtime(new Date()); | 
|---|
|  |  |  | iServiceSubtaskService.insertServiceSubtask(serviceSubtask); | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | String patid = rsaPublicKeyExample.encryptedData(serviceSubtask.getPatid().toString(), pub_key); | 
|---|
|  |  |  | String url = null; | 
|---|
|  |  |  | url = ip + ":" + req_path + "/outsideChainwt?param1=" + taskId + "¶m2=" + patid + "¶m3=" + URLEncoder.encode(ivrTask1.getTaskName(), StandardCharsets.UTF_8.toString()) + "¶m5=false"; | 
|---|
|  |  |  | String wxCode = getWXCode(serviceSubtask.getSfzh(), url, serviceSubtask.getTaskName(), serviceSubtask.getTaskDesc(), "无"); | 
|---|
|  |  |  | Map<String, Object> map = JSONObject.parseObject(wxCode, Map.class); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //任务发送记录 | 
|---|
|  |  |  | ServiceSubtaskRecord serviceSubtaskRecord = new ServiceSubtaskRecord(); | 
|---|
|  |  |  | serviceSubtaskRecord.setTaskid(serviceSubtask.getTaskid().toString()); | 
|---|
|  |  |  | serviceSubtaskRecord.setUuid(UUID.randomUUID().toString()); | 
|---|
|  |  |  | serviceSubtaskRecord.setTasktype(serviceSubtask.getType()); | 
|---|
|  |  |  | serviceSubtaskRecord.setPreachform("4"); | 
|---|
|  |  |  | serviceSubtaskRecord.setStartTime(System.currentTimeMillis()); | 
|---|
|  |  |  | serviceSubtaskRecord.setResult("success"); | 
|---|
|  |  |  | if (!map.isEmpty() && (Boolean) map.get("succ") == false) | 
|---|
|  |  |  | serviceSubtaskRecord.setResult("error"); | 
|---|
|  |  |  | serviceSubtaskRecordService.insertServiceSubtaskRecord(serviceSubtaskRecord); | 
|---|
|  |  |  | return map; | 
|---|
|  |  |  | //任务发送记录 | 
|---|
|  |  |  | ServiceSubtaskRecord serviceSubtaskRecord = new ServiceSubtaskRecord(); | 
|---|
|  |  |  | serviceSubtaskRecord.setTaskid(serviceSubtask.getTaskid().toString()); | 
|---|
|  |  |  | serviceSubtaskRecord.setUuid(UUID.randomUUID().toString()); | 
|---|
|  |  |  | serviceSubtaskRecord.setTasktype(serviceSubtask.getType()); | 
|---|
|  |  |  | serviceSubtaskRecord.setPreachform("4"); | 
|---|
|  |  |  | serviceSubtaskRecord.setStartTime(System.currentTimeMillis()); | 
|---|
|  |  |  | serviceSubtaskRecord.setResult("success"); | 
|---|
|  |  |  | if (!map.isEmpty() && (Boolean) map.get("succ") == false) | 
|---|
|  |  |  | serviceSubtaskRecord.setResult("error"); | 
|---|
|  |  |  | serviceSubtaskRecordService.insertServiceSubtaskRecord(serviceSubtaskRecord); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //发送完成后,修改状态 | 
|---|
|  |  |  | serviceSubtask.setSendstate(3L); | 
|---|
|  |  |  | if ((Boolean) map.get("succ") == true) { | 
|---|
|  |  |  | serviceSubtask.setResult("success"); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | serviceSubtask.setResult("error"); | 
|---|
|  |  |  | serviceSubtask.setRemark(map.get("msg").toString()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | iServiceSubtaskService.updateServiceSubtask(serviceSubtask); | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | String guid = UUID.randomUUID().toString(); | 
|---|
|  |  |  | log.error("长期任务,发送失败原因:{},{}", e.getMessage(), guid); | 
|---|
|  |  |  | serviceSubtask.setResult("error"); | 
|---|
|  |  |  | serviceSubtask.setRemark("系统错误"); | 
|---|
|  |  |  | serviceSubtask.setSendstate(5L); | 
|---|
|  |  |  | serviceSubtask.setFinishtime(new Date()); | 
|---|
|  |  |  | serviceSubtask.setGuid(guid); | 
|---|
|  |  |  | iServiceSubtaskService.updateServiceSubtask(serviceSubtask); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //通知 MQ 消息已被接收,可以ACK(从队列中删除)了   (这个需要根据业务再去处理ACK) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return null; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Transactional | 
|---|
|  |  |  | public void getInHospInfo(String cry, LocalDateTime startTime, LocalDateTime endTime) { | 
|---|
|  |  |  | // 获取当前日期和时间 | 
|---|
|  |  |  | LocalDateTime currentDateTime = LocalDateTime.now(); | 
|---|
|  |  |  | // 获取前一天的日期和时间 | 
|---|
|  |  |  | LocalDateTime previousDateTime = currentDateTime.minusDays(1); | 
|---|
|  |  |  | // 定义日期时间格式 | 
|---|
|  |  |  | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.S"); | 
|---|
|  |  |  | Map<String, String> req = new HashMap<>(); | 
|---|
|  |  |  | 
|---|
|  |  |  | header.put("x-hcsb-version", "2.0"); | 
|---|
|  |  |  | header.put("x-hcsb-sourcesyscode", "14"); | 
|---|
|  |  |  | header.put("x-hcsb-token", "ArGE2JnHtxG/Zx5nrnGY4eOfMUJGGJokAJHigG1BrCY="); | 
|---|
|  |  |  | header.put("x-hcsb-msgdate", currentDateTime.format(formatter)); | 
|---|
|  |  |  | header.put("x-hcsb-msgdate", startTime.format(formatter)); | 
|---|
|  |  |  | String result = HttpUtils.sendPostByHeader(hospInfoUrl, new Gson().toJson(req), header); | 
|---|
|  |  |  | //数据解析 | 
|---|
|  |  |  | Gson gson = new Gson(); | 
|---|
|  |  |  | 
|---|
|  |  |  | patArchive.setPatientno(thiedInhospInfo.getPatiMediaNo()); | 
|---|
|  |  |  | patArchive.setSourcefrom(2); | 
|---|
|  |  |  | patArchive.setPattype("2"); | 
|---|
|  |  |  | if (thiedInhospInfo.getOutWayId().equals("4")) { | 
|---|
|  |  |  | if (StringUtils.isNotEmpty(thiedInhospInfo.getOutWayId()) && thiedInhospInfo.getOutWayId().equals("4")) { | 
|---|
|  |  |  | //如果为4就是死亡 | 
|---|
|  |  |  | patArchive.setNotrequiredFlag("1"); | 
|---|
|  |  |  | patArchive.setNotrequiredreason(thiedInhospInfo.getOutWayName()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (cry.equals("1") && StringUtils.isEmpty(thiedInhospInfo.getOutWayId())) { | 
|---|
|  |  |  | //如果为4就是死亡 | 
|---|
|  |  |  | patArchive.setNotrequiredFlag("1"); | 
|---|
|  |  |  | patArchive.setNotrequiredreason("出院方式为空"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | patArchive.setSex(thiedInhospInfo.getPatiRecordGender().equals("男") ? 1L : 2L); | 
|---|
|  |  |  | patArchive.setNation(thiedInhospInfo.getPatiNation()); | 
|---|
|  |  |  | 
|---|
|  |  |  | } catch (ParseException e) { | 
|---|
|  |  |  | e.printStackTrace(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | patArchive.setAge(Long.valueOf(thiedInhospInfo.getTreateAge())); | 
|---|
|  |  |  | if (thiedInhospInfo.getTreateAge() != null) { | 
|---|
|  |  |  | patArchive.setAge(Long.valueOf(thiedInhospInfo.getTreateAge())); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | patArchive.setAge(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | patArchive.setAgeUnit(thiedInhospInfo.getTreatAgeunit()); | 
|---|
|  |  |  | patArchive.setTelcode(thiedInhospInfo.getCompanyTelNum()); | 
|---|
|  |  |  | patArchive.setRelativetelcode(thiedInhospInfo.getContactPersonPhone()); | 
|---|
|  |  |  | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | patArchive = patArchives.get(0); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | log.error("入参的patArchive:{}", patArchive); | 
|---|
|  |  |  | PatMedInhosp patMedInhosp = new PatMedInhosp(); | 
|---|
|  |  |  | patMedInhosp.setPatid(patArchive.getId()); | 
|---|
|  |  |  | 
|---|
|  |  |  | patMedInhosp.setLeavehospitaldistrictcode(thiedInhospInfo.getCurrWardId()); | 
|---|
|  |  |  | patMedInhosp.setLeavehospitaldistrictname(thiedInhospInfo.getCurrWardName()); | 
|---|
|  |  |  | patMedInhosp.setLeaveldeptid(thiedInhospInfo.getCurrDeptCode()); | 
|---|
|  |  |  | patMedInhospService.insertPatMedInhosp(patMedInhosp); | 
|---|
|  |  |  | //如果是出院,先通过患者编号和流水号去查一下,患者是否存在,如果存在,则进行修改 | 
|---|
|  |  |  | PatMedInhosp inhosp = new PatMedInhosp(); | 
|---|
|  |  |  | inhosp.setInhospno(patArchive.getPatientno()); | 
|---|
|  |  |  | inhosp.setSerialnum(patMedInhosp.getSerialnum()); | 
|---|
|  |  |  | List<PatMedInhosp> patMedInhosps = patMedInhospService.selectPatMedInhospList(inhosp); | 
|---|
|  |  |  | if (CollectionUtils.isNotEmpty(patMedInhosps)) { | 
|---|
|  |  |  | patMedInhospService.updatePatMedInhosp(patMedInhosp); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | patMedInhospService.insertPatMedInhosp(patMedInhosp); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | String result = HttpUtils.sendPost(thirdWXUrl, new Gson().toJson(xinHuaWXReq)); | 
|---|
|  |  |  | JSONObject jsonObject = JSONObject.parseObject(result); | 
|---|
|  |  |  | String code = (String) jsonObject.get("code"); | 
|---|
|  |  |  | return code; | 
|---|
|  |  |  | //        String code = (String) jsonObject.get("code"); | 
|---|
|  |  |  | return jsonObject.toString(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public SysDept selectDeptById(Long deptId); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public SysDept selectDeptByCode(String deptCode); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 根据ID查询所有子部门 | 
|---|
|  |  |  | * | 
|---|
|  |  |  | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public int deleteSysUserDeptByIds(Long[] ids); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public int deleteSysUserDeptByCode(SysUserDept sysUserDept); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 删除【请填写功能名称】信息 | 
|---|
|  |  |  | * | 
|---|
|  |  |  | 
|---|
|  |  |  | return sysUserDeptMapper.deleteSysUserDeptByIds(ids); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public int deleteSysUserDeptByCode(SysUserDept sysUserDept) { | 
|---|
|  |  |  | return sysUserDeptMapper.deleteSysUserDeptByCode(sysUserDept); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 删除【请填写功能名称】信息 | 
|---|
|  |  |  | * | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private SysUserMapper userMapper; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private SysDeptMapper sysDeptMapper; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private SysUserDeptMapper sysUserDeptMapper; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | //删除用户与部门的关联 | 
|---|
|  |  |  | Long[] ids = {user.getUserId()}; | 
|---|
|  |  |  | //新增用户与部门关联 | 
|---|
|  |  |  | sysUserDeptMapper.deleteSysUserDeptByIds(ids); | 
|---|
|  |  |  | if (!CollectionUtils.isEmpty(user.getDepts())) { | 
|---|
|  |  |  | for (Long deptId : user.getDepts()) { | 
|---|
|  |  |  | SysUserDept sysUserDep = new SysUserDept(); | 
|---|
|  |  |  | sysUserDep.setUserId(user.getUserId()); | 
|---|
|  |  |  | sysUserDep.setDeptId(deptId); | 
|---|
|  |  |  | //查询是否 已经关联该部门 | 
|---|
|  |  |  | List<SysUserDept> sysUserDepts = sysUserDeptMapper.selectSysUserDeptList(sysUserDep); | 
|---|
|  |  |  | //        sysUserDeptMapper.deleteSysUserDeptByIds(ids); | 
|---|
|  |  |  | //        if (!CollectionUtils.isEmpty(user.getDepts())) { | 
|---|
|  |  |  | //            for (Long deptId : user.getDepts()) { | 
|---|
|  |  |  | //                SysUserDept sysUserDep = new SysUserDept(); | 
|---|
|  |  |  | //                sysUserDep.setUserId(user.getUserId()); | 
|---|
|  |  |  | //                sysUserDep.setDeptId(deptId); | 
|---|
|  |  |  | //                //查询是否 已经关联该部门 | 
|---|
|  |  |  | //                List<SysUserDept> sysUserDepts = sysUserDeptMapper.selectSysUserDeptList(sysUserDep); | 
|---|
|  |  |  | //                if (!CollectionUtils.isEmpty(sysUserDepts)) { | 
|---|
|  |  |  | //                    SysUserDept sysUserDept = sysUserDepts.get(0); | 
|---|
|  |  |  | //                    sysUserDept.setDelFlag(0L); | 
|---|
|  |  |  | //                    sysUserDeptMapper.updateSysUserDept(sysUserDept); | 
|---|
|  |  |  | //                    continue; | 
|---|
|  |  |  | //                } | 
|---|
|  |  |  | //                sysUserDep.setCreateTime(new Date()); | 
|---|
|  |  |  | //                sysUserDep.setUpdateTime(new Date()); | 
|---|
|  |  |  | //                sysUserDeptMapper.insertSysUserDept(sysUserDep); | 
|---|
|  |  |  | //            } | 
|---|
|  |  |  | //        } | 
|---|
|  |  |  | if (!CollectionUtils.isEmpty(user.getDeptCodes())) { | 
|---|
|  |  |  | for (String deptCode : user.getDeptCodes()) { | 
|---|
|  |  |  | SysDept sysDept = sysDeptMapper.selectDeptByCode(deptCode); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | SysUserDept sysUserDept = new SysUserDept(); | 
|---|
|  |  |  | sysUserDept.setUserId(user.getUserId()); | 
|---|
|  |  |  | sysUserDept.setDeptCode(deptCode); | 
|---|
|  |  |  | List<SysUserDept> sysUserDepts = sysUserDeptMapper.selectSysUserDeptList(sysUserDept); | 
|---|
|  |  |  | sysUserDept.setDelFlag(0L); | 
|---|
|  |  |  | sysUserDept.setDeptType("1"); | 
|---|
|  |  |  | sysUserDept.setDeptName(sysDept.getDeptName()); | 
|---|
|  |  |  | sysUserDept.setUpdateTime(new Date()); | 
|---|
|  |  |  | if (!CollectionUtils.isEmpty(sysUserDepts)) { | 
|---|
|  |  |  | SysUserDept sysUserDept = sysUserDepts.get(0); | 
|---|
|  |  |  | sysUserDept.setDelFlag(0L); | 
|---|
|  |  |  | sysUserDeptMapper.updateSysUserDept(sysUserDept); | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | sysUserDep.setCreateTime(new Date()); | 
|---|
|  |  |  | sysUserDep.setUpdateTime(new Date()); | 
|---|
|  |  |  | sysUserDeptMapper.insertSysUserDept(sysUserDep); | 
|---|
|  |  |  | sysUserDept.setCreateTime(new Date()); | 
|---|
|  |  |  | sysUserDeptMapper.insertSysUserDept(sysUserDept); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (!CollectionUtils.isEmpty(user.getWardCodes())) { | 
|---|
|  |  |  | for (String wardCode : user.getWardCodes()) { | 
|---|
|  |  |  | SysDept sysDept = sysDeptMapper.selectDeptByCode(wardCode); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | SysUserDept sysUserDept = new SysUserDept(); | 
|---|
|  |  |  | sysUserDept.setUserId(user.getUserId()); | 
|---|
|  |  |  | sysUserDept.setDeptCode(wardCode); | 
|---|
|  |  |  | List<SysUserDept> sysUserDepts = sysUserDeptMapper.selectSysUserDeptList(sysUserDept); | 
|---|
|  |  |  | sysUserDept.setDelFlag(0L); | 
|---|
|  |  |  | sysUserDept.setDeptType("2"); | 
|---|
|  |  |  | sysUserDept.setDeptName(sysDept.getDeptName()); | 
|---|
|  |  |  | sysUserDept.setUpdateTime(new Date()); | 
|---|
|  |  |  | if (!CollectionUtils.isEmpty(sysUserDepts)) { | 
|---|
|  |  |  | sysUserDeptMapper.updateSysUserDept(sysUserDept); | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | sysUserDept.setCreateTime(new Date()); | 
|---|
|  |  |  | sysUserDeptMapper.insertSysUserDept(sysUserDept); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return userMapper.updateUser(user); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | <if test="deptCode != null and deptCode != ''"> | 
|---|
|  |  |  | AND dept_code = #{deptCode} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="deptType != null and deptType != ''"> | 
|---|
|  |  |  | <if test="deptType != null and deptType != ''"> | 
|---|
|  |  |  | AND dept_type = #{deptType} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <!-- 数据范围过滤 --> | 
|---|
|  |  |  | 
|---|
|  |  |  | where d.dept_id = #{deptId} | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <select id="selectDeptByCode" parameterType="string" resultMap="SysDeptResult"> | 
|---|
|  |  |  | select d.dept_id, | 
|---|
|  |  |  | d.parent_id, | 
|---|
|  |  |  | d.dept_code, | 
|---|
|  |  |  | d.dept_type, | 
|---|
|  |  |  | d.ancestors, | 
|---|
|  |  |  | d.dept_name, | 
|---|
|  |  |  | d.order_num, | 
|---|
|  |  |  | d.leader, | 
|---|
|  |  |  | d.phone, | 
|---|
|  |  |  | d.email, | 
|---|
|  |  |  | d.status | 
|---|
|  |  |  | from sys_dept d | 
|---|
|  |  |  | where del_flag = 0 | 
|---|
|  |  |  | and d.dept_code = #{deptCode} | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <select id="checkDeptExistUser" parameterType="Long" resultType="int"> | 
|---|
|  |  |  | select count(1) | 
|---|
|  |  |  | from sys_user | 
|---|
|  |  |  | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Excel(name = "可用状态") | 
|---|
|  |  |  | @ApiModelProperty(value = "可用状态") | 
|---|
|  |  |  | private String usestate; | 
|---|
|  |  |  | private String isenable; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 可用状态 | 
|---|
|  |  |  | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Excel(name = "可用状态") | 
|---|
|  |  |  | @ApiModelProperty(value = "可用状态") | 
|---|
|  |  |  | private String usestate; | 
|---|
|  |  |  | private String isenable; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 医院院区 | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiModelProperty("出院病区编号") | 
|---|
|  |  |  | private String leavehospitaldistrictcode; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 出院方式序号 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ApiModelProperty("出院方式序号") | 
|---|
|  |  |  | @Excel(name = " 出院方式序号 ") | 
|---|
|  |  |  | private String outWayId; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 出院方式名称 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ApiModelProperty("出院方式名称") | 
|---|
|  |  |  | @Excel(name = " 出院方式名称 ") | 
|---|
|  |  |  | private String outWayName; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | private String bedNo; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 出院方式序号 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ApiModelProperty("出院方式序号") | 
|---|
|  |  |  | @Excel(name = " 出院方式序号 ") | 
|---|
|  |  |  | private String outWayId; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 出院方式名称 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ApiModelProperty("出院方式名称") | 
|---|
|  |  |  | @Excel(name = " 出院方式名称 ") | 
|---|
|  |  |  | private String outWayName; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 会员属性:0非会员,1一般会员、2重要会员 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ApiModelProperty("会员属性:0非会员,1一般会员、2重要会员") | 
|---|
|  |  |  | 
|---|
|  |  |  | @Excel(name = " 疾病名称 ") | 
|---|
|  |  |  | private String diagname; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 服务标识:0,需要,1,不需要 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ApiModelProperty("服务标识:0,需要,1,不需要") | 
|---|
|  |  |  | @Excel(name = " 服务标识:0,需要,1,不需要 ") | 
|---|
|  |  |  | private String notrequiredFlag; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 证件号码 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 服务标识:0,需要,1,不需要 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ApiModelProperty("服务标识:0,需要,1,不需要") | 
|---|
|  |  |  | @Excel(name = " 服务标识:0,需要,1,不需要 ") | 
|---|
|  |  |  | private String notrequiredFlag; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 不要服务的原因 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ApiModelProperty("不要服务的原因") | 
|---|
|  |  |  | @Excel(name = " 不要服务的原因 ") | 
|---|
|  |  |  | private String notrequiredreason; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 钉钉号 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ApiModelProperty("科室") | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiModelProperty(value = "是否存在操作:1 新增 2修改 3删除") | 
|---|
|  |  |  | private Integer isoperation; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiModelProperty("出院病区名称") | 
|---|
|  |  |  | private String leavehospitaldistrictname; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiModelProperty("出院病区编号") | 
|---|
|  |  |  | private String leavehospitaldistrictcode; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 出院方式序号 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ApiModelProperty("出院方式序号") | 
|---|
|  |  |  | @Excel(name = " 出院方式序号 ") | 
|---|
|  |  |  | private String outWayId; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 出院方式名称 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ApiModelProperty("出院方式名称") | 
|---|
|  |  |  | @Excel(name = " 出院方式名称 ") | 
|---|
|  |  |  | private String outWayName; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | package com.smartor.domain; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.util.Date; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.fasterxml.jackson.annotation.JsonFormat; | 
|---|
|  |  |  | import io.swagger.annotations.ApiModel; | 
|---|
|  |  |  | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ApiModelProperty(value = "自增ID") | 
|---|
|  |  |  | private Long inhospid; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 性别 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ApiModelProperty(value = "性别 1男  2女") | 
|---|
|  |  |  | private Long sex; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 住院号 | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiModelProperty("出院方式名称") | 
|---|
|  |  |  | @Excel(name = "出院方式名称") | 
|---|
|  |  |  | private String outWayName; | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 出入院标识 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ApiModelProperty("出入院标识:0入院  1出院  ") | 
|---|
|  |  |  | private Integer cry; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 出院病区编号 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ApiModelProperty(value = "出院病区编号集合") | 
|---|
|  |  |  | private List<String> leavehospitaldistrictcodes; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 出院科室代码集合 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ApiModelProperty(value = "出院科室代码集合") | 
|---|
|  |  |  | private List<String> leaveldeptcodes; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | private Long patid; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 子任务ID | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ApiModelProperty(value = "子任务ID") | 
|---|
|  |  |  | private Long subId; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 题目ID | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ApiModelProperty(value = "题目ID") | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.math.BigDecimal; | 
|---|
|  |  |  | import java.util.Date; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.fasterxml.jackson.annotation.JsonFormat; | 
|---|
|  |  |  | import io.swagger.annotations.ApiModel; | 
|---|
|  |  |  | 
|---|
|  |  |  | * 发送状态 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Excel(name = " 发送状态 ") | 
|---|
|  |  |  | @ApiModelProperty(value = "发送状态 1 被领取  2 待发送  3 已发送  4 不执行  5 发送失败") | 
|---|
|  |  |  | @ApiModelProperty(value = "发送状态 1 被领取  2 待发送  3 已发送  4 不执行  5 发送失败 6 已完成") | 
|---|
|  |  |  | private Long sendstate; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | 
|---|
|  |  |  | @Excel(name = " 出院病区名称 ") | 
|---|
|  |  |  | private String leavehospitaldistrictname; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 出院病区编号 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ApiModelProperty(value = "出院病区编号集合") | 
|---|
|  |  |  | private List<String> leavehospitaldistrictcodes; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 出院病区编号 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ApiModelProperty(value = "出院部门编号集合") | 
|---|
|  |  |  | private List<String> leaveldeptcodes; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiModelProperty(value = "子任务ID") | 
|---|
|  |  |  | private Long subId; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiModelProperty(value = "子任务ID") | 
|---|
|  |  |  | @ApiModelProperty(value = "任务ID") | 
|---|
|  |  |  | private Long taskid; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiModelProperty(value = "拨号uuid") | 
|---|
|  |  |  | 
|---|
|  |  |  | @Excel(name = "  部门code") | 
|---|
|  |  |  | @ApiModelProperty(value = "部门code") | 
|---|
|  |  |  | private String deptcode; | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 部门code | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Excel(name = "  部门code") | 
|---|
|  |  |  | @ApiModelProperty(value = "部门code集合") | 
|---|
|  |  |  | private List<String> leaveldeptcodes; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 标签状态 | 
|---|
|  |  |  | 
|---|
|  |  |  | private String leavehospitaldistrictcode; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 出院病区编号 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ApiModelProperty(value = "出院病区集合") | 
|---|
|  |  |  | private List<String> leavehospitaldistrictcodes; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 出院病区名称 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ApiModelProperty(value = "出院病区名称") | 
|---|
|  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 出院病区编号 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ApiModelProperty(value = "出院病区编号集合") | 
|---|
|  |  |  | @ApiModelProperty(value = "出院病区编号") | 
|---|
|  |  |  | private String leavehospitaldistrictcode; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 出院病区编号 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ApiModelProperty(value = "出院病区编号集合") | 
|---|
|  |  |  | private List<String> leavehospitaldistrictcodes; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 出院病区编号 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ApiModelProperty(value = "出院部门编号集合") | 
|---|
|  |  |  | private List<String> leaveldeptcodes; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 出院病区名称 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ApiModelProperty(value = "出院病区名称") | 
|---|
|  |  |  | 
|---|
|  |  |  | private String taskDesc; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * pageSize | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ApiModelProperty("是否是长期任务 0:不是    1:是") | 
|---|
|  |  |  | private Integer longTask; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | private Long taskid; | 
|---|
|  |  |  | 
|---|
|  |  |  | private String taskName; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 出院病区编号 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ApiModelProperty(value = "出院病区编号集合") | 
|---|
|  |  |  | private List<String> leavehospitaldistrictcodes; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 出院病区编号 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ApiModelProperty(value = "出院部门编号集合") | 
|---|
|  |  |  | private List<String> leaveldeptcodes; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Excel(name = "  ") | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiModelProperty(value = "自增ID") | 
|---|
|  |  |  | private Long svyid; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiModelProperty(value = "是否是长期模板:  0:不是    1:是") | 
|---|
|  |  |  | private Integer longTemp; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 问卷分类ID | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | 
|---|
|  |  |  | private Long islocal; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 是否启用 | 
|---|
|  |  |  | * 是否启用:  0 可用   1 停用 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ApiModelProperty(value = "是否启用") | 
|---|
|  |  |  | @Excel(name = " 是否启用 ") | 
|---|
|  |  |  | @ApiModelProperty(value = "是否启用:  0 可用   1 停用") | 
|---|
|  |  |  | @Excel(name = " 是否启用:  0 可用   1 停用 ") | 
|---|
|  |  |  | private String isenable = "0"; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiModelProperty(value = "问卷分类ID") | 
|---|
|  |  |  | private Long categoryid; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiModelProperty(value = "是否是长期模板:  0:不是    1:是") | 
|---|
|  |  |  | private Integer longTemp; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 问卷ID | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | 
|---|
|  |  |  | private Long islocal; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 是否启用 | 
|---|
|  |  |  | * 是否启用:  0 可用   1 停用 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Excel(name = " 是否启用 ") | 
|---|
|  |  |  | @ApiModelProperty(value = "是否启用") | 
|---|
|  |  |  | @Excel(name = " 是否启用:  0 可用   1 停用 ") | 
|---|
|  |  |  | @ApiModelProperty(value = "是否启用:  0 可用   1 停用") | 
|---|
|  |  |  | private String isenable; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiModelProperty(value = "主键") | 
|---|
|  |  |  | private Long id; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiModelProperty(value = "是否是长期模板:  0:不是    1:是") | 
|---|
|  |  |  | private Integer longTemp; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 模板问卷ID | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiModelProperty(value = "是否本地") | 
|---|
|  |  |  | private Long islocal; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiModelProperty(value = "出院天数(长期任务,出安院后,第几天发送信息)") | 
|---|
|  |  |  | private Integer sendDay; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 是否启用 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | 
|---|
|  |  |  | public int deletePatMedInhospByInhospid(Long inhospid); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 删除患者住院记录 | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param inhospno 患者住院编码 | 
|---|
|  |  |  | * @return 结果 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public int deletePatMedInhospByInhospno(String inhospno); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 批量删除患者住院记录 | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param inhospids 需要删除的数据主键集合 | 
|---|
|  |  |  | 
|---|
|  |  |  | * @return 结果 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public int updateServiceSubtaskDetail(ServiceSubtaskDetail serviceSubtaskDetail); | 
|---|
|  |  |  | public int updateSSDByCondition(ServiceSubtaskDetail serviceSubtaskDetail); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 删除语音任务呼叫明细 | 
|---|
|  |  |  | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public Boolean updateServiceSubtask(ServiceSubtask ServiceSubtask); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public Boolean updateServiceSubtaskByPatId(ServiceSubtask ServiceSubtask); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public Boolean updateServiceSubtaskByCondition(ServiceSubtask ServiceSubtask); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | 
|---|
|  |  |  | * @return 结果 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public int deleteSysUserDeptByIds(Long[] ids); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public int deleteSysUserDeptByCode(SysUserDept sysUserDept); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 查询当前登陆人自己(病区、部门)的患者住院记录列表 | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param patMedInhospVO | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public int deletePatMedInhospByInhospid(Long inhospid); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public int deletePatMedInhospByInhospno(String inhospno); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 处理从his取来的出院数据 | 
|---|
|  |  |  | * | 
|---|
|  |  |  | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public int updateServiceSubtaskDetail(ServiceSubtaskDetail serviceSubtaskDetail); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public int updateSSDByCondition(ServiceSubtaskDetail serviceSubtaskDetail); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 批量删除语音任务呼叫明细 | 
|---|
|  |  |  | * | 
|---|
|  |  |  | 
|---|
|  |  |  | import com.smartor.domain.ServiceSubtask; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  | import java.util.Map; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 单一任务(随访)Service接口 | 
|---|
|  |  |  | 
|---|
|  |  |  | * @param ivrTaskVO 单一任务 | 
|---|
|  |  |  | * @return 结果 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public int insertOrUpdateTask(ServiceTaskVO ivrTaskVO); | 
|---|
|  |  |  | public Map<String, Integer> insertOrUpdateTask(ServiceTaskVO ivrTaskVO); | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | 
|---|
|  |  |  | public int deletePatMedInhospByInhospid(Long inhospid) { | 
|---|
|  |  |  | return patMedInhospMapper.deletePatMedInhospByInhospid(inhospid); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 删除患者住院记录信息 | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param inhospno 患者住院编码 | 
|---|
|  |  |  | * @return 结果 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public int deletePatMedInhospByInhospno(String inhospno) { | 
|---|
|  |  |  | return patMedInhospMapper.deletePatMedInhospByInhospno(inhospno); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | 
|---|
|  |  |  | ServiceSubtask serviceSubtask = DtoConversionUtils.sourceToTarget(serviceTask, ServiceSubtask.class); | 
|---|
|  |  |  | serviceSubtask.setTaskid(serviceTask.getTaskid()); | 
|---|
|  |  |  | serviceSubtask.setLibtemplateid(stt.getTemplateid()); | 
|---|
|  |  |  | serviceSubtask.setNurseId(patMedInhosp1.getNurseId()); | 
|---|
|  |  |  | serviceSubtask.setNurseName(patMedInhosp1.getNurseName()); | 
|---|
|  |  |  | serviceSubtask.setDrcode(patMedInhosp1.getDrcode()); | 
|---|
|  |  |  | serviceSubtask.setDrname(patMedInhosp1.getDrname()); | 
|---|
|  |  |  | serviceSubtask.setDeptname(patMedInhosp1.getLeaveldeptname()); | 
|---|
|  |  |  | serviceSubtask.setTemplateid(stt.getId()); | 
|---|
|  |  |  | serviceSubtask.setTemplatename(stt.getSvyname()); | 
|---|
|  |  |  | serviceSubtask.setPatid(patArchive.getId()); | 
|---|
|  |  |  | serviceSubtask.setSendname(patArchive.getName()); | 
|---|
|  |  |  | serviceSubtask.setSfzh(patArchive.getIdcardno()); | 
|---|
|  |  |  | serviceSubtask.setPhone(patArchive.getTelcode()); | 
|---|
|  |  |  | serviceSubtask.setSex(patArchive.getSex()); | 
|---|
|  |  |  | serviceSubtask.setAge(patArchive.getAge()); | 
|---|
|  |  |  | serviceSubtask.setSendstate(2L); | 
|---|
|  |  |  | serviceSubtask.setStarttime(patMedInhosp1.getStarttime()); | 
|---|
|  |  |  | serviceSubtask.setEndtime(patMedInhosp1.getEndtime()); | 
|---|
|  |  |  | serviceSubtask.setServiceType("2"); | 
|---|
|  |  |  | serviceSubtask.setServiceform(serviceTask.getPreachform()); | 
|---|
|  |  |  | serviceSubtask.setHospType("2"); | 
|---|
|  |  |  | serviceSubtask.setLeavehospitaldistrictcode(patMedInhosp1.getLeavehospitaldistrictcode()); | 
|---|
|  |  |  | serviceSubtask.setLeavehospitaldistrictname(patMedInhosp1.getLeavehospitaldistrictname()); | 
|---|
|  |  |  | //设置发送时间 | 
|---|
|  |  |  | Date newDate = addDays(patMedInhosp1.getEndtime(), stt.getSendDay()); | 
|---|
|  |  |  | serviceSubtask.setLongSendTime(newDate); | 
|---|
|  |  |  | 
|---|
|  |  |  | serviceSubtask.setTaskid(tid); | 
|---|
|  |  |  | serviceSubtask.setPatid(pid); | 
|---|
|  |  |  | serviceSubtask.setSubmit(1L); | 
|---|
|  |  |  | serviceSubtask.setSendstate(6L); | 
|---|
|  |  |  | serviceSubtask.setExcep(serviceSubTaskAnswerReq.getExcep()); | 
|---|
|  |  |  | serviceSubtask.setFinishtime(new Date()); | 
|---|
|  |  |  | if (score != null) serviceSubtask.setScore(BigDecimal.valueOf(score)); | 
|---|
|  |  |  | 
|---|
|  |  |  | if (scriptInfoByCondition.get("type").equals("1")) { | 
|---|
|  |  |  | List<IvrLibaTemplateScriptVO> ivrLibaTemplateScriptVOList = (List) scriptInfoByCondition.get("script"); | 
|---|
|  |  |  | for (IvrLibaTemplateScriptVO ivrLibaTemplateScriptVO : ivrLibaTemplateScriptVOList) { | 
|---|
|  |  |  | String scriptResult = getScriptResult(serviceSubTaskQueryReq.getTaskid(), serviceSubTaskQueryReq.getPatid(), ivrLibaTemplateScriptVO.getId()); | 
|---|
|  |  |  | String scriptResult = getScriptResult(serviceSubTaskQueryReq.getSubId(), serviceSubTaskQueryReq.getPatid(), ivrLibaTemplateScriptVO.getId()); | 
|---|
|  |  |  | ivrLibaTemplateScriptVO.setScriptResult(scriptResult); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | map.put("scriptResult", ivrLibaTemplateScriptVOList); | 
|---|
|  |  |  | 
|---|
|  |  |  | } else if (scriptInfoByCondition.get("type").equals("2")) { | 
|---|
|  |  |  | List<SvyLibTemplateScriptVO> svyLibTemplateScriptVOList = (List) scriptInfoByCondition.get("script"); | 
|---|
|  |  |  | for (SvyLibTemplateScriptVO svyLibTemplateScriptVO : svyLibTemplateScriptVOList) { | 
|---|
|  |  |  | String scriptResult = getScriptResult(serviceSubTaskQueryReq.getTaskid(), serviceSubTaskQueryReq.getPatid(), svyLibTemplateScriptVO.getId()); | 
|---|
|  |  |  | String scriptResult = getScriptResult(serviceSubTaskQueryReq.getSubId(), serviceSubTaskQueryReq.getPatid(), svyLibTemplateScriptVO.getId()); | 
|---|
|  |  |  | svyLibTemplateScriptVO.setScriptResult(scriptResult); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | map.put("scriptResult", scriptInfoByCondition); | 
|---|
|  |  |  | 
|---|
|  |  |  | return null; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private String getScriptResult(Long tid, Long pid, Long sid) { | 
|---|
|  |  |  | private String getScriptResult(Long subid, Long pid, Long sid) { | 
|---|
|  |  |  | ServiceSubtaskDetail serviceSubtaskDetail = new ServiceSubtaskDetail(); | 
|---|
|  |  |  | serviceSubtaskDetail.setTaskid(tid); | 
|---|
|  |  |  | serviceSubtaskDetail.setSubId(subid); | 
|---|
|  |  |  | serviceSubtaskDetail.setPatid(pid); | 
|---|
|  |  |  | serviceSubtaskDetail.setScriptid(sid); | 
|---|
|  |  |  | List<ServiceSubtaskDetail> serviceSubtaskDetails = serviceSubtaskDetailMapper.selectServiceSubtaskDetailList(serviceSubtaskDetail); | 
|---|
|  |  |  | 
|---|
|  |  |  | return ServiceSubtaskDetailMapper.updateServiceSubtaskDetail(serviceSubtaskDetail); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public int updateSSDByCondition(ServiceSubtaskDetail serviceSubtaskDetail) { | 
|---|
|  |  |  | serviceSubtaskDetail.setUpdateTime(DateUtils.getNowDate()); | 
|---|
|  |  |  | return ServiceSubtaskDetailMapper.updateSSDByCondition(serviceSubtaskDetail); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 批量删除语音任务呼叫明细 | 
|---|
|  |  |  | * | 
|---|
|  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public List<ServiceTask> selectServiceTaskList(ServiceTask serviceTask) { | 
|---|
|  |  |  | //如果为0不置空,会影响到我的查询 | 
|---|
|  |  |  | if (CollectionUtils.isEmpty(serviceTask.getLeaveldeptcodes()) || serviceTask.getLeaveldeptcodes().size() == 0) | 
|---|
|  |  |  | serviceTask.setLeaveldeptcodes(null); | 
|---|
|  |  |  | if (CollectionUtils.isEmpty(serviceTask.getLeavehospitaldistrictcodes()) || serviceTask.getLeavehospitaldistrictcodes().size() == 0) | 
|---|
|  |  |  | serviceTask.setLeavehospitaldistrictcodes(null); | 
|---|
|  |  |  | return serviceTaskMapper.selectServiceTaskList(serviceTask); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | private List wjInfo(ServiceTask serviceTask, Long patid) { | 
|---|
|  |  |  | //用户点击了外链,就算他领取了 | 
|---|
|  |  |  | ServiceSubtask serviceSubtask = new ServiceSubtask(); | 
|---|
|  |  |  | serviceSubtask.setSendstate(1L); | 
|---|
|  |  |  | serviceSubtask.setPatid(patid); | 
|---|
|  |  |  | serviceSubtask.setTaskid(serviceTask.getTaskid()); | 
|---|
|  |  |  | serviceSubtaskMapper.updateServiceSubtaskByPatId(serviceSubtask); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //通过模板ID获取问题信息 | 
|---|
|  |  |  | SvyLibTemplateScript svyLibTemplateScript = new SvyLibTemplateScript(); | 
|---|
|  |  |  | svyLibTemplateScript.setSvyid(Long.valueOf(serviceTask.getLibtemplateid())); | 
|---|
|  |  |  | 
|---|
|  |  |  | <result property="assortid" column="assortid"/> | 
|---|
|  |  |  | <result property="parameter" column="parameter"/> | 
|---|
|  |  |  | <result property="version" column="version"/> | 
|---|
|  |  |  | <result property="usestate" column="usestate"/> | 
|---|
|  |  |  | <result property="isenable" column="isenable"/> | 
|---|
|  |  |  | <result property="campus" column="campus"/> | 
|---|
|  |  |  | <result property="tag" column="tag"/> | 
|---|
|  |  |  | <result property="suitway" column="suitway"/> | 
|---|
|  |  |  | 
|---|
|  |  |  | firstQuestionNum, | 
|---|
|  |  |  | version, | 
|---|
|  |  |  | silencetime, | 
|---|
|  |  |  | usestate, | 
|---|
|  |  |  | isenable, | 
|---|
|  |  |  | campus, | 
|---|
|  |  |  | tag, | 
|---|
|  |  |  | suitway, | 
|---|
|  |  |  | 
|---|
|  |  |  | <if test="templateName != null and templateName != ''">templateName,</if> | 
|---|
|  |  |  | <if test="version != null and version != ''">version,</if> | 
|---|
|  |  |  | <if test="campus != null and campus != ''">campus,</if> | 
|---|
|  |  |  | <if test="usestate != null and usestate != ''">usestate,</if> | 
|---|
|  |  |  | <if test="isenable != null and isenable != ''">isenable,</if> | 
|---|
|  |  |  | <if test="firstQuestionNum != null">firstQuestionNum,</if> | 
|---|
|  |  |  | <if test="submodule != null">submodule,</if> | 
|---|
|  |  |  | <if test="language != null and language != ''">language,</if> | 
|---|
|  |  |  | 
|---|
|  |  |  | <if test="templateName != null and templateName != ''">#{templateName},</if> | 
|---|
|  |  |  | <if test="version != null and version != ''">#{version},</if> | 
|---|
|  |  |  | <if test="campus != null and campus != ''">#{campus},</if> | 
|---|
|  |  |  | <if test="usestate != null and usestate != ''">#{usestate},</if> | 
|---|
|  |  |  | <if test="isenable != null and isenable != ''">#{isenable},</if> | 
|---|
|  |  |  | <if test="firstQuestionNum != null">#{firstQuestionNum},</if> | 
|---|
|  |  |  | <if test="submodule != null">#{submodule},</if> | 
|---|
|  |  |  | <if test="language != null and language != ''">#{language},</if> | 
|---|
|  |  |  | 
|---|
|  |  |  | <if test="templateName != null and templateName != ''">templateName = #{templateName},</if> | 
|---|
|  |  |  | <if test="version != null and version != ''">version = #{version},</if> | 
|---|
|  |  |  | <if test="campus != null and campus != ''">campus = #{campus},</if> | 
|---|
|  |  |  | <if test="usestate != null and usestate != ''">usestate = #{usestate},</if> | 
|---|
|  |  |  | <if test="isenable != null and isenable != ''">isenable = #{isenable},</if> | 
|---|
|  |  |  | <if test="firstQuestionNum != null">firstQuestionNum = #{firstQuestionNum},</if> | 
|---|
|  |  |  | <if test="submodule != null">submodule = #{submodule},</if> | 
|---|
|  |  |  | <if test="language != null and language != ''">language = #{language},</if> | 
|---|
|  |  |  | 
|---|
|  |  |  | <result property="inhospno" column="inhospno"/> | 
|---|
|  |  |  | <result property="nurseId" column="nurse_id"/> | 
|---|
|  |  |  | <result property="nurseName" column="nurse_name"/> | 
|---|
|  |  |  | <result property="outWayName" column="out_way_name"/> | 
|---|
|  |  |  | <result property="outWayId" column="out_way_id"/> | 
|---|
|  |  |  | <result property="leavehospitaldistrictname" column="leavehospitaldistrictname"/> | 
|---|
|  |  |  | <result property="leavehospitaldistrictcode" column="leavehospitaldistrictcode"/> | 
|---|
|  |  |  | </resultMap> | 
|---|
|  |  |  | 
|---|
|  |  |  | (#{item.name},#{item.viptype},#{item.sex},#{item.idcardno},#{item.birthdate},#{item.placeOfResidence},#{item.age},#{item.sourcefrom},#{item.archivetime},#{item.archiveby} | 
|---|
|  |  |  | ,#{item.telcode},#{item.archiveby},#{item.idcardtype},#{item.orgid},#{item.openid},#{item.dduserid},#{item.updateBy}, | 
|---|
|  |  |  | #{item.updateTime},#{item.createBy},#{item.createTime},#{item.isupload},#{item.uploadTime},#{item.pattype},#{item.nation},#{item.birthplace},#{item.nativePlace},#{item.patientno},#{item.patidHis},#{item.sdFlag},#{item.ageUnit},#{item.notrequiredFlag},#{item.notrequiredreason} | 
|---|
|  |  |  | ) | 
|---|
|  |  |  | </foreach> | 
|---|
|  |  |  | </insert> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | a.del_flag = 0 | 
|---|
|  |  |  | <if test="name != null  and name != ''">and a.name like concat('%', #{name}, '%')</if> | 
|---|
|  |  |  | <if test="idcardno != null  and idcardno != ''">and a.idcardno = #{idcardno}</if> | 
|---|
|  |  |  | <if test="notrequiredFlag != null  and notrequiredFlag != ''">and a.notrequired_flag = #{notrequiredFlag} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="pid != null  and pid != ''">and a.id = #{pid}</if> | 
|---|
|  |  |  | <if test="telcode != null  and telcode != ''">and a.telcode = #{telcode}</if> | 
|---|
|  |  |  | <if test="tagIds != null  and tagIds != ''">and b.tagid in | 
|---|
|  |  |  | 
|---|
|  |  |  | d.nurse_name, | 
|---|
|  |  |  | d.nurse_id, | 
|---|
|  |  |  | d.endtime, | 
|---|
|  |  |  | d.out_way_id, | 
|---|
|  |  |  | d.leavehospitaldistrictname AS leavehospitaldistrictname, | 
|---|
|  |  |  | d.leavehospitaldistrictcode AS leavehospitaldistrictcode, | 
|---|
|  |  |  | t.tagname | 
|---|
|  |  |  | 
|---|
|  |  |  | <if test="idcardno != null  and idcardno != ''">and a.idcardno = #{idcardno}</if> | 
|---|
|  |  |  | <if test="pid != null  and pid != ''">and a.id = #{id}</if> | 
|---|
|  |  |  | <if test="telcode != null  and telcode != ''">and a.telcode = #{telcode}</if> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <if test="notrequiredFlag != null  and notrequiredFlag != ''">and a.notrequired_flag = #{notrequiredFlag} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="hospitalname != null and hospitalname != ''"> | 
|---|
|  |  |  | AND d.hospitalname = #{hospitalname} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | 
|---|
|  |  |  | AND d.deptname LIKE concat('%',#{deptname}, '%') | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="leavehospitaldistrictcodes != null and leaveldeptcodes != null"> | 
|---|
|  |  |  | AND d.leavehospitaldistrictcode IN | 
|---|
|  |  |  | AND (d.leavehospitaldistrictcode IN | 
|---|
|  |  |  | <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator="," | 
|---|
|  |  |  | close=")"> | 
|---|
|  |  |  | #{leavehospitaldistrictcode} | 
|---|
|  |  |  | </foreach> | 
|---|
|  |  |  | OR d.leaveldeptcode IN | 
|---|
|  |  |  | <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator="," | 
|---|
|  |  |  | close=")"> | 
|---|
|  |  |  | close="))"> | 
|---|
|  |  |  | #{leaveldeptcode} | 
|---|
|  |  |  | </foreach> | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | 
|---|
|  |  |  | <if test="telcode != null  and telcode != ''">and a.telcode = #{telcode}</if> | 
|---|
|  |  |  | <if test="hospitaldistrictname != null and hospitaldistrictname != ''"> | 
|---|
|  |  |  | AND d.hospitaldistrictname LIKE concat('%',#{hospitaldistrictname}, '%') | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="notrequiredFlag != null  and notrequiredFlag != ''">and a.notrequired_flag = #{notrequiredFlag} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="diagname != null and diagname != ''"> | 
|---|
|  |  |  | AND d.diagname LIKE concat('%',#{diagname}, '%') | 
|---|
|  |  |  | 
|---|
|  |  |  | <if test="diagname != null and diagname != ''"> | 
|---|
|  |  |  | AND d.diagname LIKE concat('%',#{diagname}, '%') | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="notrequiredFlag != null  and notrequiredFlag != ''">and a.notrequired_flag = #{notrequiredFlag} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="hospitalname != null and hospitalname != ''"> | 
|---|
|  |  |  | AND d.hospitalname = #{hospitalname} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | 
|---|
|  |  |  | <result property="inhospstate" column="inhospstate"/> | 
|---|
|  |  |  | <result property="checkFlag" column="check_flag"/> | 
|---|
|  |  |  | <result property="age" column="age"/> | 
|---|
|  |  |  | <result property="sex" column="sex"/> | 
|---|
|  |  |  | <result property="telcode" column="telcode"/> | 
|---|
|  |  |  | <result property="longTaskReason" column="long_task_reason"/> | 
|---|
|  |  |  | <result property="nurseId" column="nurse_id"/> | 
|---|
|  |  |  | 
|---|
|  |  |  | <select id="selectPatMedInhospList" parameterType="com.smartor.domain.PatMedInhosp" resultMap="PatMedInhospResult"> | 
|---|
|  |  |  | select CONCAT( a.age, a.age_unit ) AS age, | 
|---|
|  |  |  | a.telcode as telcode, | 
|---|
|  |  |  | a.sex, | 
|---|
|  |  |  | b.inhospid, | 
|---|
|  |  |  | b.nurse_id, | 
|---|
|  |  |  | b.nurse_name, | 
|---|
|  |  |  | 
|---|
|  |  |  | concat('%', #{hospitaldistrictname}, '%') | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="endtime != null ">and b.endtime = #{endtime}</if> | 
|---|
|  |  |  | <if test="inhospno != null ">and b.inhospno = #{inhospno}</if> | 
|---|
|  |  |  | <if test="serialnum != null ">and b.serialnum = #{serialnum}</if> | 
|---|
|  |  |  | <if test="endtime != null ">and b.endtime = #{endtime}</if> | 
|---|
|  |  |  | <if test="patno != null ">and b.patno = #{patno}</if> | 
|---|
|  |  |  | <if test="nurseId != null ">and b.nurse_id = #{nurseId}</if> | 
|---|
|  |  |  | <if test="nurseName != null ">and b.nurse_name = #{nurseName}</if> | 
|---|
|  |  |  | <if test="checkFlag != null ">and b.check_flag = #{checkFlag}</if> | 
|---|
|  |  |  | <if test="cry != null and cry == 0 ">and b.endtime is null</if> | 
|---|
|  |  |  | <if test="cry != null and cry == 1 ">and b.endtime is not null</if> | 
|---|
|  |  |  | <if test="inhospstate != null ">and b.inhospstate = #{inhospstate}</if> | 
|---|
|  |  |  | <if test="schemestatus != null ">and b.schemestatus = #{schemestatus}</if> | 
|---|
|  |  |  | <if test="outWayId != null ">and b.out_way_id = #{outWayId}</if> | 
|---|
|  |  |  | 
|---|
|  |  |  | <if test="leaveldeptname != null  and leaveldeptname != ''">and b.leaveldeptname like concat('%', | 
|---|
|  |  |  | #{leaveldeptname}, '%') | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="patid != null  and patid != ''">and a.id =#{patid} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="leavehospitaldistrictname != null  and leavehospitaldistrictname != ''">and | 
|---|
|  |  |  | b.leavehospitaldistrictname like concat('%', #{leavehospitaldistrictname}, '%') | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="leavehospitaldistrictcodes != null and leaveldeptcodes != null"> | 
|---|
|  |  |  | AND (b.leavehospitaldistrictcode IN | 
|---|
|  |  |  | <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator="," | 
|---|
|  |  |  | close=")"> | 
|---|
|  |  |  | #{leavehospitaldistrictcode} | 
|---|
|  |  |  | </foreach> | 
|---|
|  |  |  | OR b.leaveldeptcode IN | 
|---|
|  |  |  | <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator="," | 
|---|
|  |  |  | close="))"> | 
|---|
|  |  |  | #{leaveldeptcode} | 
|---|
|  |  |  | </foreach> | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="leavehospitaldistrictcodes != null and leaveldeptcodes == null"> | 
|---|
|  |  |  | AND b.leavehospitaldistrictcode IN | 
|---|
|  |  |  | <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator="," | 
|---|
|  |  |  | close=")"> | 
|---|
|  |  |  | #{leavehospitaldistrictcode} | 
|---|
|  |  |  | </foreach> | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="leavehospitaldistrictcodes == null and leaveldeptcodes != null"> | 
|---|
|  |  |  | AND b.leaveldeptcode IN | 
|---|
|  |  |  | <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator="," | 
|---|
|  |  |  | close=")"> | 
|---|
|  |  |  | #{leaveldeptcode} | 
|---|
|  |  |  | </foreach> | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | </where> | 
|---|
|  |  |  | order by b.inhospid desc | 
|---|
|  |  |  | 
|---|
|  |  |  | #{leavediagname}, '%') | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="drname != null  and drname != ''">and b.drname like concat('%', #{drname}, '%')</if> | 
|---|
|  |  |  | <if test="leavehospitaldistrictcodes != null"> | 
|---|
|  |  |  | <if test="leavehospitaldistrictcodes != null and leaveldeptcodes != null"> | 
|---|
|  |  |  | AND (b.leavehospitaldistrictcode IN | 
|---|
|  |  |  | <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator="," | 
|---|
|  |  |  | close=")"> | 
|---|
|  |  |  | #{leavehospitaldistrictcode} | 
|---|
|  |  |  | </foreach> | 
|---|
|  |  |  | OR b.leaveldeptcode IN | 
|---|
|  |  |  | <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator="," | 
|---|
|  |  |  | close="))"> | 
|---|
|  |  |  | #{leaveldeptcode} | 
|---|
|  |  |  | </foreach> | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="leavehospitaldistrictcodes != null and leaveldeptcodes == null"> | 
|---|
|  |  |  | AND b.leavehospitaldistrictcode IN | 
|---|
|  |  |  | <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator="," | 
|---|
|  |  |  | close=")"> | 
|---|
|  |  |  | #{leavehospitaldistrictcode} | 
|---|
|  |  |  | </foreach> | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="leaveldeptcodes != null"> | 
|---|
|  |  |  | <if test="leavehospitaldistrictcodes == null and leaveldeptcodes != null"> | 
|---|
|  |  |  | AND b.leaveldeptcode IN | 
|---|
|  |  |  | <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator="," | 
|---|
|  |  |  | close=")"> | 
|---|
|  |  |  | 
|---|
|  |  |  | </update> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <delete id="deletePatMedInhospByInhospid" parameterType="Long"> | 
|---|
|  |  |  | delete | 
|---|
|  |  |  | from pat_med_inhosp | 
|---|
|  |  |  | update pat_med_inhosp | 
|---|
|  |  |  | <trim prefix="SET" suffixOverrides=","> | 
|---|
|  |  |  | del_flag =1 | 
|---|
|  |  |  | </trim> | 
|---|
|  |  |  | where inhospid = #{inhospid} | 
|---|
|  |  |  | </delete> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <delete id="deletePatMedInhospByInhospno" parameterType="String"> | 
|---|
|  |  |  | update pat_med_inhosp | 
|---|
|  |  |  | <trim prefix="SET" suffixOverrides=","> | 
|---|
|  |  |  | del_flag =1 | 
|---|
|  |  |  | </trim> | 
|---|
|  |  |  | where inhospno = #{inhospno} | 
|---|
|  |  |  | </delete> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <delete id="deletePatMedInhospByInhospids" parameterType="String"> | 
|---|
|  |  |  | delete from pat_med_inhosp where inhospid in | 
|---|
|  |  |  | <foreach item="inhospid" collection="array" open="(" separator="," close=")"> | 
|---|
|  |  |  | 
|---|
|  |  |  | where id = #{id} | 
|---|
|  |  |  | </update> | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <update id="updateSSDByCondition" parameterType="com.smartor.domain.ServiceSubtaskDetail"> | 
|---|
|  |  |  | update service_subtask_detail | 
|---|
|  |  |  | <trim prefix="SET" suffixOverrides=","> | 
|---|
|  |  |  | <if test="subId != null">sub_id = #{subId},</if> | 
|---|
|  |  |  | <if test="taskid != null">taskid = #{taskid},</if> | 
|---|
|  |  |  | <if test="uuid != null">uuid = #{uuid},</if> | 
|---|
|  |  |  | <if test="phone != null">phone = #{phone},</if> | 
|---|
|  |  |  | <if test="operate != null">operate = #{operate},</if> | 
|---|
|  |  |  | <if test="displayno != null">displayno = #{displayno},</if> | 
|---|
|  |  |  | <if test="inbound != null">inbound = #{inbound},</if> | 
|---|
|  |  |  | <if test="incoming != null">incoming = #{incoming},</if> | 
|---|
|  |  |  | <if test="assigntime != null">assigntime = #{assigntime},</if> | 
|---|
|  |  |  | <if test="starttime != null">starttime = #{starttime},</if> | 
|---|
|  |  |  | <if test="answertime != null">answertime = #{answertime},</if> | 
|---|
|  |  |  | <if test="silent != null">silent = #{silent},</if> | 
|---|
|  |  |  | <if test="dtmfKey != null">dtmf_key = #{dtmfKey},</if> | 
|---|
|  |  |  | <if test="musicpath != null">musicpath = #{musicpath},</if> | 
|---|
|  |  |  | <if test="sentIndex != null">sent_index = #{sentIndex},</if> | 
|---|
|  |  |  | <if test="sentBegin != null">sent_begin = #{sentBegin},</if> | 
|---|
|  |  |  | <if test="asrtext != null">asrtext = #{asrtext},</if> | 
|---|
|  |  |  | <if test="beginTime != null">begin_time = #{beginTime},</if> | 
|---|
|  |  |  | <if test="endTime != null">end_time = #{endTime},</if> | 
|---|
|  |  |  | <if test="sentEnd != null">sent_end = #{sentEnd},</if> | 
|---|
|  |  |  | <if test="recordpath != null">recordpath = #{recordpath},</if> | 
|---|
|  |  |  | <if test="recordurl != null">recordurl = #{recordurl},</if> | 
|---|
|  |  |  | <if test="templateid != null">templateid = #{templateid},</if> | 
|---|
|  |  |  | <if test="templatequestionnum != null">templatequestionnum = #{templatequestionnum},</if> | 
|---|
|  |  |  | <if test="switchid != null">switchid = #{switchid},</if> | 
|---|
|  |  |  | <if test="questiontext != null">questiontext = #{questiontext},</if> | 
|---|
|  |  |  | <if test="questionvoice != null">questionvoice = #{questionvoice},</if> | 
|---|
|  |  |  | <if test="categoryname != null">categoryname = #{categoryname},</if> | 
|---|
|  |  |  | <if test="targetoptions != null">targetoptions = #{targetoptions},</if> | 
|---|
|  |  |  | <if test="targetvalue != null">targetvalue = #{targetvalue},</if> | 
|---|
|  |  |  | <if test="matchedtext != null">matchedtext = #{matchedtext},</if> | 
|---|
|  |  |  | <if test="addtime != null">addtime = #{addtime},</if> | 
|---|
|  |  |  | <if test="isupload != null">isupload = #{isupload},</if> | 
|---|
|  |  |  | <if test="uploadTime != null">upload_time = #{uploadTime},</if> | 
|---|
|  |  |  | <if test="orgid != null">orgid = #{orgid},</if> | 
|---|
|  |  |  | <if test="createTime != null">create_time = #{createTime},</if> | 
|---|
|  |  |  | <if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if> | 
|---|
|  |  |  | <if test="updateBy != null">update_by = #{updateBy},</if> | 
|---|
|  |  |  | <if test="updateTime != null">update_time = #{updateTime},</if> | 
|---|
|  |  |  | <if test="createBy != null">create_by = #{createBy},</if> | 
|---|
|  |  |  | <if test="valueType != null">value_type = #{valueType},</if> | 
|---|
|  |  |  | <if test="answerps != null  and answerps != ''">answerps = #{answerps},</if> | 
|---|
|  |  |  | <if test="comment != null  and comment != ''">comment = #{comment},</if> | 
|---|
|  |  |  | <if test="scriptid != null ">scriptid = #{scriptid},</if> | 
|---|
|  |  |  | <if test=" patid != null">patid = #{patid},</if> | 
|---|
|  |  |  | </trim> | 
|---|
|  |  |  | where patid = #{patid} and scriptid = #{scriptid} and sub_id = #{subId} | 
|---|
|  |  |  | </update> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <delete id="deleteServiceSubtaskDetailByCalldetailid" parameterType="String"> | 
|---|
|  |  |  | delete | 
|---|
|  |  |  | from service_subtask_detail | 
|---|
|  |  |  | 
|---|
|  |  |  | <if test="templatename != null  and templatename != ''">and templatename like concat('%', #{templatename}, | 
|---|
|  |  |  | '%') | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="leavehospitaldistrictcodes != null and leaveldeptcodes != null"> | 
|---|
|  |  |  | AND leavehospitaldistrictcode IN | 
|---|
|  |  |  | <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator="," | 
|---|
|  |  |  | close=")"> | 
|---|
|  |  |  | #{leavehospitaldistrictcode} | 
|---|
|  |  |  | </foreach> | 
|---|
|  |  |  | OR deptcode IN | 
|---|
|  |  |  | <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator="," | 
|---|
|  |  |  | close=")"> | 
|---|
|  |  |  | #{leaveldeptcode} | 
|---|
|  |  |  | </foreach> | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="leavehospitaldistrictcodes != null and leaveldeptcodes == null"> | 
|---|
|  |  |  | AND leavehospitaldistrictcode IN | 
|---|
|  |  |  | <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator="," | 
|---|
|  |  |  | close=")"> | 
|---|
|  |  |  | #{leavehospitaldistrictcode} | 
|---|
|  |  |  | </foreach> | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="leavehospitaldistrictcodes == null and leaveldeptcodes != null"> | 
|---|
|  |  |  | AND deptcode IN | 
|---|
|  |  |  | <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator="," | 
|---|
|  |  |  | close=")"> | 
|---|
|  |  |  | #{leaveldeptcode} | 
|---|
|  |  |  | </foreach> | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <if test="senddate != null ">and senddate = #{senddate}</if> | 
|---|
|  |  |  | <if test="senduuid != null  and senduuid != ''">and senduuid = #{senduuid}</if> | 
|---|
|  |  |  | <if test="result != null  and result != ''">and result = #{result}</if> | 
|---|
|  |  |  | 
|---|
|  |  |  | <if test="excep != null ">and excep = #{excep}</if> | 
|---|
|  |  |  | <if test="nurseId != null ">and nurse_id = #{nurseId}</if> | 
|---|
|  |  |  | <if test="nurseName != null ">and nurse_name = #{nurseName}</if> | 
|---|
|  |  |  | <if test="leavehospitaldistrictcode != null ">and leavehospitaldistrictcode = #{leavehospitaldistrictcode} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="leavehospitaldistrictname != null ">and leavehospitaldistrictname = #{leavehospitaldistrictname} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="score != null">and score = #{score}</if> | 
|---|
|  |  |  | <if test="remark != null">and remark = #{remark}</if> | 
|---|
|  |  |  | <if test="suggest != null">and suggest = #{suggest}</if> | 
|---|
|  |  |  | 
|---|
|  |  |  | where id = #{id} | 
|---|
|  |  |  | </update> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <update id="updateServiceSubtaskByPatId" parameterType="com.smartor.domain.ServiceSubtask"> | 
|---|
|  |  |  | update service_subtask | 
|---|
|  |  |  | <trim prefix="SET" suffixOverrides=","> | 
|---|
|  |  |  | <if test="sendname != null">sendname = #{sendname},</if> | 
|---|
|  |  |  | <if test="phone != null">phone = #{phone},</if> | 
|---|
|  |  |  | <if test="sex != null">sex = #{sex},</if> | 
|---|
|  |  |  | <if test="age != null">age = #{age},</if> | 
|---|
|  |  |  | <if test="sfzh != null">sfzh = #{sfzh},</if> | 
|---|
|  |  |  | <if test="addr != null">addr = #{addr},</if> | 
|---|
|  |  |  | <if test="senderdetail != null">senderdetail = #{senderdetail},</if> | 
|---|
|  |  |  | <if test="type != null">type = #{type},</if> | 
|---|
|  |  |  | <if test="taskid != null">taskid = #{taskid},</if> | 
|---|
|  |  |  | <if test="templateid != null">templateid = #{templateid},</if> | 
|---|
|  |  |  | <if test="templatename != null">templatename = #{templatename},</if> | 
|---|
|  |  |  | <if test="senddate != null">senddate = #{senddate},</if> | 
|---|
|  |  |  | <if test="senduuid != null">senduuid = #{senduuid},</if> | 
|---|
|  |  |  | <if test="result != null">result = #{result},</if> | 
|---|
|  |  |  | <if test="finishtime != null">finishtime = #{finishtime},</if> | 
|---|
|  |  |  | <if test="recordid != null">recordid = #{recordid},</if> | 
|---|
|  |  |  | <if test="exrecallcount != null">exrecallcount = #{exrecallcount},</if> | 
|---|
|  |  |  | <if test="pulltime != null">pulltime = #{pulltime},</if> | 
|---|
|  |  |  | <if test="deptcode != null">deptcode = #{deptcode},</if> | 
|---|
|  |  |  | <if test="labelstatus != null">labelstatus = #{labelstatus},</if> | 
|---|
|  |  |  | <if test="updateBy != null">update_by = #{updateBy},</if> | 
|---|
|  |  |  | <if test="updateTime != null">update_time = #{updateTime},</if> | 
|---|
|  |  |  | <if test="createBy != null">create_by = #{createBy},</if> | 
|---|
|  |  |  | <if test="createTime != null">create_time = #{createTime},</if> | 
|---|
|  |  |  | <if test="isupload != null">isupload = #{isupload},</if> | 
|---|
|  |  |  | <if test="uploadTime != null">upload_time = #{uploadTime},</if> | 
|---|
|  |  |  | <if test="orgid != null">orgid = #{orgid},</if> | 
|---|
|  |  |  | <if test="pid != null">pid = #{pid},</if> | 
|---|
|  |  |  | <if test="guid != null">guid = #{guid},</if> | 
|---|
|  |  |  | <if test="textParam != null">text_param = #{textParam},</if> | 
|---|
|  |  |  | <if test="serviceform != null">serviceform = #{serviceform},</if> | 
|---|
|  |  |  | <if test="bedNo != null">bed_no = #{bedNo},</if> | 
|---|
|  |  |  | <if test="sendType != null  and sendType != ''">send_type = #{sendType},</if> | 
|---|
|  |  |  | <if test="taskName != null  and taskName != ''">task_name = #{taskName},</if> | 
|---|
|  |  |  | <if test="taskDesc != null  and taskDesc != ''">task_desc = #{taskDesc},</if> | 
|---|
|  |  |  | <if test="operatorNo != null  and operatorNo != ''">operator_no = #{operatorNo},</if> | 
|---|
|  |  |  | <if test="operator != null  and operator != ''">operator = #{operator},</if> | 
|---|
|  |  |  | <if test="hospType != null  and hospType != ''">hosp_type = #{hospType},</if> | 
|---|
|  |  |  | <if test="hospno != null  and hospno != ''">hospno = #{hospno},</if> | 
|---|
|  |  |  | <if test="wechat != null  and wechat != ''">wechat = #{wechat},</if> | 
|---|
|  |  |  | <if test="roomno != null  and roomno != ''">roomno = #{roomno},</if> | 
|---|
|  |  |  | <if test="admindate != null  and admindate != ''">admindate = #{admindate},</if> | 
|---|
|  |  |  | <if test="deptname != null  and deptname != ''">deptname = #{deptname},</if> | 
|---|
|  |  |  | <if test="diagname != null  and diagname != ''">diagname = #{diagname},</if> | 
|---|
|  |  |  | <if test="libtemplateid != null ">libtemplateid = #{libtemplateid},</if> | 
|---|
|  |  |  | <if test="libtemplatename != null ">libtemplatename = #{libtemplatename},</if> | 
|---|
|  |  |  | <if test="patid != null ">patid = #{patid},</if> | 
|---|
|  |  |  | <if test="openid != null ">openid = #{openid},</if> | 
|---|
|  |  |  | <if test="longSendTime != null ">long_send_time = #{longSendTime},</if> | 
|---|
|  |  |  | <if test="sendstate != null ">sendstate = #{sendstate},</if> | 
|---|
|  |  |  | <if test="serviceType != null ">service_type = #{serviceType},</if> | 
|---|
|  |  |  | <if test="score != null ">score = #{score},</if> | 
|---|
|  |  |  | <if test="submit != null ">submit = #{submit},</if> | 
|---|
|  |  |  | <if test="leavehospitaldistrictcode != null  and leavehospitaldistrictcode != ''">leavehospitaldistrictcode | 
|---|
|  |  |  | = #{leavehospitaldistrictcode}, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="leavehospitaldistrictname != null  and leavehospitaldistrictname != ''">leavehospitaldistrictname | 
|---|
|  |  |  | = #{leavehospitaldistrictname}, | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="drname != null ">drname = #{drname},</if> | 
|---|
|  |  |  | <if test="drcode != null ">drcode = #{drcode},</if> | 
|---|
|  |  |  | <if test="starttime != null ">starttime = #{starttime},</if> | 
|---|
|  |  |  | <if test="endtime != null ">endtime = #{endtime},</if> | 
|---|
|  |  |  | <if test="excep != null ">excep = #{excep},</if> | 
|---|
|  |  |  | <if test="nurseName != null ">nurse_name=#{nurseName},</if> | 
|---|
|  |  |  | <if test="nurseId != null ">nurse_id=#{nurseId},</if> | 
|---|
|  |  |  | <if test="remark != null ">remark=#{remark},</if> | 
|---|
|  |  |  | <if test="suggest != null ">suggest=#{suggest},</if> | 
|---|
|  |  |  | </trim> | 
|---|
|  |  |  | where patid = #{patid} and taskid = #{taskid} | 
|---|
|  |  |  | </update> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <update id="updateServiceSubtaskByCondition" parameterType="com.smartor.domain.ServiceSubtask"> | 
|---|
|  |  |  | update service_subtask | 
|---|
|  |  |  | <trim prefix="SET" suffixOverrides=","> | 
|---|
|  |  |  | 
|---|
|  |  |  | <if test="sendState != null  ">and send_state = #{sendState}</if> | 
|---|
|  |  |  | <if test="leavehospitaldistrictname != null  ">and leavehospitaldistrictname = #{leavehospitaldistrictname}</if> | 
|---|
|  |  |  | <if test="leavehospitaldistrictcode != null  ">and leavehospitaldistrictcode = #{leavehospitaldistrictcode}</if> | 
|---|
|  |  |  | <if test="leavehospitaldistrictcodes != null and leaveldeptcodes != null"> | 
|---|
|  |  |  | AND (leavehospitaldistrictcode IN | 
|---|
|  |  |  | <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator="," | 
|---|
|  |  |  | close=")"> | 
|---|
|  |  |  | #{leavehospitaldistrictcode} | 
|---|
|  |  |  | </foreach> | 
|---|
|  |  |  | OR deptcode IN | 
|---|
|  |  |  | <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator="," | 
|---|
|  |  |  | close="))"> | 
|---|
|  |  |  | #{leaveldeptcode} | 
|---|
|  |  |  | </foreach> | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="leavehospitaldistrictcodes != null and leaveldeptcodes == null"> | 
|---|
|  |  |  | AND leavehospitaldistrictcode IN | 
|---|
|  |  |  | <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator="," | 
|---|
|  |  |  | close=")"> | 
|---|
|  |  |  | #{leavehospitaldistrictcode} | 
|---|
|  |  |  | </foreach> | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="leavehospitaldistrictcodes == null and leaveldeptcodes != null"> | 
|---|
|  |  |  | AND deptcode IN | 
|---|
|  |  |  | <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator="," | 
|---|
|  |  |  | close=")"> | 
|---|
|  |  |  | #{leaveldeptcode} | 
|---|
|  |  |  | </foreach> | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </where> | 
|---|
|  |  |  | order by update_time desc,taskid desc | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  | 
|---|
|  |  |  | <result property="prologue" column="prologue"/> | 
|---|
|  |  |  | <result property="instruction" column="instruction"/> | 
|---|
|  |  |  | <result property="conclusion" column="conclusion"/> | 
|---|
|  |  |  | <result property="longTemp" column="long_temp"/> | 
|---|
|  |  |  | </resultMap> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <sql id="selectSvyLibTemplateVo"> | 
|---|
|  |  |  | select svyid, | 
|---|
|  |  |  | categoryid, | 
|---|
|  |  |  | long_temp, | 
|---|
|  |  |  | instruction, | 
|---|
|  |  |  | prologue, | 
|---|
|  |  |  | conclusion, | 
|---|
|  |  |  | 
|---|
|  |  |  | resultMap="SvyLibTemplateResult"> | 
|---|
|  |  |  | SELECT | 
|---|
|  |  |  | a.svyid, | 
|---|
|  |  |  | a.long_temp, | 
|---|
|  |  |  | a.conclusion, | 
|---|
|  |  |  | a.instruction, | 
|---|
|  |  |  | a.prologue, | 
|---|
|  |  |  | 
|---|
|  |  |  | a.del_flag=0 | 
|---|
|  |  |  | <if test="categoryid != null ">and a.categoryid = #{categoryid}</if> | 
|---|
|  |  |  | <if test="svyid != null ">and a.svyid = #{svyid}</if> | 
|---|
|  |  |  | <if test="longTemp != null ">and a.long_temp = #{longTemp}</if> | 
|---|
|  |  |  | <if test="svyname != null  and svyname != ''">and a.svyname like concat('%', #{svyname}, '%')</if> | 
|---|
|  |  |  | <if test="description != null  and description != ''">and b.icd10name like concat('%', #{description}, '%') | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | 
|---|
|  |  |  | <if test="conclusion != null">conclusion,</if> | 
|---|
|  |  |  | <if test="instruction != null">instruction,</if> | 
|---|
|  |  |  | <if test="prologue != null">prologue,</if> | 
|---|
|  |  |  | <if test="longTemp != null ">long_temp,</if> | 
|---|
|  |  |  | </trim> | 
|---|
|  |  |  | <trim prefix="values (" suffix=")" suffixOverrides=","> | 
|---|
|  |  |  | <if test="categoryid != null">#{categoryid},</if> | 
|---|
|  |  |  | 
|---|
|  |  |  | <if test="conclusion != null">#{conclusion},</if> | 
|---|
|  |  |  | <if test="instruction != null">#{instruction},</if> | 
|---|
|  |  |  | <if test="prologue != null">#{prologue},</if> | 
|---|
|  |  |  | <if test="longTemp != null ">#{longTemp},</if> | 
|---|
|  |  |  | </trim> | 
|---|
|  |  |  | </insert> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | <if test="conclusion != null">conclusion=#{conclusion},</if> | 
|---|
|  |  |  | <if test="instruction != null">instruction=#{instruction},</if> | 
|---|
|  |  |  | <if test="prologue != null">prologue=#{prologue},</if> | 
|---|
|  |  |  | <if test="longTemp != null ">long_temp = #{longTemp},</if> | 
|---|
|  |  |  | </trim> | 
|---|
|  |  |  | where svyid = #{svyid} | 
|---|
|  |  |  | </update> | 
|---|
|  |  |  | 
|---|
|  |  |  | resultMap="SysUserDeptResult"> | 
|---|
|  |  |  | <include refid="selectSysUserDeptVo"/> | 
|---|
|  |  |  | <where> | 
|---|
|  |  |  | del_flag=0 | 
|---|
|  |  |  | <if test="userId != null "> | 
|---|
|  |  |  | and user_id = #{userId} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="updateTime != null "> | 
|---|
|  |  |  | and update_time = #{updateTime} | 
|---|
|  |  |  | </if> <if test="deptType != null "> | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="deptType != null "> | 
|---|
|  |  |  | and dept_type = #{deptType} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="deptCode != null "> | 
|---|
|  |  |  | and dept_code = #{deptCode} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | </where> | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  | 
|---|
|  |  |  | </update> | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <update id="deleteSysUserDeptByCode" parameterType="String"> | 
|---|
|  |  |  | update sys_user_dept | 
|---|
|  |  |  | <trim prefix="SET" suffixOverrides=","> | 
|---|
|  |  |  | del_flag =1, | 
|---|
|  |  |  | update_time = sysdate() | 
|---|
|  |  |  | </trim> | 
|---|
|  |  |  | where user_id =#{userId} and dept_code=#{deptCode} | 
|---|
|  |  |  | </update> | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </mapper> | 
|---|
|  |  |  | 
|---|
|  |  |  | resultMap="TemplateDeptResult"> | 
|---|
|  |  |  | <include refid="selectTemplateDeptVo"/> | 
|---|
|  |  |  | <where> | 
|---|
|  |  |  | del_flag=0 | 
|---|
|  |  |  | <if test="type != null "> | 
|---|
|  |  |  | and type = #{type} | 
|---|
|  |  |  | </if> | 
|---|