Search in sources :

Example 26 with AppService

use of com.itrus.portal.db.AppService in project portal by ixinportal.

the class CertificationChargingServiceImpl method getAppServiceByAppServiceId.

/**
 * 根据appServiceId获取AppService
 *
 * @param appServiceId
 * @return
 */
public AppService getAppServiceByAppServiceId(String appServiceId) {
    AppService appService = new AppService();
    AppServiceExample ase = new AppServiceExample();
    AppServiceExample.Criteria criteria = ase.or();
    criteria.andAppServiceIdEqualTo(appServiceId);
    appService = sqlSession.selectOne("com.itrus.portal.db.AppServiceMapper.selectByExample", ase);
    return appService;
}
Also used : AppService(com.itrus.portal.db.AppService) AppServiceExample(com.itrus.portal.db.AppServiceExample)

Example 27 with AppService

use of com.itrus.portal.db.AppService in project portal by ixinportal.

the class QueueService method run.

@Override
public void run() {
    boolean isException = false;
    while (true) {
        log.debug("execute run,the queue size is [" + OBJECT_QUEUE.size() + "]");
        if (OBJECT_QUEUE.isEmpty()) {
            try {
                // 若队列中没有信息则等待十秒
                sleep(10 * 1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            continue;
        }
        log.debug("execute run,the queue size is [" + OBJECT_QUEUE.size() + "]");
        Map<String, RealNameRecord> realMap = new HashMap<String, RealNameRecord>();
        Map<String, PersonalName> perMap = new HashMap<String, PersonalName>();
        // for (int i = 0; !OBJECT_QUEUE.isEmpty() && i < 500; i++) {
        Object obj = OBJECT_QUEUE.poll();
        if (obj instanceof Map) {
            if ((RealNameRecord) ((Map) obj).get("realNameRecord") != null) {
                realMap.put("realNameRecord", (RealNameRecord) ((Map) obj).get("realNameRecord"));
            }
            if ((PersonalName) ((Map) obj).get("personalName") != null) {
                perMap.put("personalName", (PersonalName) ((Map) obj).get("personalName"));
            }
        }
        // 存储企业路径
        if (!realMap.isEmpty()) {
            try {
                RealNameRecord realNameRecord = (RealNameRecord) ((Map) obj).get("realNameRecord");
                log.error("【认证信息入库】 企业名称 :" + realNameRecord.getCompanyname() + ",入库时间 :" + new Date());
                sqlSession.insert("com.itrus.portal.db.RealNameRecordMapper.insert", realNameRecord);
                Agentinformation agentinformation = (Agentinformation) ((Map) obj).get("agentinformation");
                if (agentinformation != null) {
                    agentinformation.setRealNameRecord(realNameRecord.getId());
                    sqlSession.insert("com.itrus.portal.db.AgentinformationMapper.insert", agentinformation);
                    realNameRecord.setAgentinformation(agentinformation.getId());
                }
                ApplicationInfo applicationInfo = (ApplicationInfo) ((Map) obj).get("applicationInfo");
                AppService appService = (AppService) ((Map) obj).get("appService");
                // 计费 appId serviceCode 服务类别,二选一(企业为1,个人为2) 调用前还是调用后
                Map<String, Object> cert = certificationChargingService.charging(applicationInfo.getAppId(), appService.getAppServiceId(), appService.getServiceConfigName(), appService.getServiceConfigId(), applicationInfo, appService, realNameRecord.getId(), "RealNameRecord");
                if ((int) cert.get("retCode") != 1) {
                    // 错误
                    realNameRecord.setServicestate(1L);
                }
                realNameRecord.setReturntime(new Date());
                sqlSession.update("com.itrus.portal.db.RealNameRecordMapper.updateByPrimaryKeySelective", realNameRecord);
            } catch (Exception e) {
                isException = true;
                // 将错误信息显示,不进行操作
                log.error(e);
            }
        }
        // 存储个人记录
        if (!perMap.isEmpty()) {
            try {
                PersonalName personalName = (PersonalName) ((Map) obj).get("personalName");
                log.error("【认证信息入库】 名称 :" + personalName.getName() + ",入库时间 :" + new Date());
                sqlSession.insert("com.itrus.portal.db.PersonalNameMapper.insert", personalName);
                ApplicationInfo applicationInfo = (ApplicationInfo) ((Map) obj).get("applicationInfo");
                AppService appService = (AppService) ((Map) obj).get("appService");
                // 计费 appId code 服务类别,二选一(企业为1,个人为2) 调用前还是调用后
                Map<String, Object> cert = certificationChargingService.charging(applicationInfo.getAppId(), appService.getAppServiceId(), appService.getServiceConfigName(), appService.getServiceConfigId(), applicationInfo, appService, personalName.getId(), "PersonalName");
                if ((int) cert.get("retCode") != 1) {
                    // 错误
                    personalName.setServicestate(1);
                }
                personalName.setReturntime(new Date());
                sqlSession.update("com.itrus.portal.db.PersonalNameMapper.updateByPrimaryKeySelective", personalName);
            } catch (Exception e) {
                isException = true;
                // 将错误信息显示,不进行操作
                log.error(e);
            }
        }
        log.debug("the exception is [" + isException + "]");
        // 若出现异常则暂停10秒钟
        if (isException) {
            try {
                // 若队列中没有信息则等待十秒
                sleep(10 * 1000);
            } catch (InterruptedException e) {
                log.error(e);
            } finally {
                isException = false;
            }
        }
    }
}
Also used : AppService(com.itrus.portal.db.AppService) HashMap(java.util.HashMap) ApplicationInfo(com.itrus.portal.db.ApplicationInfo) RealNameRecord(com.itrus.portal.db.RealNameRecord) Date(java.util.Date) Agentinformation(com.itrus.portal.db.Agentinformation) PersonalName(com.itrus.portal.db.PersonalName) HashMap(java.util.HashMap) Map(java.util.Map)

Example 28 with AppService

use of com.itrus.portal.db.AppService in project portal by ixinportal.

the class PersonalServiceAuthenticationController method updateForm.

// 返回修改页面
@RequestMapping(value = "/{id}", params = "form", produces = "text/html")
public String updateForm(@PathVariable("id") Long id, Model uiModel) {
    PersonalServiceAuthentication personalServiceAuthentication = personalServiceAuthenticationService.selectById(id);
    uiModel.addAttribute("personalServiceAuthentication", personalServiceAuthentication);
    AppService appService = appServiceImpl.selectById(personalServiceAuthentication.getAppService());
    uiModel.addAttribute("appService", appService);
    return "personalserviceauthentication/update";
}
Also used : PersonalServiceAuthentication(com.itrus.portal.db.PersonalServiceAuthentication) AppService(com.itrus.portal.db.AppService) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 29 with AppService

use of com.itrus.portal.db.AppService in project portal by ixinportal.

the class RealNameCordController method show.

// 显示详情
@RequestMapping(value = "/{id}", produces = "text/html")
public String show(@PathVariable("id") Long id, Model uiModel) {
    RealNameRecord realName = realnameservice.selectById(id);
    uiModel.addAttribute("realName", realName);
    AppServiceAuthentication appServiceauthentication = appServiceAuthenticationService.selectById(realName.getAppServiceAuthentication());
    uiModel.addAttribute("appServiceauthentication", appServiceauthentication);
    AppService appService = appServiceImpl.selectById(appServiceauthentication.getAppService());
    uiModel.addAttribute("appService", appService);
    /*
		 * LicenseinformationExample licensecriteria = new
		 * LicenseinformationExample(); LicenseinformationExample.Criteria
		 * licenseinformation=licensecriteria.or();
		 * licenseinformation.andRealNameRecordEqualTo(id);
		 * List<Licenseinformation> sysRess= sqlSession.selectList(
		 * "com.itrus.portal.db.LicenseinformationMapper.selectByExample",
		 * licensecriteria);
		 */
    Licenseinformation licen = sqlSession.selectOne("com.itrus.portal.db.LicenseinformationMapper.selectByPrimaryKey", realName.getLicenseinformation());
    String ss = appServiceauthentication.getServiceAuthenticationItem();
    /*
		 * OrganizationExample organition = new OrganizationExample();
		 * OrganizationExample.Criteria organitonex=organition.or();
		 * organitonex.andRealNameRecordEqualTo(id); List<Organization> organ=
		 * sqlSession.selectList(
		 * "com.itrus.portal.db.OrganizationMapper.selectByExample",
		 * organition);
		 */
    Organization orgen = sqlSession.selectOne("com.itrus.portal.db.OrganizationMapper.selectByPrimaryKey", realName.getOrganization());
    /*
		 * CorporateinformationExample corporatein = new
		 * CorporateinformationExample(); CorporateinformationExample.Criteria
		 * corporateinform=corporatein.or();
		 * corporateinform.andRealNameRecordEqualTo(id);
		 * List<Corporateinformation> cor= sqlSession.selectList(
		 * "com.itrus.portal.db.CorporateinformationMapper.selectByExample",
		 * corporatein);
		 */
    Corporateinformation core = sqlSession.selectOne("com.itrus.portal.db.CorporateinformationMapper.selectByPrimaryKey", realName.getCorporateinformation());
    /*
		 * AgentinformationExample agentinformation = new
		 * AgentinformationExample(); AgentinformationExample.Criteria
		 * agentincrite=agentinformation.or();
		 * agentincrite.andRealNameRecordEqualTo(id); List<Agentinformation> age
		 * = null; age= sqlSession.selectList(
		 * "com.itrus.portal.db.AgentinformationMapper.selectByExample",
		 * agentinformation);
		 */
    Agentinformation agee = sqlSession.selectOne("com.itrus.portal.db.AgentinformationMapper.selectByPrimaryKey", realName.getAgentinformation());
    /*
		 * EnterprisebankExample enterise = new EnterprisebankExample();
		 * EnterprisebankExample.Criteria enterpr=enterise.or();
		 * enterpr.andRealNameRecordEqualTo(id); List<Enterprisebank> ent=
		 * sqlSession.selectList(
		 * "com.itrus.portal.db.EnterprisebankMapper.selectByExample",
		 * enterise);
		 */
    Enterprisebank entt = sqlSession.selectOne("com.itrus.portal.db.EnterprisebankMapper.selectByPrimaryKey1", realName.getEnterprisebank());
    if (null != ss && "" != ss) {
        if (ss.indexOf("1") != -1) {
            uiModel.addAttribute("licenseinformation", licen);
        } else {
            uiModel.addAttribute("licenseinformation", 1);
        }
        if (ss.indexOf("2") != -1) {
            uiModel.addAttribute("organition", orgen);
        } else {
            uiModel.addAttribute("organition", 1);
        }
        if (ss.indexOf("3") != -1) {
            uiModel.addAttribute("corporateinformation", core);
        } else {
            uiModel.addAttribute("corporateinformation", 1);
        }
        if (ss.indexOf("4") != -1) {
            uiModel.addAttribute("corporateinformatio", core);
        } else {
            uiModel.addAttribute("corporateinformatio", 1);
        }
        if (ss.indexOf("5") != -1) {
            uiModel.addAttribute("agentinformation", agee);
        } else {
            uiModel.addAttribute("agentinformation", 1);
        }
        if (ss.indexOf("6") != -1) {
            uiModel.addAttribute("agentinformatio", agee);
        } else {
            uiModel.addAttribute("agentinformatio", 1);
        }
        if (ss.indexOf("7") != -1) {
            uiModel.addAttribute("enterprise", entt);
        } else if (ss.indexOf("8") != -1) {
            uiModel.addAttribute("enterprise", entt);
        } else {
            uiModel.addAttribute("enterprise", 1);
        }
    }
    ApplicationInfo applicationInfo = applicationInfoService.selectById(realName.getApplicationInfo());
    uiModel.addAttribute("applicationInfo", applicationInfo);
    return "realnamerecord/show";
}
Also used : AppServiceAuthentication(com.itrus.portal.db.AppServiceAuthentication) Licenseinformation(com.itrus.portal.db.Licenseinformation) AppService(com.itrus.portal.db.AppService) Organization(com.itrus.portal.db.Organization) Agentinformation(com.itrus.portal.db.Agentinformation) ApplicationInfo(com.itrus.portal.db.ApplicationInfo) Corporateinformation(com.itrus.portal.db.Corporateinformation) RealNameRecord(com.itrus.portal.db.RealNameRecord) Enterprisebank(com.itrus.portal.db.Enterprisebank) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 30 with AppService

use of com.itrus.portal.db.AppService in project portal by ixinportal.

the class AppServiceAuthenticationController method delete.

// 删除处理
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE, produces = "text/html")
@ResponseBody
public String delete(@PathVariable("id") Long id, HttpServletRequest request, Model uiModel) {
    AppServiceAuthentication appServiceAuthentication = appServiceAuthenticationService.selectById(id);
    if (appServiceAuthentication == null) {
        // uiModel.addAttribute("message", "未找到要删除的实名认证服务");
        return "未找到要删除的实名认证服务";
    }
    AppService appService = appServiceImpl.selectById(appServiceAuthentication.getAppService());
    int count = appServiceImpl.selectAppInfoConuntById(appService.getId());
    if (count > 0) {
        // uiModel.addAttribute("message", "此条服务与计费配置存在关联,不能删除");
        return "此条服务与计费配置存在关联,不能删除";
    }
    try {
        appServiceAuthenticationService.deleteAppServiceAuthentication(appService.getId(), appServiceAuthentication.getId());
        String oper = "删除实名认证服务(企业)";
        String info = "实名认证服务名称: " + appService.getAppServiceName();
        LogUtil.adminlog(sqlSession, oper, info);
        return null;
    } catch (Exception e) {
        // + "】存在关联,无法删除");
        return "要删除应用【" + appService.getAppServiceName() + "】存在关联,无法删除";
    }
}
Also used : AppServiceAuthentication(com.itrus.portal.db.AppServiceAuthentication) AppService(com.itrus.portal.db.AppService) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Aggregations

AppService (com.itrus.portal.db.AppService)53 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)34 HashMap (java.util.HashMap)25 ApplicationInfo (com.itrus.portal.db.ApplicationInfo)19 Date (java.util.Date)16 EvidenceBasicInformation (com.itrus.portal.db.EvidenceBasicInformation)13 ArrayList (java.util.ArrayList)12 AppServiceExample (com.itrus.portal.db.AppServiceExample)10 EvidenceOutServiceConfig (com.itrus.portal.db.EvidenceOutServiceConfig)9 EvidenceSaveService (com.itrus.portal.db.EvidenceSaveService)9 EvidenceEnclosure (com.itrus.portal.db.EvidenceEnclosure)8 IOException (java.io.IOException)8 List (java.util.List)8 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)8 JSONObject (com.alibaba.fastjson.JSONObject)7 AppServiceAuthentication (com.itrus.portal.db.AppServiceAuthentication)7 EvidenceEnclosureExample (com.itrus.portal.db.EvidenceEnclosureExample)6 EvidenceHisCertificate (com.itrus.portal.db.EvidenceHisCertificate)6 Map (java.util.Map)6 EvidenceHisRelationship (com.itrus.portal.db.EvidenceHisRelationship)5