Search in sources :

Example 16 with AppService

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

the class ApplicationInfoController method List.

// 列表所有信息
@RequestMapping(produces = "text/html")
public String List(@RequestParam(required = false, value = "aId") Long aId, @RequestParam(required = false, value = "queryDate1") Date queryDate1, @RequestParam(required = false, value = "queryDate2") Date queryDate2, @RequestParam(required = false, value = "serviceItem") Long serviceItem, @RequestParam(required = false, value = "page") Integer page, @RequestParam(required = false, value = "size") Integer size, Model uiModel) {
    // 补全日期
    if (queryDate1 == null && queryDate2 == null) {
        Calendar calendar = Calendar.getInstance();
        calendar.add(Calendar.DATE, 1);
        calendar.set(Calendar.HOUR_OF_DAY, 0);
        calendar.set(Calendar.MINUTE, 0);
        calendar.set(Calendar.SECOND, 0);
        calendar.set(Calendar.MILLISECOND, 0);
        calendar.add(Calendar.MILLISECOND, -1);
        queryDate2 = calendar.getTime();
        calendar.add(Calendar.MILLISECOND, 1);
        calendar.add(Calendar.MONTH, -1);
        queryDate1 = calendar.getTime();
    }
    // page,size
    if (page == null || page < 1)
        page = 1;
    if (size == null || size < 1)
        size = 10;
    // query data
    Integer offset = size * (page - 1);
    ApplicationInfoExample appExample = new ApplicationInfoExample();
    ApplicationInfoExample.Criteria ae = appExample.createCriteria();
    if (aId != null && aId != 0) {
        ae.andIdEqualTo(aId);
    }
    if (null != queryDate1) {
        ae.andCreateTimeGreaterThanOrEqualTo(queryDate1);
    }
    if (null != queryDate2) {
        ae.andCreateTimeLessThanOrEqualTo(queryDate2);
    }
    if (serviceItem != null && serviceItem != 0) {
        ae.andAppServiceItemsLike("%" + serviceItem.toString() + "%");
    }
    appExample.setOrderByClause("create_time desc");
    appExample.setOffset(offset);
    appExample.setLimit(size);
    List applicationInfoList = applicationInfoService.selectByExample(appExample);
    uiModel.addAttribute("applicationInfoList", applicationInfoList);
    Integer count = applicationInfoService.countByExample(appExample);
    uiModel.addAttribute("count", count);
    uiModel.addAttribute("pages", (count + size - 1) / size);
    // page, size
    if (page > 1 && size * (page - 1) >= count) {
        page = (count + size - 1) / size;
    }
    uiModel.addAttribute("page", page);
    uiModel.addAttribute("size", size);
    uiModel.addAttribute("aId", aId);
    uiModel.addAttribute("queryDate1", queryDate1);
    uiModel.addAttribute("queryDate2", queryDate2);
    uiModel.addAttribute("serviceItem", serviceItem);
    List applicationInfos = applicationInfoService.selectByExample(new ApplicationInfoExample());
    uiModel.addAttribute("applicationInfos", applicationInfos);
    Map<Long, AppService> appServices = appService.selectMapByExample();
    uiModel.addAttribute("appServices", appServices);
    return "applicationinfo/list";
}
Also used : ApplicationInfoExample(com.itrus.portal.db.ApplicationInfoExample) AppService(com.itrus.portal.db.AppService) Calendar(java.util.Calendar) List(java.util.List) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 17 with AppService

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

the class CertificationChargingController method show.

// 根据应用id,查询应用下的所有计费规则信息
@RequestMapping(value = "/show/{id}")
public String show(@PathVariable("id") Long id, Model uiModel, HttpServletRequest request) {
    ApplicationInfo applicationInfo = sqlSession.selectOne("com.itrus.portal.db.ApplicationInfoMapper.selectByPrimaryKey", id);
    uiModel.addAttribute("applicationInfo", applicationInfo);
    // 系统配置的实名认证服务集合
    List<AppService> appServices = new ArrayList<AppService>();
    AppServiceExample appServiceExample = new AppServiceExample();
    AppServiceExample.Criteria criteria = appServiceExample.or();
    criteria.andTypeEqualTo(ComNames.SERVICE_TYPE_CERTIFICATION);
    appServices = sqlSession.selectList("com.itrus.portal.db.AppServiceMapper.selectByExample", appServiceExample);
    uiModel.addAttribute("appServices", appServices);
    List<CertificationCharging> certificationChargings = new ArrayList<CertificationCharging>();
    certificationChargings = certificationChargingService.selectList(id, ComNames.CHARGING_TYPE_SMRZ_1);
    CertificationChargingWrap certificationChargingWrap = new CertificationChargingWrap();
    List<CertificationChargingList> certificationChargingLists = new ArrayList<CertificationChargingList>();
    for (int i = 0; i < certificationChargings.size(); i++) {
        CertificationChargingList certificationChargingList = new CertificationChargingList();
        List<ServiceName> serviceNames = new ArrayList<ServiceName>();
        serviceNames = serviceNameService.selectListByCertificationCharging(certificationChargings.get(i));
        List<ServiceNameList> serviceNameLists = new ArrayList<ServiceNameList>();
        for (int j = 0; j < serviceNames.size(); j++) {
            List<ChargingPrice> chargingPrices = chargingPriceService.selectListByOneServiceName(serviceNames.get(j));
            ServiceNameList serviceNameList = new ServiceNameList();
            ChargingPriceList chargingPriceList = new ChargingPriceList();
            // 1
            chargingPriceList.setChargingPriceLists(chargingPrices);
            // 2
            serviceNameList.setServiceName(serviceNames.get(j));
            serviceNameList.setChargingPriceList(chargingPriceList);
            serviceNameLists.add(serviceNameList);
        }
        certificationChargingList.setCertificationCharging(certificationChargings.get(i));
        certificationChargingList.setServiceNameLists(serviceNameLists);
        certificationChargingLists.add(certificationChargingList);
    }
    certificationChargingWrap.setCertificationChargingLists(certificationChargingLists);
    uiModel.addAttribute("ccw", certificationChargingWrap);
    Map<Long, AppService> appServiceMap = sqlSession.selectMap("com.itrus.portal.db.AppServiceMapper.selectByExample", null, "id");
    uiModel.addAttribute("appServiceMap", appServiceMap);
    // 返回页面上的表单数据
    returnParam(request, uiModel);
    return "certificationcharging/show";
}
Also used : ServiceNameList(com.itrus.portal.entity.ServiceNameList) AppService(com.itrus.portal.db.AppService) CertificationCharging(com.itrus.portal.db.CertificationCharging) ApplicationInfo(com.itrus.portal.db.ApplicationInfo) ArrayList(java.util.ArrayList) ChargingPriceList(com.itrus.portal.entity.ChargingPriceList) CertificationChargingList(com.itrus.portal.entity.CertificationChargingList) AppServiceExample(com.itrus.portal.db.AppServiceExample) CertificationChargingWrap(com.itrus.portal.entity.CertificationChargingWrap) ServiceName(com.itrus.portal.db.ServiceName) ChargingPrice(com.itrus.portal.db.ChargingPrice) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 18 with AppService

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

the class RealNameCordController method list.

// 列表所有信息
@RequestMapping(produces = "text/html")
public String list(@RequestParam(value = "applyname", required = false) String applyname, @RequestParam(value = "queryDate1", required = false) Date queryDate1, @RequestParam(value = "queryDate2", required = false) Date queryDate2, @RequestParam(value = "serialnumber", required = false) String serialnumber, @RequestParam(value = "authenticationstatus", required = false) String authenticationstatus, @RequestParam(value = "rservicename", required = false) String rservicename, @RequestParam(value = "marking", required = false) String marking, @RequestParam(value = "companyname", required = false) String companyname, @RequestParam(value = "queryDate11", required = false) Date queryDate11, @RequestParam(value = "queryDate22", required = false) Date queryDate22, @RequestParam(value = "servicestate", required = false) Integer servicestate, @RequestParam(value = "page", required = false) Integer page, @RequestParam(value = "size", required = false) Integer size, @RequestParam(value = "applyname1", required = false) String applyname1, @RequestParam(value = "serialnumber1", required = false) String serialnumber1, @RequestParam(value = "usageCode", required = false) String usageCode, @RequestParam(value = "serviceAuthenticationItem", required = false) String serviceAuthenticationItem, @RequestParam(value = "queryDate3", required = false) Date queryDate3, @RequestParam(value = "queryDate4", required = false) Date queryDate4, @RequestParam(value = "queryDate33", required = false) Date queryDate33, @RequestParam(value = "queryDate44", required = false) Date queryDate44, @RequestParam(value = "pname", required = false) String pname, @RequestParam(value = "idnumber", required = false) String idnumber, @RequestParam(value = "servicestate1", required = false) Integer servicestate1, @RequestParam(value = "page2", required = false) Integer page2, @RequestParam(value = "size2", required = false) Integer size2, @RequestParam(value = "status", required = false) Integer status, Model uiModel) throws Exception {
    if (queryDate1 == null && queryDate2 == null) {
        Calendar calendar = Calendar.getInstance();
        calendar.add(Calendar.DATE, 1);
        calendar.set(Calendar.HOUR_OF_DAY, 0);
        calendar.set(Calendar.MINUTE, 0);
        calendar.set(Calendar.SECOND, 0);
        calendar.set(Calendar.MILLISECOND, 0);
        calendar.add(Calendar.MILLISECOND, -1);
        queryDate2 = calendar.getTime();
        calendar.add(Calendar.MILLISECOND, 1);
        calendar.add(Calendar.MONTH, -1);
        queryDate1 = calendar.getTime();
    }
    if (queryDate11 == null && queryDate22 == null) {
        Calendar calendar = Calendar.getInstance();
        calendar.add(Calendar.DATE, 1);
        calendar.set(Calendar.HOUR_OF_DAY, 0);
        calendar.set(Calendar.MINUTE, 0);
        calendar.set(Calendar.SECOND, 0);
        calendar.set(Calendar.MILLISECOND, 0);
        calendar.add(Calendar.MILLISECOND, -1);
        queryDate22 = calendar.getTime();
        calendar.add(Calendar.MILLISECOND, 1);
        calendar.add(Calendar.MONTH, -1);
        queryDate11 = calendar.getTime();
    }
    if (queryDate3 == null && queryDate4 == null) {
        Calendar calendar = Calendar.getInstance();
        calendar.add(Calendar.DATE, 1);
        calendar.set(Calendar.HOUR_OF_DAY, 0);
        calendar.set(Calendar.MINUTE, 0);
        calendar.set(Calendar.SECOND, 0);
        calendar.set(Calendar.MILLISECOND, 0);
        calendar.add(Calendar.MILLISECOND, -1);
        queryDate4 = calendar.getTime();
        calendar.add(Calendar.MILLISECOND, 1);
        calendar.add(Calendar.MONTH, -1);
        queryDate3 = calendar.getTime();
    }
    if (queryDate33 == null && queryDate44 == null) {
        Calendar calendar = Calendar.getInstance();
        calendar.add(Calendar.DATE, 1);
        calendar.set(Calendar.HOUR_OF_DAY, 0);
        calendar.set(Calendar.MINUTE, 0);
        calendar.set(Calendar.SECOND, 0);
        calendar.set(Calendar.MILLISECOND, 0);
        calendar.add(Calendar.MILLISECOND, -1);
        queryDate44 = calendar.getTime();
        calendar.add(Calendar.MILLISECOND, 1);
        calendar.add(Calendar.MONTH, -1);
        queryDate33 = calendar.getTime();
    }
    Map param = new HashMap();
    // page,size
    if (page == null || page < 1)
        page = 1;
    if (size == null || size < 1)
        size = 10;
    Integer offset = size * (page - 1);
    param.put("offset", offset);
    param.put("limit", size);
    if (StringUtils.isNotEmpty(applyname)) {
        param.put("applyname", "%" + applyname + "%");
    }
    param.put("queryDate1", queryDate1);
    param.put("queryDate2", queryDate2);
    param.put("queryDate11", queryDate11);
    param.put("queryDate22", queryDate22);
    param.put("servicestate", servicestate);
    if (StringUtils.isNotEmpty(serialnumber)) {
        param.put("serialnumber", "%" + serialnumber + "%");
    }
    if (StringUtils.isNotEmpty(rservicename) && !"0".equals(rservicename)) {
        param.put("servicename", rservicename);
    }
    if (StringUtils.isNotEmpty(marking)) {
        param.put("marking", "%" + marking + "%");
    }
    if (StringUtils.isNotEmpty(companyname)) {
        param.put("companyname", "%" + companyname + "%");
    }
    if (StringUtils.isNotEmpty(authenticationstatus) && !"-1".equals(authenticationstatus)) {
        param.put("authenticationstatus", authenticationstatus);
    }
    List realNameList = realnameservice.selectListByRealNameRecordEnt(param);
    uiModel.addAttribute("realnamerecord", realNameList);
    int count = realnameservice.selectCountByRealNameRecordEnt(param);
    uiModel.addAttribute("count", count);
    uiModel.addAttribute("pages", (count + size - 1) / size);
    // page, size
    if (page > 1 && size * (page - 1) >= count) {
        page = (count + size - 1) / size;
    }
    uiModel.addAttribute("page", page);
    uiModel.addAttribute("size", size);
    // 个人
    Map param2 = new HashMap();
    // page,size
    if (page2 == null || page2 < 1)
        page2 = 1;
    if (size2 == null || size2 < 1)
        size2 = 10;
    // query data
    Integer offset2 = size2 * (page2 - 1);
    param2.put("offset", offset2);
    param2.put("limit", size2);
    param2.put("queryDate3", queryDate3);
    param2.put("queryDate4", queryDate4);
    param2.put("queryDate33", queryDate33);
    param2.put("queryDate44", queryDate44);
    if (StringUtils.isNotEmpty(applyname1)) {
        param2.put("applyname1", "%" + applyname1 + "%");
    }
    if (StringUtils.isNotEmpty(pname)) {
        param2.put("pname", "%" + pname + "%");
    }
    if (StringUtils.isNotEmpty(idnumber)) {
        param2.put("idnumber", "%" + idnumber + "%");
    }
    if (StringUtils.isNotEmpty(serialnumber1)) {
        param2.put("serialnumber1", "%" + serialnumber1 + "%");
    }
    if (StringUtils.isNotEmpty(usageCode) && !"0".equals(usageCode)) {
        param2.put("usageCode", usageCode);
    }
    param2.put("servicestate1", servicestate1);
    if (StringUtils.isNotEmpty(serviceAuthenticationItem) && !"0".equals(serviceAuthenticationItem)) {
        param2.put("serviceAuthenticationItem", "%" + serviceAuthenticationItem + "%");
    }
    List personalName = personalnameservice.selectListByRersonalNameEnt(param2);
    uiModel.addAttribute("PersonalName", personalName);
    int count2 = personalnameservice.selectCountByRersonalNamePersonal(param2);
    uiModel.addAttribute("count2", count2);
    uiModel.addAttribute("pages2", (count2 + size2 - 1) / size2);
    // page, size
    if (page2 > 1 && size2 * (page2 - 1) >= count2) {
        page2 = (count2 + size2 - 1) / size2;
    }
    List<AppService> rappservice = sqlSession.selectList("com.itrus.portal.db.AppServiceMapper.selectByExamplenaem");
    uiModel.addAttribute("rappservice", rappservice);
    List<AppService> pappService = sqlSession.selectList("com.itrus.portal.db.AppServiceMapper.selectByExamplenaem1");
    uiModel.addAttribute("pappservice", pappService);
    List personalname = personalnameservice.selectByExample(new PersonalNameExample());
    uiModel.addAttribute("personalname", personalname);
    uiModel.addAttribute("page2", page2);
    uiModel.addAttribute("size2", size2);
    uiModel.addAttribute("authenticationstatus", authenticationstatus);
    uiModel.addAttribute("applyname", applyname);
    uiModel.addAttribute("queryDate1", queryDate1);
    uiModel.addAttribute("queryDate2", queryDate2);
    uiModel.addAttribute("serialnumber", serialnumber);
    uiModel.addAttribute("rservicename", rservicename);
    uiModel.addAttribute("marking", marking);
    uiModel.addAttribute("companyname", companyname);
    uiModel.addAttribute("queryDate11", queryDate11);
    uiModel.addAttribute("queryDate22", queryDate22);
    uiModel.addAttribute("pname", pname);
    uiModel.addAttribute("idnumber", idnumber);
    uiModel.addAttribute("status", status);
    uiModel.addAttribute("applyname1", applyname1);
    uiModel.addAttribute("serialnumber1", serialnumber1);
    uiModel.addAttribute("usageCode", usageCode);
    uiModel.addAttribute("queryDate3", queryDate3);
    uiModel.addAttribute("queryDate4", queryDate4);
    uiModel.addAttribute("queryDate33", queryDate33);
    uiModel.addAttribute("queryDate44", queryDate44);
    uiModel.addAttribute("serviceAuthenticationItem", serviceAuthenticationItem);
    uiModel.addAttribute("servicestate", servicestate);
    uiModel.addAttribute("servicestate1", servicestate1);
    return "realnamerecord/list";
}
Also used : AppService(com.itrus.portal.db.AppService) HashMap(java.util.HashMap) PersonalNameExample(com.itrus.portal.db.PersonalNameExample) Calendar(java.util.Calendar) List(java.util.List) ArrayList(java.util.ArrayList) Map(java.util.Map) HashMap(java.util.HashMap) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 19 with AppService

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

the class StoreCharingServiceTest method checkStoreChargingtest.

@Test
public void checkStoreChargingtest() {
    try {
        cacheCustomer.initChargeRule();
        String appid = "8356e077dc6f45";
        String appserviceId = "cz0001";
        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>();
        retMap = storeChargingService.checkStoreCharging(true, applicationInfo, appService, 0, 1);
        System.out.println(retMap);
    // 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 20 with AppService

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

the class ChargingFailTask method ChargingAgain.

/**
 * 遍历所有计费失败的记录,重新计费
 *
 * @Scheduled(fixedRate = 1000 * 60 * 60 * 24) 设置为每天凌晨2点触发
 * @Scheduled(cron = "0 0 2 * * ?")
 */
@Scheduled(cron = "0 0/45 * * * ?")
public void ChargingAgain() {
    // start------------处理双机互斥----------
    // 系统是否配置同步任务的主机名
    SysConfig sysConfigHost = sqlSession.selectOne("com.itrus.portal.db.SysConfigMapper.selectByType", "raInfoHost");
    if (null == sysConfigHost) {
        // 没有配置,直接返回
        return;
    }
    String host = sysConfigHost.getConfig();
    host = host.replaceAll(" ", "");
    String[] hosts = host.split(",");
    // 获取本机主机名称
    InetAddress ia = null;
    try {
        ia = ia.getLocalHost();
    } catch (UnknownHostException e1) {
        e1.printStackTrace();
        return;
    }
    String hostName = ia.getHostName();
    boolean flag_check = false;
    for (String str : hosts) {
        if (hostName.equals(str.replaceAll(" ", ""))) {
            flag_check = true;
        }
    }
    // 判断本地主机名称是否与系统配置的同步主机名称一致,不一致则返回
    if (!flag_check) {
        return;
    }
    // end------------处理双机互斥----------
    List<ChargingFail> chargingFails = chargingFailService.geChargingFails();
    if (null == chargingFails || chargingFails.size() == 0) {
        return;
    }
    for (int i = 0; i < chargingFails.size(); i++) {
        ChargingFail chargingFail = chargingFails.get(i);
        Map<String, Object> retMap = new HashMap<String, Object>();
        ApplicationInfo applicationInfo = certificationChargingService.getApplicationInfoByAppId(chargingFail.getAppId());
        AppService appService = certificationChargingService.getAppServiceByAppServiceId(chargingFail.getAppServiceId());
        retMap = certificationChargingService.charging(chargingFail.getAppId(), chargingFail.getAppServiceId(), chargingFail.getTransinfoName(), chargingFail.getTransinfoId(), applicationInfo, appService, chargingFail.getTransinfoPrimaryId(), chargingFail.getTransinfoTableName());
        Integer flag = (Integer) retMap.get("retCode");
        // 若插入成功
        if (null != flag && flag == 1) {
            chargingFail.setIsValidity(false);
            chargingFail.setModifyTime(new Date());
            Charging charging = (Charging) retMap.get("charging");
            chargingFail.setChargingId(charging.getChargingId());
            chargingFailService.update(chargingFail);
        }
    }
}
Also used : SysConfig(com.itrus.portal.db.SysConfig) AppService(com.itrus.portal.db.AppService) Charging(com.itrus.portal.db.Charging) UnknownHostException(java.net.UnknownHostException) HashMap(java.util.HashMap) ApplicationInfo(com.itrus.portal.db.ApplicationInfo) Date(java.util.Date) ChargingFail(com.itrus.portal.db.ChargingFail) InetAddress(java.net.InetAddress) Scheduled(org.springframework.scheduling.annotation.Scheduled)

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