陈昶聿
4 天以前 d5786f308379f037bfa959df805a34880d52d97c
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceOutPathController.java
@@ -11,9 +11,11 @@
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.smartor.domain.BaseOrganization;
import com.smartor.domain.PatArchive;
import com.smartor.domain.ServiceOutPath;
import com.smartor.domain.ServiceTask;
import com.smartor.service.IBaseOrganizationService;
import com.smartor.service.IPatArchiveService;
import com.smartor.service.IServiceOutPathService;
import com.smartor.service.IServiceTaskService;
import io.swagger.annotations.Api;
@@ -42,6 +44,9 @@
    @Autowired
    private IServiceTaskService serviceTaskService;
    @Autowired
    IPatArchiveService patArchiveService;
    @Autowired
    private IBaseOrganizationService baseOrganizationService;
@@ -79,24 +84,26 @@
            ServiceOutPath serviceOutPath1 = list.get(0);
            serviceOutPath1.setId(null);
            serviceOutPath1.setRadix(null);
            //根据taskid获取机构信息
            if(StringUtils.isNotEmpty(serviceOutPath1.getParam1())){
                Long taskId = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceOutPath1.getParam1(), pri_key));
                if(ObjectUtils.isNotEmpty(taskId)){
                    ServiceTask serviceTask = serviceTaskService.selectServiceTaskByTaskid(taskId);
                    String orgId = serviceTask.getOrgid();
                    if(StringUtils.isNotEmpty(orgId)){
                        BaseOrganization baseOrganization = new BaseOrganization();
                        baseOrganization.setOrgid(orgId);
                        List<BaseOrganization> orgs = baseOrganizationService.selectBaseOrganizationList(baseOrganization);
                        if(CollectionUtils.isNotEmpty(orgs)){
                            String orgname = orgs.get(0).getOrganizationName();
                            serviceOutPath1.setOrgid(orgId);
                            serviceOutPath1.setOrgname(orgname);
                        }
                    }
            if(StringUtils.isNotEmpty(serviceOutPath1.getOrgid())){
                String orgId = serviceOutPath1.getOrgid();
                BaseOrganization baseOrganization = new BaseOrganization();
                baseOrganization.setOrgid(orgId);
                List<BaseOrganization> orgs = baseOrganizationService.selectBaseOrganizationList(baseOrganization);
                if(CollectionUtils.isNotEmpty(orgs)){
                    String orgname = orgs.get(0).getOrganizationName();
                    serviceOutPath1.setOrgid(orgId);
                    serviceOutPath1.setOrgname(orgname);
                }
            }
            if(StringUtils.isNotEmpty(serviceOutPath1.getParam2())){
                RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample();
                Long patId = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceOutPath1.getParam2(), pri_key));
                if(patId != null){
                    PatArchive patArchive = patArchiveService.selectPatArchiveByPatid(patId);
                    serviceOutPath1.setPatArchive(patArchive);
                }
            }
            return success(serviceOutPath1);
        }
        return success(null);