Search in sources :

Example 51 with AppService

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

the class CertificationChargingServiceImplTest method testOne.

@Test
public void testOne() {
    try {
        cacheCustomer.initChargeRule();
        String appid = "d2371e070dd544";
        String appserviceId = "111111111";
        ApplicationInfo applicationInfo = CertificationChargingService.getApplicationInfoByAppId(appid);
        AppService appService = CertificationChargingService.getAppServiceByAppServiceId(appserviceId);
        boolean flag = CertificationChargingService.checkTransInfo(appid, appserviceId, applicationInfo, appService);
        Map<String, Object> retMap = new HashMap<String, Object>();
        if (flag) {
            retMap = CertificationChargingService.charging(appid, appserviceId, "测试交易表名1", 1L, applicationInfo, appService, 1L, "11");
            Integer retCode = (Integer) retMap.get("retCode");
            synchronized (SUCCESS_COUNT) {
                // 给SUCCESS_COUNT加上同步锁,避免计数不准确
                if (retCode == 1) {
                    SUCCESS_COUNT = SUCCESS_COUNT + 1;
                } else {
                    System.out.println("失败:" + retMap.get("retMsg"));
                }
            }
        }
    } catch (Exception e) {
        System.out.println("出现异常:" + e.getMessage());
    }
}
Also used : AppService(com.itrus.portal.db.AppService) HashMap(java.util.HashMap) ApplicationInfo(com.itrus.portal.db.ApplicationInfo) AbstractTest(com.itrus.portal.abstracttest.test.AbstractTest) Test(org.junit.Test)

Example 52 with AppService

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

the class CertificationChargingServiceImplTest method test.

public void test() {
    cacheCustomer.initChargeRule();
    String appid = "d2371e070dd544";
    String appserviceId = "111111111";
    ApplicationInfo applicationInfo = CertificationChargingService.getApplicationInfoByAppId(appid);
    AppService appService = CertificationChargingService.getAppServiceByAppServiceId(appserviceId);
    boolean flag = CertificationChargingService.checkTransInfo(appid, appserviceId, applicationInfo, appService);
    System.out.println(flag);
    Map<String, Object> retMap = new HashMap<String, Object>();
    if (flag) {
        retMap = CertificationChargingService.charging(appid, appserviceId, "测试交易表名1", 1L, applicationInfo, appService, 1L, "11");
    }
}
Also used : AppService(com.itrus.portal.db.AppService) HashMap(java.util.HashMap) ApplicationInfo(com.itrus.portal.db.ApplicationInfo)

Example 53 with AppService

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

the class StoreCharingServiceTest method storeChargingTest.

@Test
public void storeChargingTest() {
    try {
        cacheCustomer.initChargeRule();
        String appid = "8356e077dc6f45";
        String appserviceId = "cz0001";
        ApplicationInfo applicationInfo = CertificationChargingService.getApplicationInfoByAppId(appid);
        AppService appService = CertificationChargingService.getAppServiceByAppServiceId(appserviceId);
        Map<String, Object> retMap = new HashMap<String, Object>();
        // retMap = storeChargingService.storeCharging("11", 11L, applicationInfo, appService, 11L, "", 0, 1, true);
        System.out.println(retMap);
    } catch (Exception e) {
        System.out.println("出现异常:" + e.getMessage());
    }
}
Also used : AppService(com.itrus.portal.db.AppService) HashMap(java.util.HashMap) ApplicationInfo(com.itrus.portal.db.ApplicationInfo) AbstractTest(com.itrus.portal.abstracttest.test.AbstractTest) Test(org.junit.Test)

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