1.满意度导出BUG处理
2.三汇电话接口部分
3.外链可以通过subid查询到
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.smartor; |
| | | |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.smartor.domain.OutboundConfigAddReqVO; |
| | | import com.smartor.domain.OutboundInstanceResVO; |
| | | import com.smartor.domain.PhoneCallBackSHVO; |
| | | import com.smartor.domain.PhoneCallReqYQVO; |
| | | import com.smartor.domain.PhoneCallResultYQVO; |
| | | import com.smartor.service.IServicePhoneService; |
| | | import com.smartor.service.IServiceSubtaskService; |
| | | 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.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 䏿±çµè¯æµç¨æå¡ Controller |
| | | * |
| | | * @author ls |
| | | * @date 2026-08-26 |
| | | */ |
| | | @Slf4j |
| | | @Api(description = "䏿±çµè¯æµç¨æå¡") |
| | | @RestController |
| | | @RequestMapping("/smartor/shphone") |
| | | public class ServicePhoneController extends BaseController { |
| | | @Autowired |
| | | private IServiceSubtaskService serviceSubtaskService; |
| | | |
| | | @Autowired |
| | | private IServicePhoneService iServicePhoneService; |
| | | |
| | | @ApiOperation("æ ¹æ®çµè¯å·ç ,è·åé¦ä¸ªé®é¢") |
| | | @PostMapping("/getFirstQues") |
| | | public Map<String, Object> getFirstQues(@RequestBody PhoneCallReqYQVO phoneCallReqYQVO) { |
| | | log.info("æ ¹æ®çµè¯å·ç ,è·åé¦ä¸ªé®é¢ï¼{}", phoneCallReqYQVO); |
| | | PhoneCallBackSHVO phoneCallBackSHVO = serviceSubtaskService.getFirstQues(phoneCallReqYQVO); |
| | | return success(phoneCallBackSHVO); |
| | | } |
| | | |
| | | @ApiOperation("䏿± ASR ç»æå¤ç") |
| | | @PostMapping("/processResust") |
| | | public Map<String, Object> processResust(@RequestBody PhoneCallResultYQVO resultYQVO) { |
| | | log.info("䏿± ASR ç»æå¤ç (䏿±)ï¼{}", resultYQVO); |
| | | PhoneCallBackSHVO phoneCallBackSHVO = serviceSubtaskService.processResust(resultYQVO); |
| | | return success(phoneCallBackSHVO); |
| | | } |
| | | |
| | | @ApiOperation("æ°å¢å¤å¼å®ä¾é
ç½®") |
| | | @PostMapping("/addOutboundInstance") |
| | | public Map<String, Object> addOutboundInstance(@RequestBody OutboundConfigAddReqVO request) { |
| | | log.info("æ°å¢å¤å¼å®ä¾é
ç½®ï¼{}", request); |
| | | OutboundInstanceResVO outboundInstanceResVO = iServicePhoneService.addOutboundInstance(request); |
| | | return success(outboundInstanceResVO); |
| | | } |
| | | |
| | | } |
| | |
| | | return toAjax(serviceSubtaskAnswerService.deleteServiceSubtaskAnswerByIds(ids)); |
| | | } |
| | | |
| | | /** |
| | | * æ£è
é®é¢ç»æè®°å½ (å¤é¾) - 弿¥å¤ç |
| | | */ |
| | | @ApiOperation("æ£è
é®é¢ç»æè®°å½(å¤é¾)") |
| | | @PostMapping("/saveQuestionAnswer") |
| | | public AjaxResult saveQuestionAnswer(@RequestBody ServiceSubTaskAnswerReq serviceSubTaskAnswerReq) { |
| | | log.info("ãsaveQuestionCache-----saveQuestionAnswerãçå
¥å为prarm1ï¼{},prarm2ï¼{},typeï¼{},isabnormal:{}", serviceSubTaskAnswerReq.getParam1(), serviceSubTaskAnswerReq.getParam2(), serviceSubTaskAnswerReq.getType(), serviceSubTaskAnswerReq.getIsabnormal()); |
| | | return toAjax(serviceSubtaskAnswerService.saveQuestionAnswer(serviceSubTaskAnswerReq, 0L)); |
| | | log.info("ãsaveQuestionAnswerãçå
¥å为 param1:{},param2:{},type:{},isabnormal:{}", |
| | | serviceSubTaskAnswerReq.getParam1(), serviceSubTaskAnswerReq.getParam2(), |
| | | serviceSubTaskAnswerReq.getType(), serviceSubTaskAnswerReq.getIsabnormal()); |
| | | // 弿¥å¤çä¿åé»è¾ï¼ç«å³è¿åæåæ¶æ¯ |
| | | serviceSubtaskAnswerService.saveQuestionAnswer(serviceSubTaskAnswerReq, 0L); |
| | | return success("æäº¤æåï¼æ£å¨å¤çä¸..."); |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ£è
é®é¢ç»æè®°å½ (å°ç¨åºå¤é¾) - 弿¥å¤ç |
| | | */ |
| | | @ApiOperation("æ£è
é®é¢ç»æè®°å½(å°ç¨å
å¤é¾)") |
| | | @PostMapping("/saveQuestionAnswerXCH") |
| | | public AjaxResult saveQuestionAnswerXCH(@RequestBody ServiceSubTaskAnswerReq serviceSubTaskAnswerReq) { |
| | | log.info("ãsaveQuestionCache-----saveQuestionAnswerXCHãçå
¥å为ï¼{}", serviceSubTaskAnswerReq); |
| | | return toAjax(serviceSubtaskAnswerService.saveQuestionAnswer(serviceSubTaskAnswerReq, 1L)); |
| | | log.info("ãsaveQuestionAnswerXCHãçå
¥å为ï¼{}", serviceSubTaskAnswerReq); |
| | | // 弿¥å¤çä¿åé»è¾ï¼ç«å³è¿åæåæ¶æ¯ |
| | | serviceSubtaskAnswerService.saveQuestionAnswer(serviceSubTaskAnswerReq, 1L); |
| | | return success("æäº¤æåï¼æ£å¨å¤çä¸..."); |
| | | } |
| | | |
| | | @ApiOperation("è·åæ£è
é®é¢ç»æè®°å½ç¼å(å°ç¨åºå¤é¾)") |
| | |
| | | } |
| | | } |
| | | |
| | | if (StringUtils.isNotEmpty(serviceSubtaskVO.getServiceType()) && serviceSubtaskVO.getServiceType().equals("2")) { |
| | | //è·åserviceSubtaskListä¸çæætaskid |
| | | List<Long> taskIds = serviceSubtaskList.stream().map(ServiceSubtaskRes::getTaskid).filter(ObjectUtils::isNotEmpty).distinct().collect(Collectors.toList()); |
| | | serviceSubtaskDetailRatioExports = serviceSubtaskService.statQuestionOption(taskIds, serviceSubtaskVO.getStartOutHospTime(), serviceSubtaskVO.getEndOutHospTime()); |
| | | } else if (StringUtils.isNotEmpty(serviceSubtaskVO.getServiceType()) && serviceSubtaskVO.getServiceType().equals("6")) { |
| | | //满æåº¦ç»è®¡ ï¼éè¿ subtask ç id å»ç»è®¡ï¼ |
| | | List<Long> subtaskIds = serviceSubtaskList.stream().map(ServiceSubtaskRes::getId).collect(Collectors.toList()); |
| | | serviceSubtaskDetailRatioExports = serviceSubtaskService.statQuestionOptionBySubtaskIds(subtaskIds, serviceSubtaskVO.getStartOutHospTime(), serviceSubtaskVO.getEndOutHospTime()); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.utils.PageUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | //@PreAuthorize("@ss.hasPermi('smartor:smstemplet:list')") |
| | | @PostMapping("/list") |
| | | public Map<String, Object> list(@RequestBody SmsTemplet smsTemplet) { |
| | | smsTemplet.setPageNum(PageUtils.getOffset(smsTemplet.getPageNum(), smsTemplet.getPageSize())); |
| | | if (StringUtils.isEmpty(smsTemplet.getUserName()) && StringUtils.isEmpty(smsTemplet.getWardCode()) && StringUtils.isEmpty(smsTemplet.getDeptCode())) { |
| | | SysUser user = getLoginUser().getUser(); |
| | | smsTemplet.setUserName(user.getUserName()); |
| | | smsTemplet.setNickName(user.getNickName()); |
| | | } |
| | | List<SmsTemplet> list = smsTempletService.selectSmsTempletList(smsTemplet); |
| | | //è¿ä¸ªä¸éè¦å页ï¼ä¸ä¸ªç§å®¤ä¹ä¸ä¼æå¤å°æ¡çä¿¡æ¨¡æ¿ |
| | | smsTemplet.setPageNum(null); |
| | | smsTemplet.setPageSize(null); |
| | | List<SmsTemplet> list = smsTempletService.selectSmsTempletList(smsTemplet); |
| | | return getDataTable3(ObjectUtil.isNotEmpty(list) ? list.size() : 0, list); |
| | | List<SmsTemplet> total = smsTempletService.selectSmsTempletList(smsTemplet); |
| | | return getDataTable3(ObjectUtil.isNotEmpty(total) ? total.size() : 0, list); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | // @IpWhitelist |
| | | @GetMapping("/SSOLogin") |
| | | public RedirectView SSOLogin(@RequestParam(required = false) String campusid, @RequestParam(required = false) String deptId, String orgid, String userName, String token) { |
| | | public RedirectView SSOLogin(@RequestParam(required = false) String campusid, @RequestParam(required = false) String deptId, @RequestParam(required = false) String systype, String orgid, String userName, String token) { |
| | | if (StringUtils.isEmpty(userName) && StringUtils.isEmpty(token) && StringUtils.isEmpty(orgid)) { |
| | | throw new BaseException("åæ°ä¸è½ä¸ºç©º"); |
| | | } |
| | | String path = null; |
| | | if (StringUtils.isEmpty(systype)) path = sysConfigService.selectConfigByKey("sys.qddz"); |
| | | else path = sysConfigService.selectConfigByKey("sys.qddz.yd"); |
| | | |
| | | String path = sysConfigService.selectConfigByKey("sys.qddz"); |
| | | if (StringUtils.isEmpty(path)) { |
| | | throw new BaseException("请é
ç½®å端å°å"); |
| | | } |
| | |
| | | package com.ruoyi.web.controller.tool; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.LinkedHashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiOperation; |
| | | |
| | | /** |
| | | * swagger ç¨æ·æµè¯æ¹æ³ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Api("ç¨æ·ä¿¡æ¯ç®¡ç") |
| | | @RestController |
| | | @RequestMapping("/test/user") |
| | | public class TestController extends BaseController |
| | | { |
| | | private final static Map<Integer, UserEntity> users = new LinkedHashMap<Integer, UserEntity>(); |
| | | { |
| | | users.put(1, new UserEntity(1, "admin", "admin123", "15888888888")); |
| | | users.put(2, new UserEntity(2, "ry", "admin123", "15666666666")); |
| | | } |
| | | |
| | | @ApiOperation("è·åç¨æ·å表") |
| | | @GetMapping("/list") |
| | | public R<List<UserEntity>> userList() |
| | | { |
| | | List<UserEntity> userList = new ArrayList<UserEntity>(users.values()); |
| | | return R.ok(userList); |
| | | } |
| | | |
| | | @ApiOperation("è·åç¨æ·è¯¦ç»") |
| | | @ApiImplicitParam(name = "userId", value = "ç¨æ·ID", required = true, dataType = "int", paramType = "path", dataTypeClass = Integer.class) |
| | | @GetMapping("/{userId}") |
| | | public R<UserEntity> getUser(@PathVariable Integer userId) |
| | | { |
| | | if (!users.isEmpty() && users.containsKey(userId)) |
| | | { |
| | | return R.ok(users.get(userId)); |
| | | } |
| | | else |
| | | { |
| | | return R.fail("ç¨æ·ä¸åå¨"); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation("æ°å¢ç¨æ·") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "userId", value = "ç¨æ·id", dataType = "Integer", dataTypeClass = Integer.class), |
| | | @ApiImplicitParam(name = "username", value = "ç¨æ·åç§°", dataType = "String", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "password", value = "ç¨æ·å¯ç ", dataType = "String", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "mobile", value = "ç¨æ·ææº", dataType = "String", dataTypeClass = String.class) |
| | | }) |
| | | @PostMapping("/save") |
| | | public R<String> save(UserEntity user) |
| | | { |
| | | if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId())) |
| | | { |
| | | return R.fail("ç¨æ·IDä¸è½ä¸ºç©º"); |
| | | } |
| | | users.put(user.getUserId(), user); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation("æ´æ°ç¨æ·") |
| | | @PutMapping("/update") |
| | | public R<String> update(@RequestBody UserEntity user) |
| | | { |
| | | if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId())) |
| | | { |
| | | return R.fail("ç¨æ·IDä¸è½ä¸ºç©º"); |
| | | } |
| | | if (users.isEmpty() || !users.containsKey(user.getUserId())) |
| | | { |
| | | return R.fail("ç¨æ·ä¸åå¨"); |
| | | } |
| | | users.remove(user.getUserId()); |
| | | users.put(user.getUserId(), user); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation("å é¤ç¨æ·ä¿¡æ¯") |
| | | @ApiImplicitParam(name = "userId", value = "ç¨æ·ID", required = true, dataType = "int", paramType = "path", dataTypeClass = Integer.class) |
| | | @DeleteMapping("/{userId}") |
| | | public R<String> delete(@PathVariable Integer userId) |
| | | { |
| | | if (!users.isEmpty() && users.containsKey(userId)) |
| | | { |
| | | users.remove(userId); |
| | | return R.ok(); |
| | | } |
| | | else |
| | | { |
| | | return R.fail("ç¨æ·ä¸åå¨"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @ApiModel(value = "UserEntity", description = "ç¨æ·å®ä½") |
| | | class UserEntity |
| | | { |
| | | @ApiModelProperty("ç¨æ·ID") |
| | | private Integer userId; |
| | | |
| | | @ApiModelProperty("ç¨æ·åç§°") |
| | | private String username; |
| | | |
| | | @ApiModelProperty("ç¨æ·å¯ç ") |
| | | private String password; |
| | | |
| | | @ApiModelProperty("ç¨æ·ææº") |
| | | private String mobile; |
| | | |
| | | public UserEntity() |
| | | { |
| | | |
| | | } |
| | | |
| | | public UserEntity(Integer userId, String username, String password, String mobile) |
| | | { |
| | | this.userId = userId; |
| | | this.username = username; |
| | | this.password = password; |
| | | this.mobile = mobile; |
| | | } |
| | | |
| | | public Integer getUserId() |
| | | { |
| | | return userId; |
| | | } |
| | | |
| | | public void setUserId(Integer userId) |
| | | { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | public String getUsername() |
| | | { |
| | | return username; |
| | | } |
| | | |
| | | public void setUsername(String username) |
| | | { |
| | | this.username = username; |
| | | } |
| | | |
| | | public String getPassword() |
| | | { |
| | | return password; |
| | | } |
| | | |
| | | public void setPassword(String password) |
| | | { |
| | | this.password = password; |
| | | } |
| | | |
| | | public String getMobile() |
| | | { |
| | | return mobile; |
| | | } |
| | | |
| | | public void setMobile(String mobile) |
| | | { |
| | | this.mobile = mobile; |
| | | } |
| | | } |
| | | //package com.ruoyi.web.controller.tool; |
| | | // |
| | | //import java.util.ArrayList; |
| | | //import java.util.LinkedHashMap; |
| | | //import java.util.List; |
| | | //import java.util.Map; |
| | | // |
| | | //import org.springframework.web.bind.annotation.DeleteMapping; |
| | | //import org.springframework.web.bind.annotation.GetMapping; |
| | | //import org.springframework.web.bind.annotation.PathVariable; |
| | | //import org.springframework.web.bind.annotation.PostMapping; |
| | | //import org.springframework.web.bind.annotation.PutMapping; |
| | | //import org.springframework.web.bind.annotation.RequestBody; |
| | | //import org.springframework.web.bind.annotation.RequestMapping; |
| | | //import org.springframework.web.bind.annotation.RestController; |
| | | //import com.ruoyi.common.core.controller.BaseController; |
| | | //import com.ruoyi.common.core.domain.R; |
| | | //import com.ruoyi.common.utils.StringUtils; |
| | | //import io.swagger.annotations.Api; |
| | | //import io.swagger.annotations.ApiImplicitParam; |
| | | //import io.swagger.annotations.ApiImplicitParams; |
| | | //import io.swagger.annotations.ApiModel; |
| | | //import io.swagger.annotations.ApiModelProperty; |
| | | //import io.swagger.annotations.ApiOperation; |
| | | // |
| | | ///** |
| | | // * swagger ç¨æ·æµè¯æ¹æ³ |
| | | // * |
| | | // * @author ruoyi |
| | | // */ |
| | | //@Api("ç¨æ·ä¿¡æ¯ç®¡ç") |
| | | //@RestController |
| | | //@RequestMapping("/test/user") |
| | | //public class TestController extends BaseController { |
| | | // private final static Map<Integer, UserEntity> users = new LinkedHashMap<Integer, UserEntity>(); |
| | | // |
| | | // { |
| | | // users.put(1, new UserEntity(1, "admin", "admin123", "15888888888")); |
| | | // users.put(2, new UserEntity(2, "ry", "admin123", "15666666666")); |
| | | // } |
| | | // |
| | | // @ApiOperation("è·åç¨æ·å表") |
| | | // @GetMapping("/list") |
| | | // public R<List<UserEntity>> userList() { |
| | | // List<UserEntity> userList = new ArrayList<UserEntity>(users.values()); |
| | | // return R.ok(userList); |
| | | // } |
| | | // |
| | | // @ApiOperation("è·åç¨æ·è¯¦ç»") |
| | | // @ApiImplicitParam(name = "userId", value = "ç¨æ·ID", required = true, dataType = "int", paramType = "path", dataTypeClass = Integer.class) |
| | | // @GetMapping("/{userId}") |
| | | // public R<UserEntity> getUser(@PathVariable Integer userId) { |
| | | // if (!users.isEmpty() && users.containsKey(userId)) { |
| | | // return R.ok(users.get(userId)); |
| | | // } else { |
| | | // return R.fail("ç¨æ·ä¸åå¨"); |
| | | // } |
| | | // } |
| | | // |
| | | // @ApiOperation("æ°å¢ç¨æ·") |
| | | // @ApiImplicitParams({@ApiImplicitParam(name = "userId", value = "ç¨æ·id", dataType = "Integer", dataTypeClass = Integer.class), @ApiImplicitParam(name = "username", value = "ç¨æ·åç§°", dataType = "String", dataTypeClass = String.class), @ApiImplicitParam(name = "password", value = "ç¨æ·å¯ç ", dataType = "String", dataTypeClass = String.class), @ApiImplicitParam(name = "mobile", value = "ç¨æ·ææº", dataType = "String", dataTypeClass = String.class)}) |
| | | // @PostMapping("/save") |
| | | // public R<String> save(UserEntity user) { |
| | | // if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId())) { |
| | | // return R.fail("ç¨æ·IDä¸è½ä¸ºç©º"); |
| | | // } |
| | | // users.put(user.getUserId(), user); |
| | | // return R.ok(); |
| | | // } |
| | | // |
| | | // @ApiOperation("æ´æ°ç¨æ·") |
| | | // @PutMapping("/update") |
| | | // public R<String> update(@RequestBody UserEntity user) { |
| | | // if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId())) { |
| | | // return R.fail("ç¨æ·IDä¸è½ä¸ºç©º"); |
| | | // } |
| | | // if (users.isEmpty() || !users.containsKey(user.getUserId())) { |
| | | // return R.fail("ç¨æ·ä¸åå¨"); |
| | | // } |
| | | // users.remove(user.getUserId()); |
| | | // users.put(user.getUserId(), user); |
| | | // return R.ok(); |
| | | // } |
| | | // |
| | | // @ApiOperation("å é¤ç¨æ·ä¿¡æ¯") |
| | | // @ApiImplicitParam(name = "userId", value = "ç¨æ·ID", required = true, dataType = "int", paramType = "path", dataTypeClass = Integer.class) |
| | | // @GetMapping("/{userId}") |
| | | // public R<String> delete(@PathVariable Integer userId) { |
| | | // if (!users.isEmpty() && users.containsKey(userId)) { |
| | | // users.remove(userId); |
| | | // return R.ok(); |
| | | // } else { |
| | | // return R.fail("ç¨æ·ä¸åå¨"); |
| | | // } |
| | | // } |
| | | //} |
| | | // |
| | | //@ApiModel(value = "UserEntity", description = "ç¨æ·å®ä½") |
| | | //class UserEntity { |
| | | // @ApiModelProperty("ç¨æ·ID") |
| | | // private Integer userId; |
| | | // |
| | | // @ApiModelProperty("ç¨æ·åç§°") |
| | | // private String username; |
| | | // |
| | | // @ApiModelProperty("ç¨æ·å¯ç ") |
| | | // private String password; |
| | | // |
| | | // @ApiModelProperty("ç¨æ·ææº") |
| | | // private String mobile; |
| | | // |
| | | // public UserEntity() { |
| | | // |
| | | // } |
| | | // |
| | | // public UserEntity(Integer userId, String username, String password, String mobile) { |
| | | // this.userId = userId; |
| | | // this.username = username; |
| | | // this.password = password; |
| | | // this.mobile = mobile; |
| | | // } |
| | | // |
| | | // public Integer getUserId() { |
| | | // return userId; |
| | | // } |
| | | // |
| | | // public void setUserId(Integer userId) { |
| | | // this.userId = userId; |
| | | // } |
| | | // |
| | | // public String getUsername() { |
| | | // return username; |
| | | // } |
| | | // |
| | | // public void setUsername(String username) { |
| | | // this.username = username; |
| | | // } |
| | | // |
| | | // public String getPassword() { |
| | | // return password; |
| | | // } |
| | | // |
| | | // public void setPassword(String password) { |
| | | // this.password = password; |
| | | // } |
| | | // |
| | | // public String getMobile() { |
| | | // return mobile; |
| | | // } |
| | | // |
| | | // public void setMobile(String mobile) { |
| | | // this.mobile = mobile; |
| | | // } |
| | | //} |
| | |
| | | // è¿æ»¤è¯·æ± |
| | | .authorizeRequests() |
| | | // 对äºç»å½login 注åregister éªè¯ç captchaImage å
许å¿åè®¿é® |
| | | .antMatchers("/login","/test/**", "/register", "/captchaImage", "/qrcode/generateStaticHtml", "/qrcode/getQRcode", "/qrcode/getFormDate", "/chat", "/system/file/admin/uploadFile", "/smartor/dingtalk/sendNotification", "/patient/read/patientInfo", "/socket", "/API_ESB_Service", "/API_ESB_Service/Run", "/magic/web/**", "/smartor/serviceSubtask/phoneCallBack", "/smartor/serviceSubtask/taskPull", "/smartor/serviceSubtask/phoneCallBackYQ", "/smartor/robot/callstatus", "/smartor/robot/aidialog", "/smartor/robot/cdrinfo", "/getToken", "/smartor/subtaskAnswer/getQuestionCache", "/smartor/subtaskAnswer/saveQuestionCache", "/smartor/servicetask/getScriptInfoByCondition", "/smartor/subtaskAnswer/saveQuestionAnswer", "/smartor/import/download", "/smartor/serviceSubtask/recordAccept", "/smartor/outPath/getInfoByParam", "/smartor/serviceExternal/addDeptInfo", "/smartor/serviceExternal/**", "/sso/**","/smartor/sltdHealthcareRecord/**","/smartor/servicetask/getScriptByCondition","/smartor/subtaskAnswer/saveMYDQuestionAnswer","smartor/serviceSubtask/goSfRelay","/smartor/serviceSubtask/scanGenerateSubtask").permitAll() |
| | | .antMatchers("/login","/test/**", "/register", "/captchaImage", "/qrcode/generateStaticHtml", "/qrcode/getQRcode", "/qrcode/getFormDate", "/chat", "/system/file/admin/uploadFile", "/smartor/dingtalk/sendNotification", "/patient/read/patientInfo", "/socket", "/API_ESB_Service", "/API_ESB_Service/Run", "/magic/web/**", "/smartor/serviceSubtask/phoneCallBack", "/smartor/serviceSubtask/taskPull", "/smartor/serviceSubtask/phoneCallBackYQ", "/smartor/robot/callstatus", "/smartor/robot/aidialog", "/smartor/robot/cdrinfo", "/getToken", "/smartor/subtaskAnswer/getQuestionCache", "/smartor/subtaskAnswer/saveQuestionCache", "/smartor/servicetask/getScriptInfoByCondition", "/smartor/subtaskAnswer/saveQuestionAnswer", "/smartor/import/download", "/smartor/serviceSubtask/recordAccept", "/smartor/outPath/getInfoByParam", "/smartor/serviceExternal/addDeptInfo", "/smartor/serviceExternal/**", "/sso/**","/smartor/sltdHealthcareRecord/**","/smartor/servicetask/getScriptByCondition","/smartor/subtaskAnswer/saveMYDQuestionAnswer","smartor/serviceSubtask/goSfRelay","/smartor/serviceSubtask/scanGenerateSubtask","/smartor/shphone/getFirstQues","/smartor/shphone/processResust","/smartor/shphone/addOutboundInstance").permitAll() |
| | | // éæèµæºï¼å¯å¿åè®¿é® |
| | | // .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**","/getDept/*","/SSOLogin/**").permitAll().antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll() |
| | | .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**","/getDept/*","/SSOLogin/**","/system/dict/data/typeout/*").permitAll().antMatchers( "/druid/**").permitAll() |
| | |
| | | package com.ruoyi.framework.config; |
| | | |
| | | import com.ruoyi.common.utils.Threads; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.concurrent.BasicThreadFactory; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | |
| | | * |
| | | * @author ruoyi |
| | | **/ |
| | | @Slf4j |
| | | @Configuration |
| | | public class ThreadPoolConfig |
| | | { |
| | |
| | | public ThreadPoolTaskExecutor threadPoolTaskExecutor() |
| | | { |
| | | ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); |
| | | executor.setMaxPoolSize(maxPoolSize); |
| | | // æ ¸å¿çº¿ç¨æ± å¤§å° |
| | | executor.setCorePoolSize(corePoolSize); |
| | | // æå¤§å¯å建ççº¿ç¨æ° |
| | | executor.setMaxPoolSize(maxPoolSize); |
| | | // éåæå¤§é¿åº¦ |
| | | executor.setQueueCapacity(queueCapacity); |
| | | // çº¿ç¨æ± ç»´æ¤çº¿ç¨æå
许çç©ºé²æ¶é´ |
| | | executor.setKeepAliveSeconds(keepAliveSeconds); |
| | | // çº¿ç¨æ± 对æç»ä»»å¡(æ 线ç¨å¯ç¨)çå¤ççç¥ |
| | | // 线ç¨åç§°åç¼ |
| | | executor.setThreadNamePrefix("async-task-executor-"); |
| | | // 设置线ç¨å·¥å (ç¨äºç»çº¿ç¨å½åï¼ä¾¿äºææ¥é®é¢) |
| | | executor.setThreadFactory(new BasicThreadFactory.Builder().namingPattern("async-task-%d").daemon(true).build()); |
| | | // çº¿ç¨æ± 对æç»ä»»å¡ (æ 线ç¨å¯ç¨) çå¤ççç¥ - è°ç¨è
è¿è¡çç¥ |
| | | executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); |
| | | // åå§å |
| | | executor.initialize(); |
| | | return executor; |
| | | } |
| | | |
| | |
| | | SysUserDept sysUserDept = new SysUserDept(); |
| | | sysUserDept.setUserId(sysUser.getUserId()); |
| | | sysUserDept.setDeptType(sysUser.getSearchscope()); |
| | | sysUserDept.setOrgid(sysUser.getOrgid()); |
| | | List<SysUserDept> sysUserDeptKSs = null; |
| | | List<SysUserDept> sysUserDeptBQs = null; |
| | | if (StringUtils.isNotEmpty(sysUser.getSearchscope()) && sysUser.getSearchscope().equals("0")) { |
| | |
| | | <if test="wardCode != null and wardCode != ''">and ward_code = #{wardCode}</if> |
| | | <if test="userName != null and userName != ''">and user_name = #{userName}</if> |
| | | <if test="nickName != null and nickName != ''">and nick_name = #{nickName}</if> |
| | | <if test="pageSize != null and pageNum != null">limit ${pageSize} OFFSET ${pageNum}</if> |
| | | </select> |
| | | |
| | | <select id="selectSmsTempletByTempletid" parameterType="Long" resultMap="SmsTempletResult"> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.smartor.domain; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * çµè¯é®é¢ååº(䏿±) |
| | | * |
| | | * @author ls |
| | | * 26 |
| | | */ |
| | | @Data |
| | | public class PhoneCallBackSHVO { |
| | | |
| | | /** |
| | | * åä»»å¡ID |
| | | */ |
| | | @ApiModelProperty(value = "åä»»å¡ID") |
| | | private Long subId; |
| | | |
| | | /** |
| | | * é®é¢ID |
| | | */ |
| | | @ApiModelProperty(value = "é®é¢ID") |
| | | private Long scriptId; |
| | | |
| | | /** |
| | | * 任塿¨¡æ¿ID |
| | | */ |
| | | @ApiModelProperty(value = "任塿¨¡æ¿ID") |
| | | private Long taskTemplateid; |
| | | |
| | | /** |
| | | * å¯ä»¥å¯¹å½åééçé³éè¿è¡éå½è°æ´,åå¼èå´ã-4,4ã |
| | | */ |
| | | @ApiModelProperty(value = "åºå·") |
| | | private Integer sort; |
| | | |
| | | |
| | | @ApiModelProperty(value = "é®é¢å
容") |
| | | private String scriptContent; |
| | | |
| | | |
| | | @ApiModelProperty(value = "é项") |
| | | private String option; |
| | | |
| | | @ApiModelProperty(value = "æµç¨ç¶æï¼0ç»æ 1è¿è¡ä¸") |
| | | private String status = "1"; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.smartor.domain; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * çµè¯ASRåè°è¯·æ±(é¨ç»®) |
| | | * |
| | | * @author ls |
| | | * @date 2024-08-8 |
| | | */ |
| | | @Data |
| | | public class PhoneCallResultYQVO { |
| | | |
| | | @ApiModelProperty(value = "ä»»å¡ç¼å·(è¿éåå¨çå°±æ¯subtaskID)") |
| | | private String taskid; |
| | | |
| | | |
| | | /** |
| | | * å½åå¼å«çç®æ å·ç |
| | | */ |
| | | @ApiModelProperty(value = "å½åå¼å«çç®æ å·ç ") |
| | | private String phone; |
| | | |
| | | /** |
| | | * å½ååè°ç请æ±ç±»åï¼å
æ¬ï¼AsrCallback: ASRææ¬åè° DtmfCallback:æ¶å°æé®åè° SilentCallback:éé»åè° PlayEvent:é³ä¹ææ¾å¼å§ãç»æäºä»¶åè° |
| | | */ |
| | | @ApiModelProperty(value = "å½ååè°ç请æ±ç±»åï¼å
æ¬ï¼AsrCallback: ASRææ¬åè° DtmfCallback:æ¶å°æé®åè° SilentCallback:éé»åè° PlayEvent:é³ä¹ææ¾å¼å§ãç»æäºä»¶åè°") |
| | | private String operate; |
| | | |
| | | /** |
| | | * asråççå
容 |
| | | */ |
| | | @ApiModelProperty(value = "asråççå
容") |
| | | private String asrResult; |
| | | |
| | | /** |
| | | * åä»»å¡ID |
| | | */ |
| | | @ApiModelProperty(value = "åä»»å¡ID") |
| | | private Long subId; |
| | | |
| | | /** |
| | | * é®é¢ID |
| | | */ |
| | | @ApiModelProperty(value = "é®é¢ID") |
| | | private Long scriptId; |
| | | |
| | | /** |
| | | * 任塿¨¡æ¿ID |
| | | */ |
| | | @ApiModelProperty(value = "任塿¨¡æ¿ID") |
| | | private Long taskTemplateid; |
| | | |
| | | /** |
| | | * å¯ä»¥å¯¹å½åééçé³éè¿è¡éå½è°æ´,åå¼èå´ã-4,4ã |
| | | */ |
| | | @ApiModelProperty(value = "åºå·") |
| | | private Integer sort; |
| | | |
| | | |
| | | @ApiModelProperty(value = "éè¿åºå¹é
çç»æ") |
| | | private String scriptContent; |
| | | |
| | | @ApiModelProperty(value = "æºæID") |
| | | private String orgid; |
| | | |
| | | @ApiModelProperty(value = "uuid") |
| | | private String uuid; |
| | | |
| | | @ApiModelProperty(value = "guid") |
| | | private String guid; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "ç
人信æ¯") |
| | | private PatArchive patArchive; |
| | | |
| | | |
| | | /** |
| | | * æªå å¯çä»»å¡ID |
| | | */ |
| | | @ApiModelProperty("æªå å¯çä»»å¡ID") |
| | | @Excel(name = "æªå å¯çä»»å¡ID") |
| | | private Long taskId; |
| | | |
| | | |
| | | /** |
| | | * æªå å¯çåä»»å¡ID |
| | | */ |
| | | @ApiModelProperty("æªå å¯çåä»»å¡ID") |
| | | @Excel(name = "æªå å¯çåä»»å¡ID") |
| | | private Long subId; |
| | | |
| | | } |
| | | |
| | |
| | | /** |
| | | * æå¡ç±»å(1ãçæµè¯ä¼°ï¼2ãåºé¢é访ï¼3ãé¨è¯é访ï¼4ã宣æå
³æï¼5ãå¤è¯éç¥ï¼6ãæ»¡æåº¦è°æ¥ï¼7ãæ£è
æ¥åï¼ 8ãå
¶ä»éç¥) |
| | | */ |
| | | @Excel(name = "æå¡ç±»å(1ãçæµè¯ä¼°ï¼2ãåºé¢é访ï¼3ãé¨è¯é访ï¼4ã宣æå
³æï¼5ãå¤è¯ç®¡çï¼6ãæ»¡æåº¦è°æ¥ï¼7ãæ£è
æ¥åï¼ 8ãå
¶ä»éç¥ 9使£é访 10.廿é访 11ï¼å½±åä¸ç§é访 12ãå¿çµä¸ç§éè®¿ï¼ 13ä¸ç§é访)") |
| | | @ApiModelProperty(value = "æå¡ç±»å(1ãçæµè¯ä¼°ï¼2ãåºé¢é访ï¼3ãé¨è¯é访ï¼4ã宣æå
³æï¼5ãå¤è¯ç®¡çï¼6ãæ»¡æåº¦è°æ¥ï¼7ãæ£è
æ¥åï¼ 8ãå
¶ä»éç¥ 9使£é访 10.廿é访 11ï¼å½±åä¸ç§é访 12ãå¿çµä¸ç§éè®¿ï¼ 13ä¸ç§é访)") |
| | | @Excel(name = "æå¡ç±»å(æå¡ç±»å(1ãçæµè¯ä¼°ï¼2ãåºé¢é访ï¼3ãé¨è¯é访ï¼4ã宣æå
³æ(åºé¢) 5ãå¤è¯ç®¡çï¼6ãä½é¢æ»¡æåº¦è°æ¥ï¼7ãæ£è
æ¥åï¼ 8ãå
¶ä»éç¥ 9使£é访 10.廿é访 11ï¼å½±åä¸ç§é访 12ãå¿çµä¸ç§éè®¿ï¼ 13ä¸ç§é访 14ãé¨è¯æ»¡æåº¦è°æ¥ 15æè¯å»ºè®® 16课é¢é访 17ã宣æå
³æ(å
¥é¢) 18ãå
¥é¢é访)") |
| | | @ApiModelProperty(value = "æå¡ç±»å(æå¡ç±»å(1ãçæµè¯ä¼°ï¼2ãåºé¢é访ï¼3ãé¨è¯é访ï¼4ã宣æå
³æ(åºé¢) 5ãå¤è¯ç®¡çï¼6ãä½é¢æ»¡æåº¦è°æ¥ï¼7ãæ£è
æ¥åï¼ 8ãå
¶ä»éç¥ 9使£é访 10.廿é访 11ï¼å½±åä¸ç§é访 12ãå¿çµä¸ç§éè®¿ï¼ 13ä¸ç§é访 14ãé¨è¯æ»¡æåº¦è°æ¥ 15æè¯å»ºè®® 16课é¢é访 17ã宣æå
³æ(å
¥é¢) 18ãå
¥é¢é访 19ææ¯é访 20 æ£è
å¼å¸¸æ¥å表)") |
| | | private String serviceType; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * ç»è®¡é®é¢çé项çç¾åæ¯ |
| | | * |
| | | * @param taskIds |
| | | * @param taskIds ä»»å¡ ID å表 (ç¨äºæå¡ç±»å 2) |
| | | * @param startOutHospTime |
| | | * @param endOutHospTime |
| | | * @return |
| | | */ |
| | | List<ServiceSubtaskDetailRatioExport> statQuestionOption(@Param("taskIds") List<Long> taskIds, @Param("startOutHospTime") Date startOutHospTime, @Param("endOutHospTime") Date endOutHospTime); |
| | | |
| | | /** |
| | | * æ ¹æ®åä»»å¡ ID ç»è®¡é®é¢çé项çç¾åæ¯ï¼ç¨äºæ»¡æåº¦ç»è®¡ serviceType=6ï¼ |
| | | * |
| | | * @param subtaskIds åä»»å¡ ID å表 (åªè½å个 taskid ä¸çææåä»»å¡ id) |
| | | * @param startOutHospTime |
| | | * @param endOutHospTime |
| | | * @return |
| | | */ |
| | | List<ServiceSubtaskDetailRatioExport> statQuestionOptionBySubtaskIds(@Param("subtaskIds") List<Long> subtaskIds, @Param("startOutHospTime") Date startOutHospTime, @Param("endOutHospTime") Date endOutHospTime); |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.smartor.service; |
| | | |
| | | import com.smartor.domain.*; |
| | | import com.smartor.domain.VO.HeLibraryCountVO; |
| | | import com.smartor.domain.VO.ServiceSubtaskCotinueCountVO; |
| | | import com.smartor.domain.VO.TransferDeptVO; |
| | | import com.smartor.domain.entity.ServiceSubtaskEntity; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 䏿±çµè¯æå¡ |
| | | * |
| | | * @author ruoyi |
| | | * @date 2026-08-27 |
| | | */ |
| | | public interface IServicePhoneService { |
| | | OutboundInstanceResVO addOutboundInstance(OutboundConfigAddReqVO request); |
| | | } |
| | |
| | | */ |
| | | public PhoneCallBackYQVO phoneCallBackYQ(PhoneCallReqYQVO phoneCallReqYQVO); |
| | | |
| | | public PhoneCallBackSHVO getFirstQues(PhoneCallReqYQVO phoneCallReqYQVO); |
| | | |
| | | public PhoneCallBackSHVO processResust(PhoneCallResultYQVO phoneCallReqYQVO); |
| | | |
| | | /** |
| | | * é¨ç»®ä»»å¡æå |
| | | * |
| | |
| | | Map<String, Object> smsSubTask(Long subid); |
| | | |
| | | /** |
| | | * ç»è®¡é®é¢çé项çç¾åæ¯ |
| | | * ç»è®¡é®é¢çé项çç¾åæ¯ (ç¨äºæå¡ç±»å 2) |
| | | * |
| | | * @param taskIds |
| | | * @return |
| | | */ |
| | | public List<ServiceSubtaskDetailRatioExport> statQuestionOption(List<Long> taskIds, Date startOutHospTime, Date endOutHospTime); |
| | | |
| | | /** |
| | | * æ ¹æ®åä»»å¡ ID ç»è®¡é®é¢çé项çç¾åæ¯ï¼ç¨äºæ»¡æåº¦ç»è®¡ serviceType=6ï¼ |
| | | * |
| | | * @param subtaskIds åä»»å¡ ID å表 |
| | | * @return |
| | | */ |
| | | public List<ServiceSubtaskDetailRatioExport> statQuestionOptionBySubtaskIds(List<Long> subtaskIds, Date startOutHospTime, Date endOutHospTime); |
| | | |
| | | public String scanGenerateSubtask(ServiceTask serviceTaskVo); |
| | | |
| | | public Integer matchOptionIndex(String url, String questionText, String voiceText, List<IvrTaskTemplateTargetoption> options, String uuid); |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.smartor.service.impl; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.databind.JsonNode; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.google.gson.Gson; |
| | | import com.ruoyi.common.core.domain.entity.SysDept; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.core.service.IConfigService; |
| | | import com.ruoyi.common.dx.MessageSend; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.*; |
| | | import com.ruoyi.common.utils.http.HttpUtils; |
| | | import com.ruoyi.common.utils.spring.SpringUtils; |
| | | import com.ruoyi.system.domain.SysConfig; |
| | | import com.ruoyi.system.mapper.SysConfigMapper; |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | import com.smartor.common.FtpService; |
| | | import com.smartor.common.MtSubmitSmUtil; |
| | | import com.smartor.common.ScheduleSubtaskBuilder; |
| | | import com.smartor.config.PhoneUtils; |
| | | import com.smartor.domain.DTO.ServiceSubtaskDetailDTO; |
| | | import com.smartor.domain.*; |
| | | import com.smartor.domain.VO.HeLibraryCountVO; |
| | | import com.smartor.domain.VO.ServiceSubtaskCotinueCountVO; |
| | | import com.smartor.domain.VO.TransferDeptVO; |
| | | import com.smartor.domain.entity.ServiceSubtaskEntity; |
| | | import com.smartor.mapper.*; |
| | | import com.smartor.service.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.apache.commons.collections4.MapUtils; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.junit.Test; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.cache.annotation.Cacheable; |
| | | import org.springframework.data.redis.core.ListOperations; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.text.DecimalFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.*; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.time.temporal.ChronoUnit; |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * åä¸ä»»å¡ï¼é访ï¼Serviceä¸å¡å±å¤ç |
| | | * |
| | | * @author ruoyi |
| | | * @date 2024-02-02 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class ServicPhoneServiceImpl implements IServicePhoneService { |
| | | @Value("${shurl}") |
| | | private String shurl; |
| | | |
| | | @Value("${shversion}") |
| | | private String shversion; |
| | | |
| | | /** |
| | | * æ°å¢å¤å¼å®ä¾é
ç½® |
| | | * |
| | | * @param request å¤å¼å®ä¾é
置请æ±å¯¹è±¡ |
| | | * @return å¤å¼å®ä¾é
ç½®ç»æ |
| | | * @throws BaseException æ¥å£è°ç¨å¤±è´¥ææ°æ®è§£æå¼å¸¸æ¶æåº |
| | | */ |
| | | @Override |
| | | public OutboundInstanceResVO addOutboundInstance(OutboundConfigAddReqVO request) { |
| | | // 1. åæ°æ ¡éª |
| | | validateRequest(request); |
| | | |
| | | // 2. åé HTTP è¯·æ± |
| | | String responseJson = sendHttpPostRequest(shurl + shversion + "/config/addOutboundInstance", request); |
| | | |
| | | // 3. è§£æååºå¹¶è¿åç»æ |
| | | return parseResponse(responseJson); |
| | | } |
| | | |
| | | /** |
| | | * åæ°æ ¡éª |
| | | */ |
| | | private void validateRequest(OutboundConfigAddReqVO request) { |
| | | if (request == null) { |
| | | throw new BaseException("请æ±åæ°ä¸è½ä¸ºç©º"); |
| | | } |
| | | |
| | | // å¿
ä¼ åæ°æ ¡éª |
| | | assertNotBlank(request.getName(), "项ç®åç§°ä¸è½ä¸ºç©º"); |
| | | assertNotBlank(request.getAgent(), "åå¸å·ä¸è½ä¸ºç©º"); |
| | | assertNotBlank(request.getTenantId(), "èµæºç»å·ä¸è½ä¸ºç©º"); |
| | | assertNotBlank(request.getCallType(), "å¼å«ç±»åä¸è½ä¸ºç©º"); |
| | | assertNotBlank(request.getActionID(), "actionID ä¸è½ä¸ºç©º"); |
| | | |
| | | // æ¡ä»¶å¿
å¡«æ ¡éªï¼isVgc=0 æ¶ï¼queueId å ratio 为å¿
å¡« |
| | | if ("0".equals(request.getIsVgc())) { |
| | | assertNotBlank(request.getQueueId(), "isVgc=0 æ¶ï¼æ§è¡åå¸ç» ID ä¸è½ä¸ºç©º"); |
| | | assertNotBlank(request.getRatio(), "isVgc=0 æ¶ï¼å¤å¼éçä¸è½ä¸ºç©º"); |
| | | } |
| | | // æ¡ä»¶å¿
å¡«æ ¡éªï¼isVgc=1 æ¶ï¼ivrId 为å¿
å¡« |
| | | else if ("1".equals(request.getIsVgc())) { |
| | | assertNotBlank(request.getIvrId(), "isVgc=1 æ¶ï¼IVR æµç¨ ID ä¸è½ä¸ºç©º"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * åé POST HTTP è¯·æ± |
| | | * |
| | | * @param url API å°å |
| | | * @param request 请æ±å¯¹è±¡ |
| | | * @return æå¡å¨ååº JSON å符串 |
| | | */ |
| | | private String sendHttpPostRequest(String url, Object request) { |
| | | log.info("å¼å§è°ç¨å¤å¼å®ä¾é
ç½®æ¥å£ï¼URL: {}", url); |
| | | |
| | | Map<String, String> headers = buildHeaders(); |
| | | String requestBody = new Gson().toJson(request); |
| | | |
| | | String response = HttpUtils.sendPostByHeader(url, requestBody, headers); |
| | | |
| | | if (StringUtils.isEmpty(response)) { |
| | | log.error("å¤å¼å®ä¾é
ç½®æ¥å£è°ç¨å¤±è´¥ï¼æªè¿åæææ°æ®ï¼URL: {}", url); |
| | | throw new BaseException("æ¥å£è°ç¨å¤±è´¥ï¼æªè¿åæææ°æ®"); |
| | | } |
| | | |
| | | log.info("å¤å¼å®ä¾é
ç½®æ¥å£è°ç¨æåï¼ååºï¼{}", response); |
| | | return response; |
| | | } |
| | | |
| | | /** |
| | | * æå»º HTTP 请æ±å¤´ |
| | | */ |
| | | private Map<String, String> buildHeaders() { |
| | | Map<String, String> headers = new HashMap<>(1); |
| | | headers.put("Content-Type", "application/json; charset=UTF-8"); |
| | | return headers; |
| | | } |
| | | |
| | | /** |
| | | * è§£æ HTTP ååºå¹¶è½¬æ¢ä¸º OutboundInstanceResVO |
| | | * |
| | | * @param responseJson ååº JSON å符串 |
| | | * @return å¤å¼å®ä¾é
ç½®ååºå¯¹è±¡ |
| | | * @throws BaseException å½ååºç ä¸ä¸º 200 æååºæ°æ®è§£æå¤±è´¥æ¶æåº |
| | | */ |
| | | private OutboundInstanceResVO parseResponse(String responseJson) { |
| | | try { |
| | | JSONObject response = JSON.parseObject(responseJson); |
| | | |
| | | // æ£æ¥ååºç |
| | | Integer code = response.getInteger("code"); |
| | | if (!"200".equals(code.toString())) { |
| | | String message = response.getString("message"); |
| | | log.error("å¤å¼å®ä¾é
ç½®æ¥å£è¿å失败ï¼code: {}, message: {}", code, message); |
| | | throw new BaseException("æ°å¢å¤å¼å®ä¾é
置失败ï¼" + message); |
| | | } |
| | | |
| | | // è§£æ data åæ®µ |
| | | JSONObject data = response.getJSONObject("data"); |
| | | if (data == null || data.isEmpty()) { |
| | | throw new BaseException("æ¥å£è¿åæ°æ®ä¸ºç©º"); |
| | | } |
| | | |
| | | return data.toJavaObject(OutboundInstanceResVO.class); |
| | | |
| | | } catch (BaseException e) { |
| | | throw e; |
| | | } catch (Exception e) { |
| | | log.error("è§£æå¤å¼å®ä¾é
ç½®ååºå¼å¸¸ï¼response: {}", responseJson, e); |
| | | throw new BaseException("è§£æååºæ°æ®å¼å¸¸ï¼" + e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æè¨å符串é空工å
·æ¹æ³ |
| | | * |
| | | * @param value å¾
æ£æ¥çå¼ |
| | | * @param message æè¨å¤±è´¥æ¶çéè¯¯æ¶æ¯ |
| | | * @throws BaseException å½å¼ä¸ºç©ºæ¶æåº |
| | | */ |
| | | private void assertNotBlank(String value, String message) { |
| | | if (StringUtils.isBlank(value)) { |
| | | throw new BaseException(message); |
| | | } |
| | | } |
| | | } |
| | |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.math.BigDecimal; |
| | |
| | | return serviceSubtaskAnswerMapper.deleteServiceSubtaskAnswerById(id); |
| | | } |
| | | |
| | | /** |
| | | * ä¿åé®å·çæ¡ (弿¥å¤çï¼å¿«éè¿å) |
| | | * |
| | | * @param serviceSubTaskAnswerReq çæ¡è¯·æ± |
| | | * @param flag æ å¿ä½ |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | @Async("threadPoolTaskExecutor") |
| | | public Integer saveQuestionAnswer(ServiceSubTaskAnswerReq serviceSubTaskAnswerReq, Long flag) { |
| | | String threadName = Thread.currentThread().getName(); |
| | | log.info("[{}] å¼å§å¼æ¥å¤çä¿åé®å·çæ¡", threadName); |
| | | try { |
| | | //åæ°è§£å¯ |
| | | Long tid = null; |
| | | Long pid = null; |
| | |
| | | } |
| | | |
| | | } |
| | | log.info("[{}] 宿弿¥å¤çä¿åé®å·çæ¡", Thread.currentThread().getName()); |
| | | return 1; |
| | | } catch (Exception e) { |
| | | log.error("[{}] 弿¥å¤çä¿åé®å·çæ¡åçå¼å¸¸ : {},请æ±ç对象为ï¼{}", Thread.currentThread().getName(), e.getMessage(), e,serviceSubTaskAnswerReq); |
| | | throw new RuntimeException("ä¿åé®å·çæ¡å¤±è´¥", e); |
| | | } |
| | | |
| | | } |
| | | @Override |
| | | public Integer saveQuestionDetail(ServiceSubTaskCacheReq serviceSubTaskCacheReq, Long flag) { |
| | | Long tid = Long.valueOf(serviceSubTaskCacheReq.getParam1()); |
| | |
| | | import com.google.gson.Gson; |
| | | import com.ruoyi.common.core.domain.entity.SysDept; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.core.service.IConfigService; |
| | | import com.ruoyi.common.dx.MessageSend; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.*; |
| | | import com.ruoyi.common.core.service.IConfigService; |
| | | import com.ruoyi.common.utils.http.HttpUtils; |
| | | import com.ruoyi.common.utils.spring.SpringUtils; |
| | | import com.ruoyi.system.domain.SysConfig; |
| | |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.apache.commons.collections4.MapUtils; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.checkerframework.checker.nullness.qual.NonNull; |
| | | import org.junit.Test; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.text.DecimalFormat; |
| | |
| | | |
| | | @Value("${spring.profiles.active}") |
| | | private String active; |
| | | @Autowired |
| | | private ServiceOutPathMapper serviceOutPathMapper; |
| | | |
| | | /** |
| | | * æ¥è¯¢åä¸ä»»å¡ï¼éè®¿ï¼ |
| | |
| | | */ |
| | | @Override |
| | | public Map<String, Object> insertServiceSubtask(ServiceSubtask serviceSubtask) { |
| | | //å
æ¥è¯¢ä¸ä¸è¯¥æ£è
æ¯å¦å·²ç»åå»ºæ ¹æ®serviceType,sendstate,inhospid,patid,orgid |
| | | ServiceSubtaskEntity serviceSubtaskVO = new ServiceSubtaskEntity(); |
| | | serviceSubtaskVO.setServiceType(serviceSubtask.getServiceType()); |
| | | serviceSubtaskVO.setSendstates(new ArrayList<>(Arrays.asList(1L, 2L, 3L, 5L, 7L))); |
| | | serviceSubtaskVO.setPatid(serviceSubtask.getPatid()); |
| | | serviceSubtaskVO.setOrgid(serviceSubtask.getOrgid()); |
| | | serviceSubtaskVO.setCampusid(serviceSubtask.getCampusid()); |
| | | List<ServiceSubtask> serviceSubtasks = serviceSubtaskMapper.selectServiceSubtaskList(serviceSubtaskVO); |
| | | RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample(); |
| | | String format = null; |
| | | if (CollectionUtils.isNotEmpty(serviceSubtasks)) { |
| | | ServiceSubtask serviceSubtask1 = serviceSubtasks.get(0); |
| | | ServiceOutPath serviceOutPath = new ServiceOutPath(); |
| | | serviceOutPath.setSubId(serviceSubtask1.getId()); |
| | | List<ServiceOutPath> serviceOutPaths = serviceOutPathMapper.selectServiceOutPathList(serviceOutPath); |
| | | if (CollectionUtils.isNotEmpty(serviceOutPaths)) |
| | | format = String.format("%03X", serviceOutPaths.get(0).getId()); |
| | | else format = getOutPath(serviceSubtask1, rsaPublicKeyExample); |
| | | serviceSubtask = serviceSubtask1; |
| | | } else { |
| | | //妿ä¸åå¨ï¼åæ°å¢ |
| | | serviceSubtask.setCreateTime(DateUtils.getNowDate()); |
| | | serviceSubtaskMapper.insertServiceSubtask(serviceSubtask); |
| | | RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample(); |
| | | format = getOutPath(serviceSubtask, rsaPublicKeyExample); |
| | | } |
| | | |
| | | Map<String, Object> result = new HashMap<>(); |
| | | if (StringUtils.isNotEmpty(format)) |
| | | result.put("url", StringUtils.isNotEmpty(req_path) ? localIP + ":" + req_path + "/wt?p=" + format : localIP + "/wt?p=" + format); |
| | | else result.put("url", null); |
| | | result.put("subId", serviceSubtask.getId()); |
| | | return result; |
| | | } |
| | | |
| | | private String getOutPath(ServiceSubtask serviceSubtask, RSAPublicKeyExample rsaPublicKeyExample) { |
| | | String format; |
| | | String taskId = rsaPublicKeyExample.encryptedData(serviceSubtask.getTaskid().toString(), pub_key); |
| | | String patid = rsaPublicKeyExample.encryptedData(serviceSubtask.getPatid().toString(), pub_key); |
| | | String subId = rsaPublicKeyExample.encryptedData(serviceSubtask.getId().toString(), pub_key); |
| | |
| | | serviceOutPath.setCreateTime(new Date()); |
| | | serviceOutPath.setParam6(subId); |
| | | serviceOutPath.setOrgid(serviceSubtask.getOrgid()); |
| | | serviceOutPath.setTaskId(serviceSubtask.getTaskid()); |
| | | serviceOutPath.setSubId(serviceSubtask.getId()); |
| | | iServiceOutPathService.insertServiceOutPath(serviceOutPath); |
| | | //转æ16è¿å¶ |
| | | String format = String.format("%03X", serviceOutPath.getId()); |
| | | format = String.format("%03X", serviceOutPath.getId()); |
| | | serviceOutPath.setRadix(format); |
| | | serviceOutPath.setUpdateTime(new Date()); |
| | | iServiceOutPathService.updateServiceOutPath(serviceOutPath); |
| | | |
| | | Map<String, Object> result = new HashMap<>(); |
| | | result.put("url", StringUtils.isNotEmpty(req_path) ? localIP + ":" + req_path + "/wt?p=" + format : localIP + "/wt?p=" + format); |
| | | result.put("subId", serviceSubtask.getId()); |
| | | return result; |
| | | return format; |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | } |
| | | |
| | | } |
| | | else if (serviceTaskVO.getIsoperation() != null && serviceTaskVO.getIsoperation() == 2) { |
| | | } else if (serviceTaskVO.getIsoperation() != null && serviceTaskVO.getIsoperation() == 2) { |
| | | //ä»»å¡ä¿®æ¹ |
| | | if (ObjectUtils.isNotEmpty(serviceTaskVO.getSendTimeslot())) |
| | | serviceTask.setSendTimeSlot(JSON.toJSONString(serviceTaskVO.getSendTimeslot())); |
| | |
| | | return serviceSubtaskMapper.statQuestionOption(taskIds, startOutHospTime, endOutHospTime); |
| | | } |
| | | |
| | | @Override |
| | | public List<ServiceSubtaskDetailRatioExport> statQuestionOptionBySubtaskIds(List<Long> subtaskIds, Date startOutHospTime, Date endOutHospTime) { |
| | | //å
æ¸
çä¸ä¸é夿°æ® |
| | | List<Long> repeatIds = serviceSubtaskDetailMapper.selectRepeatDetailIds(); |
| | | if (!CollectionUtils.isEmpty(repeatIds)) { |
| | | serviceSubtaskDetailMapper.deleteRepeatDetailByIds(repeatIds); |
| | | } |
| | | return serviceSubtaskMapper.statQuestionOptionBySubtaskIds(subtaskIds, startOutHospTime, endOutHospTime); |
| | | } |
| | | |
| | | /** |
| | | * æ ååé®å·çæ¡ææ¬ï¼å»æ A/B/C/D å忝åç¼ååç»ç©ºæ ¼ |
| | | * ä¾å¦ "A æ¯" -> "æ¯"ï¼"B å¦" -> "å¦" |
| | |
| | | String jsonString = jsonObject.toJSONString(); |
| | | String result = null; |
| | | |
| | | // String url = "http://localhost:8099/matchOptionIndex"; |
| | | // String url = "cc"; |
| | | if (StringUtils.isNotEmpty(url)) { |
| | | try { |
| | | Map<String, String> headers = new HashMap<>(); |
| | |
| | | return -1; |
| | | } |
| | | } |
| | | |
| | | |
| | | public PhoneCallBackSHVO getFirstQues(PhoneCallReqYQVO phoneCallReqYQVO) { |
| | | //ç¨äºè¿å |
| | | PhoneCallBackSHVO phoneCallBackSHVO = new PhoneCallBackSHVO(); |
| | | |
| | | //æ ¹æ®ææºå·è·åç¨æ·ççåä»»å¡ä¿¡æ¯ |
| | | ServiceSubtaskEntity serviceSubtaskVO = new ServiceSubtaskEntity(); |
| | | serviceSubtaskVO.setPhone(phoneCallReqYQVO.getPhone()); |
| | | serviceSubtaskVO.setType("1"); |
| | | serviceSubtaskVO.setSendstate(2L); |
| | | List<ServiceSubtask> serviceSubtasks = serviceSubtaskMapper.selectServiceSubtaskList(serviceSubtaskVO); |
| | | if (CollectionUtils.isNotEmpty(serviceSubtasks)) { |
| | | ServiceSubtask serviceSubtask = serviceSubtasks.get(0); |
| | | IvrTaskTemplate ivrTaskTemplate = ivrTaskTemplateService.selectIvrTaskTemplateByID(serviceSubtask.getTemplateid()); |
| | | |
| | | //éè¿ä»»å¡æ¨¡æ¿ä¸ç"ç¬¬ä¸æ¬¡é®é¢ç¼å·"è·å第ä¸ä¸ªé®é¢; |
| | | IvrTaskTemplateScript ivrTaskTemplateScript = null; |
| | | IvrTaskTemplateScript ivrTaskTemplateScript1 = new IvrTaskTemplateScript(); |
| | | ivrTaskTemplateScript1.setTemplateID(ivrTaskTemplate.getId()); |
| | | List<IvrTaskTemplateScript> ivrTaskTemplateScripts = iIvrTaskTemplateScriptService.selectIvrTaskTemplateScriptList(ivrTaskTemplateScript1); |
| | | |
| | | for (IvrTaskTemplateScript ivrTaskTemplateScript2 : ivrTaskTemplateScripts) { |
| | | if (ivrTaskTemplate.getFirstQuestionNum() == Long.valueOf(ivrTaskTemplateScript2.getSort())) { |
| | | ivrTaskTemplateScript = ivrTaskTemplateScript2; |
| | | break; |
| | | } |
| | | } |
| | | //è·åå¼åºç½ |
| | | ServiceTask serviceTask = serviceTaskService.selectServiceTaskByTaskid(serviceSubtask.getTaskid()); |
| | | |
| | | phoneCallBackSHVO.setSubId(serviceSubtask.getId()); |
| | | phoneCallBackSHVO.setScriptId(ivrTaskTemplateScript.getId()); |
| | | phoneCallBackSHVO.setSort(ivrTaskTemplateScript.getSort()); |
| | | phoneCallBackSHVO.setTaskTemplateid(ivrTaskTemplateScript.getTemplateID()); |
| | | phoneCallBackSHVO.setScriptContent(serviceTask.getKcb() + "," + ivrTaskTemplateScript.getScriptContent()); |
| | | } |
| | | return phoneCallBackSHVO; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 䏿±ASRç»æå¤ç |
| | | * |
| | | * @param phoneCallResultYQVO |
| | | * @return |
| | | */ |
| | | public PhoneCallBackSHVO processResust(PhoneCallResultYQVO phoneCallResultYQVO) { |
| | | PhoneCallBackSHVO phoneCallBackSHVO = new PhoneCallBackSHVO(); |
| | | //éè¿scriptidï¼è·åææçç»æ |
| | | String url = configService.selectConfigByKey("sys.voice.match.ai.url", phoneCallResultYQVO.getOrgid()); |
| | | ServiceSubtask serviceSubtask = serviceSubtaskMapper.selectServiceSubtaskById(phoneCallResultYQVO.getSubId()); |
| | | IvrTaskTemplate ivrTaskTemplate = ivrTaskTemplateService.selectIvrTaskTemplateByID(serviceSubtask.getTemplateid()); |
| | | IvrTaskTemplateScriptVO ivrTaskTemplateScriptVO = iIvrTaskTemplateScriptService.getTaskTempScriptInfoByid(Long.valueOf(phoneCallResultYQVO.getScriptId())); |
| | | Integer i = matchOptionIndex(url, phoneCallResultYQVO.getScriptContent(), phoneCallResultYQVO.getAsrResult(), ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList(), phoneCallResultYQVO.getUuid()); |
| | | if (i >= 0) { |
| | | String optiondesc = ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(i).getOptiondesc(); |
| | | //å°æ£è
çåçåè¿service_subtask_detailä¸ |
| | | ServiceSubTaskDetailReq serviceSubTaskDetailReq = new ServiceSubTaskDetailReq(); |
| | | List<ServiceSubtaskDetail> serviceSubtaskDetailList = new ArrayList<>(); |
| | | ivrTaskTemplateScriptVO.setQuestionResult(optiondesc); |
| | | |
| | | PhoneCallReqYQVO phoneCallReqYQVO = new PhoneCallReqYQVO(); |
| | | phoneCallReqYQVO.setTaskid("" + serviceSubtask.getId()); |
| | | phoneCallReqYQVO.setPhone(phoneCallResultYQVO.getPhone()); |
| | | phoneCallReqYQVO.setAsrtext(phoneCallResultYQVO.getAsrResult()); |
| | | ServiceSubtaskDetail serviceSubtaskDetail = getServiceSubtaskDetail(phoneCallReqYQVO, ivrTaskTemplateScriptVO, serviceSubtask, ivrTaskTemplate); |
| | | //ä¿®æ¹ä¸ä¸è¯é³è·¯å¾ï¼æ¹æå端å¯ä»¥è®¿é®çï¼åå°æ°æ®åºä¸ï¼ |
| | | if (StringUtils.isNotEmpty(serviceSubtaskDetail.getQuestionvoice())) { |
| | | String questionvoice = serviceSubtaskDetail.getQuestionvoice(); |
| | | String[] split = questionvoice.split("\\\\"); |
| | | if (split.length > 0) { |
| | | String lastPart = split[split.length - 1]; |
| | | serviceSubtaskDetail.setQuestionvoice(voicePathPrefix + lastPart); |
| | | } |
| | | } |
| | | serviceSubtaskDetailList.add(serviceSubtaskDetail); |
| | | serviceSubTaskDetailReq.setServiceSubtaskDetailList(serviceSubtaskDetailList); |
| | | serviceSubTaskDetailReq.setGuid(phoneCallResultYQVO.getGuid()); |
| | | serviceSubTaskDetailReq.setOrgid(phoneCallResultYQVO.getOrgid()); |
| | | saveQuestionAnswerPhone(serviceSubTaskDetailReq); |
| | | |
| | | IvrTaskTemplateScript ivrTaskTemplateScript = new IvrTaskTemplateScript(); |
| | | ivrTaskTemplateScript.setTemplateID(ivrTaskTemplateScriptVO.getTemplateID()); |
| | | List<IvrTaskTemplateScript> ivrTaskTemplateScripts = iIvrTaskTemplateScriptService.selectIvrTaskTemplateScriptList(ivrTaskTemplateScript); |
| | | |
| | | //è·åä¸ä¸é¢ |
| | | for (IvrTaskTemplateScript script : ivrTaskTemplateScripts) { |
| | | if (ivrTaskTemplateScriptVO.getNextScriptno() == null || ivrTaskTemplateScriptVO.getNextScriptno() == 0) { |
| | | ServiceTask serviceTask = serviceTaskService.selectServiceTaskByTaskid(serviceSubtask.getTaskid()); |
| | | phoneCallBackSHVO.setScriptContent(serviceTask.getJsy()); |
| | | phoneCallBackSHVO.setTaskTemplateid(script.getTemplateID()); |
| | | phoneCallBackSHVO.setSort(script.getSort()); |
| | | phoneCallBackSHVO.setScriptId(script.getId()); |
| | | phoneCallBackSHVO.setSubId(serviceSubtask.getId()); |
| | | phoneCallBackSHVO.setStatus("0"); |
| | | } else if (script.getSort() == ivrTaskTemplateScriptVO.getNextScriptno().intValue()) { |
| | | phoneCallBackSHVO.setScriptContent(script.getScriptContent()); |
| | | phoneCallBackSHVO.setTaskTemplateid(script.getTemplateID()); |
| | | phoneCallBackSHVO.setSort(script.getSort()); |
| | | phoneCallBackSHVO.setScriptId(script.getId()); |
| | | phoneCallBackSHVO.setSubId(serviceSubtask.getId()); |
| | | break; |
| | | } |
| | | } |
| | | //æç¼åæ¸
é¤ |
| | | redisCache.deleteObject(phoneCallResultYQVO.getSubId() + "-" + phoneCallResultYQVO.getScriptId()); |
| | | } else { |
| | | //åå°éå¤è¯¢é® |
| | | //è®°å½ä¸ä¸è¿ä¸ªé®é¢è¢«é®é¢çæ¬¡æ° |
| | | Object cacheObject = redisCache.getCacheObject(phoneCallResultYQVO.getSubId() + "-" + phoneCallResultYQVO.getScriptId()); |
| | | if (cacheObject == null || (Integer) cacheObject < ivrTaskTemplate.getMateNum()) { |
| | | |
| | | |
| | | // è·åé项éåä¸ç optiondesc ç¨äºå¼å¯¼æ£è
|
| | | List<IvrTaskTemplateTargetoption> optionList = ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList(); |
| | | String optionDescStr = ""; |
| | | if (optionList != null && !optionList.isEmpty()) { |
| | | optionDescStr = optionList.stream().map(IvrTaskTemplateTargetoption::getTargetvalue).filter(StringUtils::isNotEmpty).collect(Collectors.joining("æ")); |
| | | } |
| | | |
| | | String scriptContent = "请é®" + phoneCallResultYQVO.getScriptContent(); |
| | | if (StringUtils.isNotEmpty(optionDescStr)) { |
| | | scriptContent += "ï¼ä½ å¯ä»¥åçï¼" + optionDescStr; |
| | | } |
| | | phoneCallBackSHVO.setScriptContent(scriptContent); |
| | | phoneCallBackSHVO.setTaskTemplateid(phoneCallResultYQVO.getTaskTemplateid()); |
| | | phoneCallBackSHVO.setSort(phoneCallResultYQVO.getSort()); |
| | | phoneCallBackSHVO.setScriptId(phoneCallResultYQVO.getScriptId()); |
| | | phoneCallBackSHVO.setSubId(phoneCallResultYQVO.getSubId()); |
| | | if (cacheObject == null) |
| | | redisCache.setCacheObject(phoneCallResultYQVO.getSubId() + "-" + phoneCallResultYQVO.getScriptId(), 1, 120, TimeUnit.MINUTES); |
| | | else |
| | | redisCache.setCacheObject(phoneCallResultYQVO.getSubId() + "-" + phoneCallResultYQVO.getScriptId(), (Integer) cacheObject + 1, 120, TimeUnit.MINUTES); |
| | | } else if ((Integer) cacheObject >= ivrTaskTemplate.getMateNum()) { |
| | | //妿已ç»é®äºè§å®æ¬¡æ°ï¼å°±ä¸é®äºï¼ç»§ç»é®ä¸ä¸é¢ï¼è¿ä¸ªè¦åéä¸ä¸ï¼æ¯ç»§ç»é®ä¸ä¸é¢ï¼è¿æ¯åäºï¼æ¯ä¸æ¯è¦å个å¼å
³ï¼ |
| | | IvrTaskTemplateScript ivrTaskTemplateScript = new IvrTaskTemplateScript(); |
| | | ivrTaskTemplateScript.setTemplateID(ivrTaskTemplateScriptVO.getTemplateID()); |
| | | List<IvrTaskTemplateScript> ivrTaskTemplateScripts = iIvrTaskTemplateScriptService.selectIvrTaskTemplateScriptList(ivrTaskTemplateScript); |
| | | //è·åä¸ä¸é¢ |
| | | for (IvrTaskTemplateScript script : ivrTaskTemplateScripts) { |
| | | if (script.getSort() == ivrTaskTemplateScriptVO.getNextScriptno().intValue()) { |
| | | phoneCallBackSHVO.setScriptContent(script.getScriptContent()); |
| | | phoneCallBackSHVO.setTaskTemplateid(script.getTemplateID()); |
| | | phoneCallBackSHVO.setSort(script.getSort()); |
| | | phoneCallBackSHVO.setScriptId(script.getId()); |
| | | phoneCallBackSHVO.setSubId(serviceSubtask.getId()); |
| | | break; |
| | | } |
| | | } |
| | | //æç¼åæ¸
é¤ |
| | | redisCache.deleteObject(phoneCallResultYQVO.getSubId() + "-" + phoneCallResultYQVO.getScriptId()); |
| | | } |
| | | } |
| | | return phoneCallBackSHVO; |
| | | } |
| | | |
| | | |
| | | public PhoneCallBackYQVO AiMatch(String url, PhoneCallReqYQVO phoneCallReqYQVO, PhoneCallBackYQVO phoneCallBackYQVO, IvrTaskTemplateScriptVO ivrTaskTemplateScriptVO, ServiceSubtask serviceSubtask, IvrTaskTemplate ivrTaskTemplate, List<IvrTaskTemplateScript> ivrTaskTemplateScripts, String scriptId, Integer flag, String uuid) { |
| | | PhoneCallBackYQVO back = null; |
| | |
| | | ServiceTaskSchedule schedule = serviceTaskScheduleService.selectByTaskid(serviceTaskVO.getTaskid()); |
| | | if (ObjectUtils.isNotEmpty(schedule)) { |
| | | ServiceTaskScheduleVO serviceTaskScheduleVO = DtoConversionUtils.sourceToTarget(schedule, ServiceTaskScheduleVO.class); |
| | | List<ServiceTaskScheduleDetail> scheduleDetailList = |
| | | serviceTaskScheduleService.selectDetailByScheduleid(schedule.getId()); |
| | | List<ServiceTaskScheduleDetail> scheduleDetailList = serviceTaskScheduleService.selectDetailByScheduleid(schedule.getId()); |
| | | serviceTaskScheduleVO.setDetailList(scheduleDetailList); |
| | | serviceTaskVO.setServiceTaskScheduleVO(serviceTaskScheduleVO); |
| | | } |
| | |
| | | <result property="wardName" column="ward_name"/> |
| | | <result property="deptCode" column="dept_code"/> |
| | | <result property="deptName" column="dept_name"/> |
| | | <result property="taskId" column="task_id"/> |
| | | <result property="subId" column="sub_id"/> |
| | | |
| | | </resultMap> |
| | | |
| | | <sql id="selectServiceOutPathVo"> |
| | |
| | | param3, |
| | | param5, |
| | | param6, |
| | | task_id, |
| | | sub_id, |
| | | create_time, |
| | | update_time, |
| | | radix, |
| | |
| | | <if test="deptName != null and deptName != ''"> |
| | | and dept_name=#{deptName} |
| | | </if> |
| | | <if test="subId != null"> |
| | | and sub_id=#{subId} |
| | | </if> |
| | | <if test="taskId != null"> |
| | | and task_id=#{taskId} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="selectServiceOutPathById" parameterType="Long" |
| | |
| | | </if> |
| | | <if test="deptName != null">dept_name, |
| | | </if> |
| | | |
| | | <if test="subId != null"> |
| | | sub_id, |
| | | </if> |
| | | <if test="taskId != null "> |
| | | task_id, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="param1 != null">#{param1}, |
| | |
| | | <if test="deptCode != null">#{deptCode}, |
| | | </if> |
| | | <if test="deptName != null">#{deptName}, |
| | | </if> |
| | | <if test="subId != null "> |
| | | #{subId}, |
| | | </if> |
| | | <if test="taskId != null "> |
| | | #{taskId}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | |
| | | <if test="deptName != null">dept_name = |
| | | #{deptName}, |
| | | </if> |
| | | <if test="subId != null"> |
| | | sub_id=#{subId}, |
| | | </if> |
| | | <if test="taskId != null"> |
| | | task_id=#{taskId}, |
| | | </if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | |
| | | </if> |
| | | <if test="deptOrDistrict==2"> |
| | | AND (1=1 |
| | | <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0"> |
| | | <if test="leavehospitaldistrictcodes != null"> |
| | | AND leavehospitaldistrictcode IN |
| | | <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" |
| | | separator="," |
| | |
| | | #{leavehospitaldistrictcode} |
| | | </foreach> |
| | | </if> |
| | | <if test=" leaveldeptcodes != null and leaveldeptcodes.size()>0"> |
| | | <if test=" leaveldeptcodes != null"> |
| | | OR deptcode IN |
| | | <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator="," |
| | | close=")"> |
| | |
| | | t.taskid |
| | | </select> |
| | | |
| | | <!-- æ°æ¹æ³ï¼æ ¹æ®åä»»å¡ ID ç»è®¡é®é¢é项ç¾åæ¯ (ç¨äºæ»¡æåº¦ç»è®¡ serviceType=6) --> |
| | | <select id="statQuestionOptionBySubtaskIds" resultType="com.smartor.domain.ServiceSubtaskDetailRatioExport"> |
| | | SELECT |
| | | d.questiontext AS questiontext, |
| | | t.taskid AS taskid, |
| | | t.task_name AS taskName, |
| | | d.asrtext AS optionresult, |
| | | COUNT(*) AS count, |
| | | CONCAT(ROUND(COUNT(*) * 100.0 / t2.total_count, 2), '%') AS ratio |
| | | FROM |
| | | service_task t |
| | | INNER JOIN service_subtask s ON s.taskid = t.taskid |
| | | INNER JOIN service_subtask_detail d ON d.sub_id = s.id |
| | | INNER JOIN ( |
| | | SELECT |
| | | d.questiontext, |
| | | COUNT(*) AS total_count |
| | | FROM |
| | | service_task t |
| | | INNER JOIN service_subtask s ON s.taskid = t.taskid |
| | | INNER JOIN service_subtask_detail d ON d.sub_id = s.id |
| | | WHERE s.id IN |
| | | <foreach collection="subtaskIds" item="subtaskId" open="(" separator="," close=")"> |
| | | #{subtaskId} |
| | | </foreach> |
| | | AND s.sendstate = 6 |
| | | AND d.del_flag=0 |
| | | GROUP BY d.questiontext -- â å
³é®ä¿®æ¹ï¼æé¢ç®åç»ç»è®¡æ¯ä¸ªé¢ç®çæ»æ° |
| | | ) t2 ON t2.questiontext = d.questiontext -- â å
³èå°å½åé¢ç® |
| | | WHERE s.id IN |
| | | <foreach collection="subtaskIds" item="subtaskId" open="(" separator="," close=")"> |
| | | #{subtaskId} |
| | | </foreach> |
| | | AND s.sendstate = 6 |
| | | AND d.del_flag=0 |
| | | <if test="startOutHospTime != null"> |
| | | AND date_format(s.endtime,'%y%m%d') >= date_format(#{startOutHospTime},'%y%m%d') |
| | | </if> |
| | | <if test="endOutHospTime != null"> |
| | | AND date_format(s.endtime,'%y%m%d') <= date_format(#{endOutHospTime},'%y%m%d') |
| | | </if> |
| | | GROUP BY |
| | | t.taskid, |
| | | d.questiontext, |
| | | d.asrtext |
| | | ORDER BY |
| | | d.questiontext, |
| | | t.taskid |
| | | </select> |
| | | |
| | | <select id="selectServiceSubtaskListDeadLine" parameterType="com.smartor.domain.entity.ServiceSubtaskEntity" |
| | | resultMap="ServiceSubtaskResult"> |
| | | <include refid="selectServiceSubtaskVo"/> |