陈昶聿
2 天以前 e32414ce775fefdd0602ac96c218c4f0758f7033
smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
@@ -6,6 +6,7 @@
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.dx.MessageSend;
import com.ruoyi.common.exception.base.BaseException;
@@ -177,6 +178,8 @@
    @Autowired
    private IPatMedOuthospService patMedOuthospService;
    @Autowired
    private SysDept2Mapper sysDept2Mapper;
    @Value("${spring.profiles.active}")
    private String active;
@@ -404,8 +407,8 @@
            if (serviceSubtaskRes.getSendstate() == 6) serviceSubtaskRes.setSendstateView(2L);
            if (serviceSubtaskRes.getSendstate() == 4) serviceSubtaskRes.setSendstateView(3L);
            // 填充当前补偿
            if (StringUtils.isEmpty(serviceSubtask.getCurrentPreachform())){
                if(StringUtils.isNotEmpty(serviceSubtask.getPreachform())){
            if (StringUtils.isEmpty(serviceSubtask.getCurrentPreachform())) {
                if (StringUtils.isNotEmpty(serviceSubtask.getPreachform())) {
                    //默认取第一个
                    serviceSubtaskRes.setCurrentPreachform(serviceSubtask.getPreachform().split(",")[0]);
                }
@@ -685,7 +688,10 @@
                serviceTask.setTemplatename(tempName);
            }
            serviceTask.setLeaveldeptcodes(serviceTaskVO.getLeaveldeptcodes());
            serviceTask.setLeavehospitaldistrictcode(serviceTask.getLeavehospitaldistrictcode());
            if (StringUtils.isEmpty(serviceTask.getLeavehospitaldistrictname()) && StringUtils.isNotEmpty(serviceTask.getLeavehospitaldistrictcode())) {
                SysDept sysDept = sysDept2Mapper.selectDeptByCode(serviceTask.getLeavehospitaldistrictcode(), null);
                serviceTask.setLeavehospitaldistrictname(sysDept.getDeptName());
            }
            if (serviceTaskVO.getLongTask() == 1) serviceTask.setSendState(2L);
            serviceTask.setCreateTime(new Date());
            serviceTask.setUpdateTime(new Date());
@@ -711,8 +717,8 @@
                    //南华附一的icd10code是有重复的,所以不能用南华附一的icd10code去查询
                    log.info("----serviceTaskdiag的值为:{}", serviceTaskdiag);
                    if (!StringUtils.isEmpty(serviceTaskVO.getIcd10name())) {
                        String[] Icd10Names = serviceTaskVO.getIcd10name().split("$");
                        String[] Icd10codes = serviceTaskVO.getIcd10code().split("$");
                        String[] Icd10Names = serviceTaskVO.getIcd10name().split(",");
                        String[] Icd10codes = serviceTaskVO.getIcd10code().split(",");
                        for (int i = 0; i < Icd10Names.length; i++) {
                            serviceTaskdiag.setIcd10code(Icd10codes[i]);
                            serviceTaskdiag.setIcd10name(Icd10Names[i]);
@@ -2360,7 +2366,6 @@
            serviceSubtask.setRemark("电话接通成功,患者拒绝随访");
            serviceSubtask.setId(Long.valueOf(phoneCallRecordVO.getTaskid()));
            serviceSubtask.setSendstate(6L);
            serviceSubtask.setFinishtime(new Date());
            serviceSubtaskMapper.updateServiceSubtask(serviceSubtask);
//            int startIndex = phoneCallRecordVO.getRecord_path().indexOf("voice") + "voice".length() + 1;  // 加1是跳过/符号
//            int endIndex = phoneCallRecordVO.getRecord_path().lastIndexOf("/");
@@ -3699,7 +3704,7 @@
        Map<String, String> map = new HashMap<>();
        map.put("phone", serviceSubtask.getPhone());
        map.put("content", sendMagParam.getContent());
        String result = HttpUtil.postJsonRequest(xhsmsPath, new Gson().toJson(map));
        HttpUtil.postJsonRequest(xhsmsPath, new Gson().toJson(map));
        redisCache.setCacheObject(subTaskId + "recordAccept-hungup", "1", 10, TimeUnit.MINUTES);
        if (StringUtils.isNotEmpty(serviceSubtask.getRemark()))
            serviceSubtask.setRemark("电话发送拒接,短信补偿发送成功");
@@ -4536,6 +4541,23 @@
    @Override
    public List<ServiceSubtask> gethelibraryCountHyperlink(HeLibraryCountVO heLibraryCountVO){
        String hyperLinkInfoType = heLibraryCountVO.getHyperLinkInfoType();
        if(StringUtils.isNotEmpty(hyperLinkInfoType)){
            heLibraryCountVO.setSendstate(null);
            heLibraryCountVO.setIsFinished(null);
            switch (hyperLinkInfoType) {
                case "totalCountInfo":
                    break;
                case "sendSuccessCountInfo":
                    heLibraryCountVO.setSendstate(6L);
                    break;
                case "readCountInfo":
                    heLibraryCountVO.setIsFinished("1");
                    break;
                default:
                    break;
            }
        }
        List<ServiceSubtask> serviceSubtasks = serviceSubtaskMapper.gethelibraryCountHyperlink(heLibraryCountVO);
        return serviceSubtasks;
    }
@@ -4596,8 +4618,8 @@
    }
    @Override
    public List<ServiceSubtaskDetailRatioExport> statQuestionOption(List<Long> taskIds) {
        return serviceSubtaskMapper.statQuestionOption(taskIds);
    public List<ServiceSubtaskDetailRatioExport> statQuestionOption(List<Long> taskIds, Date startOutHospTime, Date endOutHospTime) {
        return serviceSubtaskMapper.statQuestionOption(taskIds, startOutHospTime, endOutHospTime);
    }
    private Boolean saveServiceSubtaskDetail(ServiceSubtask serviceSubtask) {