精华内容
下载资源
问答
  • 银企直连系统

    2019-06-18 08:50:53
    银企直连系统是通过互联网或专线连接的方式,使企业的财务系统与银行综合业务系统实现对接,企业无需专门登录网上银行,就可以利用自身财务系统自主完成对其银行账户包括分(子)公司银行账户的查询、转账、资金归集、...

    https://baike.baidu.com/item/银企直连系统/7800657

    银企直连系统是通过互联网或专线连接的方式,使企业的财务系统与银行综合业务系统实现对接,企业无需专门登录网上银行,就可以利用自身财务系统自主完成对其银行账户包括分(子)公司银行账户的查询、转账、资金归集、信息下载等功能,并在财务系统中自动登记账务信息,免去了以往财务系统、网银系统两次指令录入的过程,提高了工作效率,确保了财务系统与银行综合业务系统账户信息的一致性。

    主要功能

    编辑

    业务查询:签约账户余额和明细查询;

    资金划转:集团内部转账、对外支付;

    资金归集:分为集团公司主动发起和银行发起两种模式,归集方式有全额划转、

    按比例划转、固定金额划转、留存额度划转等。

    个性功能

    编辑

    可根据客户的个性化需求,及其财务系统的扩展兼容性,开发设计个性化功能。

    产品特点

    编辑

    实时反映账户资金变化状况,便于企业财务监控和决策;

    通过企业与银行互动联接,实现资金划转和归集,提高资金利用效率;

    减少财务人员手工操作环节和工作量,降低差错率,提高工作效率;

    设有标准化接口,方便与企业内部系统实现在线连接,提供个性化量身定作功能。

    银企直连

     

    展开全文
  • 中信银行银企直连对接项目

    千次阅读 2017-09-28 16:00:07
    中信银行银企直连对接项目中信银行银企直连对接项目 项目介绍 拓扑图 部分代码 1云端代码实现 控制层 BillController 业务层 BillServiceImpl 2本地服务实现 控制层实现 BillController 业务层 BillServiceImpl 对接...

    中信银行银企直连对接项目

    1. 项目介绍

    小猫停车场管理后台,将停车缴费和月卡续费的钱,通过对接中信银行银企直连系统将钱款转账给各个停车场账户。

    2.拓扑图

    这里写图片描述

    3.部分代码

    3.1.云端代码实现

    控制层 BillController

    package com.mallparking.controller;
    
    import java.text.ParseException;
    import java.util.List;
    import java.util.Map;
    import org.slf4j.Logger;
    import org.slf4j.LoggerFactory;
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.web.bind.annotation.RequestBody;
    import org.springframework.web.bind.annotation.RequestMapping;
    import org.springframework.web.bind.annotation.RequestMethod;
    import org.springframework.web.bind.annotation.RestController;
    import com.mallparking.mongo.model.AccountingBill;
    import com.mallparking.mongo.model.MongoParking;
    import com.mallparking.mongo.model.OperateBill;
    import com.mallparking.mongo.model.ParkBill;
    import com.mallparking.service.BillService;
    
    /**
     *
     * @ClassName: BillController
     * @Description: 根据账单转账控制器
     * @author 郭鹏远
     * @date 2017年4月20日
     * @version v1.0
     *
     */
    @RestController
    @RequestMapping("/bill")
    public class BillController {
    
        Logger logger = LoggerFactory.getLogger(BillController.class);
    
        @Autowired
        private BillService billService;
    
        // -------------------- 根据停车账单编号查询停车账单实体 ------------------------------
        @SuppressWarnings("unchecked")
        @RequestMapping(value = "/find/billnos", method = RequestMethod.POST)
        public ParkBill[] findByBillNos(@RequestBody Map<String, Object> map) {
            List<String> billNos = (List<String>) map.get("billNos");
            logger.info(">>>>>>>>>>开始停车账单编号查询停车账单实体,请求参数billNos为:");
            for (String billNo : billNos) {
                logger.info("-----billNo:" + billNo);
            }
            // 记录开始时间
            long beginTime = System.currentTimeMillis();
            ParkBill[] parkBills = billService.findEntitys(billNos);
            logger.info(">>>>>>>>>>完成停车账单编号查询停车账单实体,耗时[" + (System.currentTimeMillis() - beginTime) + "]ms");
            return parkBills;
        }
    
        // -------------------- 根据停车账单实体数组进行更新 ----------------------------------
        @RequestMapping(value = "/update/parkbills", method = RequestMethod.POST)
        public void updateByEntity(@RequestBody Map<String, Object> map) {
            String parkBillStr = (String) map.get("parkBills");
            logger.info(">>>>>>>>>>开始停车账单实体更新请求,请求参数parkBillStr为:"+parkBillStr);
            // 记录开始时间
            long beginTime = System.currentTimeMillis();
            try {
                billService.updatePrk(parkBillStr);
            } catch (ParseException e) {
                e.printStackTrace();
            }
            logger.info(">>>>>>>>>>完成停车账单实体更新请求,耗时[" + (System.currentTimeMillis() - beginTime) + "]ms");
        }
    
        // -------------------- 根据客户流水号查询停车账单实体 ----------------------------------
        @RequestMapping(value = "/find/client", method = RequestMethod.POST)
        public ParkBill findByBillNosByClient(@RequestBody Map<String, Object> map) {
            String clientId = (String) map.get("clientId");
            logger.info(">>>>>>>>>>开始根据客户流水号查询停车账单实体,请求参数为[" + clientId + "]");
            // 记录开始时间
            long beginTime = System.currentTimeMillis();
            ParkBill parkBill = billService.findEntityOne(clientId);
            logger.info(">>>>>>>>>>完成根据客户流水号查询停车账单实体,耗时[" + (System.currentTimeMillis() - beginTime) + "]ms");
            return parkBill;
        }
    
        // -------------------- 根据每天月卡运营账单编号查询账单实体 ------------------------------
        @SuppressWarnings("unchecked")
        @RequestMapping(value = "/find/billnos/operate", method = RequestMethod.POST)
        public OperateBill[] findByOperateBillNos(@RequestBody Map<String, Object> map) {
            List<String> billNos = (List<String>) map.get("billNos");
            logger.info(">>>>>>>>>>开始每天月卡运营账单编号查询账单实体,请求参数billNos为:");
            for (String billNo : billNos) {
                logger.info("-----billNo:" + billNo);
            }
            // 记录开始时间
            long beginTime = System.currentTimeMillis();
            OperateBill[] operateBills = billService.findOperateEntitys(billNos);
            logger.info(">>>>>>>>>>完成每天月卡运营账单编号查询账单实体,耗时[" + (System.currentTimeMillis() - beginTime) + "]ms");
            return operateBills;
        }
    
        // -------------------- 根据每天月卡运营账单实体组进行更新 ----------------------------------
        @RequestMapping(value = "/update/operatebills", method = RequestMethod.POST)
        public void updateByOperateEntity(@RequestBody Map<String, Object> map) {
            String operateBillStr = (String) map.get("operateBills");
            logger.info(">>>>>>>>>>开始每天月卡运营账单实体更新请求,请求参数operateBillStr为:" + operateBillStr);
            // 记录开始时间
            long beginTime = System.currentTimeMillis();
            try {
                billService.updateOpe(operateBillStr);
            } catch (ParseException e) {
                e.printStackTrace();
            }
            logger.info(">>>>>>>>>>完成每天月卡运营账单实体更新请求,耗时[" + (System.currentTimeMillis() - beginTime) + "]ms");
        }
    
        // -------------------- 根据月卡账单编号查询账单实体 ------------------------------
        @SuppressWarnings("unchecked")
        @RequestMapping(value = "/find/billnos/accounting", method = RequestMethod.POST)
        public AccountingBill[] findByAccountingBillNos(@RequestBody Map<String, Object> map) {
            List<String> billNos = (List<String>) map.get("billNos");
            logger.info(">>>>>>>>>>开始月卡账单编号查询账单实体,请求参数billNos为:");
            for (String billNo : billNos) {
                logger.info("-----billNo:" + billNo);
            }
            // 记录开始时间
            long beginTime = System.currentTimeMillis();
            AccountingBill[] accountingBills = billService.findAccountingEntitys(billNos);
            logger.info(">>>>>>>>>>完成月卡账单编号查询账单实体,耗时[" + (System.currentTimeMillis() - beginTime) + "]ms");
            return accountingBills;
        }
    
        // -------------------- 根据月卡账单实体组进行更新 ----------------------------------
        @RequestMapping(value = "/update/accountingbills", method = RequestMethod.POST)
        public void updateByAccountingEntity(@RequestBody Map<String, Object> map) {
            String accountingBillStr = (String) map.get("accountingBills");
            logger.info(">>>>>>>>>>开始月卡账单实体更新请求,请求参数accountingBillStr为:" + accountingBillStr);
            // 记录开始时间
            long beginTime = System.currentTimeMillis();
            billService.updateAcc(accountingBillStr);
            logger.info(">>>>>>>>>>完成月卡账单实体更新请求,耗时[" + (System.currentTimeMillis() - beginTime) + "]ms");
        }
    
        // -------------------- 根据客户流水号查询月卡账单实体 ----------------------------------
        @RequestMapping(value = "/find/client/accounting", method = RequestMethod.POST)
        public AccountingBill findByAccountingBillNosByClientId(@RequestBody Map<String, Object> map) {
            String clientId = (String) map.get("clientId");
            logger.info(">>>>>>>>>>开始根据客户流水号查询月卡账单实体,请求参数为[" + clientId + "]");
            // 记录开始时间
            long beginTime = System.currentTimeMillis();
            AccountingBill accountingBill = billService.findAccountingEntityOne(clientId);
            logger.info(">>>>>>>>>>完成根据客户流水号查询月卡账单实体,耗时[" + (System.currentTimeMillis() - beginTime) + "]ms");
            return accountingBill;
        }
    
        // -------------------- 根据小猫用户smallId查询MongoParking实体
        // -------------------------
        @RequestMapping(value = "/find/mongoparking", method = RequestMethod.POST)
        public MongoParking findBySmallId(@RequestBody Map<String,Object> map) {
            String smallId = (String) map.get("smallId");
            logger.info(">>>>>>>>>>开始根据客户流水号查询MongoParking实体,请求参数为[" + smallId + "]");
            // 记录开始时间
            long beginTime = System.currentTimeMillis();
            MongoParking mongoParking = billService.findMongoParking(smallId);
            logger.info(">>>>>>>>>>完成根据客户流水号查询MongoParking实体,耗时[" + (System.currentTimeMillis() - beginTime) + "]ms");
            return mongoParking;
        }
    
        // -------------------- 根据账单编号billNo设置MobileMember实体的属性OrderPayStat为true
        // -------------------------
        @SuppressWarnings("unchecked")
        @RequestMapping(value = "/set/orderpaystat", method = RequestMethod.POST)
        public void setOrderPayStat(@RequestBody Map<String, Object> map) {
            List<String> billNos = (List<String>) map.get("billNos");
            logger.info(">>>>>>>>>>开始根据账单编号billNo设置MobileMember实体的属性OrderPayStat为true,传入参数billNos为:");
            for (String billNo : billNos) {
                logger.info("-----billNo:" + billNo);
            }
            // 记录开始时间
            long beginTime = System.currentTimeMillis();
            billService.setStatus(billNos);
            logger.info(">>>>>>>>>>完成根据账单编号billNo设置MobileMember实体的属性OrderPayStat为true,耗时["
                    + (System.currentTimeMillis() - beginTime) + "]ms");
    
        }
    
        // -------------------- 根据传入参数(操作人+账单编号)创建结算操作记录表数据
        // -------------------------
        @RequestMapping(value = "/create/monthcardpayrecord", method = RequestMethod.POST)
        public void createMonthCardPayRecord(@RequestBody Map<String, Object> map) {
            @SuppressWarnings("unchecked")
            List<String> billNos = (List<String>) map.get("billNos");
            String operationPerson = (String) map.get("operationPerson");
            logger.info(">>>>>>>>>>开始根据传入参数(操作人+账单编号)创建结算操作记录表数据");
            logger.info("-----传入参数billNos:");
            for (String billNo : billNos) {
                logger.info("-----billNo:" + billNo);
            }
            logger.info("-----传入参数operationPerson:" + operationPerson);
            // 记录开始时间
            long beginTime = System.currentTimeMillis();
            billService.createPayRecord(billNos, operationPerson);
            logger.info(
                    ">>>>>>>>>>完成根据传入参数(操作人+账单编号)创建结算操作记录表数据,耗时[" + (System.currentTimeMillis() - beginTime) + "]ms");
        }
        // -------------------- 根据传入参数(操作人+账单编号)删除结算操作记录表中一条记录 -------------------------
        @SuppressWarnings("unchecked")
        @RequestMapping(value="/delete/monthcardpayrecord",method = RequestMethod.POST)
        public void deleteMonthCardPayRecord(@RequestBody Map<String,Object> map){
            List<String> billNos =(List<String>) map.get("billNos");
            String operationPerson = (String) map.get("operationPerson");
            logger.info(">>>>>>>>>>开始根据传入参数(操作人+账单编号)删除结算操作记录表中一条记录");
            logger.info("-----传入参数billNos:");
            for (String billNo : billNos) {
                logger.info("-----billNo:" + billNo);
            }
            logger.info("-----传入参数operationPerson:" + operationPerson);
            // 记录开始时间
            long beginTime = System.currentTimeMillis();
            billService.deletePayRecord(billNos, operationPerson);
            logger.info(">>>>>>>>>>完成根据传入参数(操作人+账单编号)删除结算操作记录表中一条记录,耗时["
                    + (System.currentTimeMillis() - beginTime) + "]ms");
        }
    
        // -------------------- 根据传入参数(操作人+账单编号)更新结算操作记录表status为true
        // -------------------------
        @SuppressWarnings("unchecked")
        @RequestMapping(value = "/set/monthcardpayrecord", method = RequestMethod.POST)
        public void setMonthCardPayRecord(@RequestBody Map<String, Object> map) {
            List<String> billNos = (List<String>) map.get("billNos");
            String operationPerson = (String) map.get("operationPerson");
            logger.info(">>>>>>>>>>开始根据传入参数(操作人+账单编号)更新结算操作记录表status为true");
            logger.info("-----传入参数billNos:");
            for (String billNo : billNos) {
                logger.info("-----billNo:" + billNo);
            }
            logger.info("-----传入参数operationPerson:" + operationPerson);
            // 记录开始时间
            long beginTime = System.currentTimeMillis();
            billService.setPayRecord(billNos, operationPerson);
            logger.info(">>>>>>>>>>完成根据传入参数(操作人+账单编号)更新结算操作记录表status为true,耗时["
                    + (System.currentTimeMillis() - beginTime) + "]ms");
        }
    
    }
    

    业务层 BillServiceImpl

    package com.mallparking.service.impl;
    
    
    import java.text.DecimalFormat;
    import java.text.ParseException;
    import java.text.SimpleDateFormat;
    import java.util.ArrayList;
    import java.util.Date;
    import java.util.HashMap;
    import java.util.Iterator;
    import java.util.List;
    import java.util.Map;
    
    import org.dom4j.Document;
    import org.dom4j.DocumentException;
    import org.dom4j.DocumentHelper;
    import org.dom4j.Element;
    import org.slf4j.Logger;
    import org.slf4j.LoggerFactory;
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.data.mongodb.core.MongoTemplate;
    import org.springframework.data.mongodb.core.query.Criteria;
    import org.springframework.data.mongodb.core.query.Query;
    import org.springframework.data.mongodb.core.query.Update;
    import org.springframework.stereotype.Service;
    
    import com.mallparking.mongo.dao.AccountingBillDAO;
    import com.mallparking.mongo.dao.MonthCardPayRecordDAO;
    import com.mallparking.mongo.dao.OperateBillDAO;
    import com.mallparking.mongo.dao.ParkBillDAO;
    import com.mallparking.mongo.dao.ParkingDAO;
    import com.mallparking.mongo.model.AccountingBill;
    import com.mallparking.mongo.model.MobileMember;
    import com.mallparking.mongo.model.MongoParking;
    import com.mallparking.mongo.model.MonthCardPayRecord;
    import com.mallparking.mongo.model.OperateBill;
    import com.mallparking.mongo.model.ParkBill;
    import com.mallparking.service.BillService;
    
    /**
     * 
     * @ClassName: BillServiceImpl
     * @Description: 转账及查询业务实现
     * @author 郭鹏远
     * @date 2017年4月21日
     * @version V1.0
     *
     */
    @Service("billService")
    public class BillServiceImpl implements BillService {
    
        Logger logger = LoggerFactory.getLogger(BillServiceImpl.class);
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
        DecimalFormat df = new DecimalFormat("0000");
    
        @Autowired
        private ParkBillDAO parkBillDAO;
    
        @Autowired
        private AccountingBillDAO accountingBillDAO;
    
        @Autowired
        private OperateBillDAO operateBillDAO;
    
        @Autowired
        private ParkingDAO parkingDAO;
    
        @Autowired
        private MonthCardPayRecordDAO monthCardPayRecordDAO;
    
        @Autowired
        private MongoTemplate mongoTemplate;
    
        @Override
        public ParkBill[] findEntitys(List<String> billNos){
            ParkBill[] parkBills = parkBillDAO.findByBillNoIn(billNos);
            return parkBills;   
        }
    
        @Override
        public ParkBill findEntityOne(String clientId){
            ParkBill parkBill = parkBillDAO.findByClientId(clientId);
            return parkBill;
        }
    
        @SuppressWarnings("unchecked")
        @Override
        public void updatePrk(String parkBillStr) throws ParseException{
            Map<String,Object> map = getMapByXml(parkBillStr);
            logger.info("-----map:"+map);
            List<Map<String,Object>> lists = (List<Map<String, Object>>) map.get("list");
            for (Map<String, Object> entity : lists) {
                ParkBill parkBillFind = parkBillDAO.findByBillNo((String)entity.get("billNo"));
                parkBillFind.setPaystate((String)entity.get("paystate"));
                parkBillFind.setBatNo((String)entity.get("batNo"));
                parkBillFind.setIsSettle(entity.get("isSettle").equals("true")?true:false);
                parkBillFind.setStatus(entity.get("status").equals("1")?1:0);
                parkBillFind.setReceipt((String)entity.get("receipt"));
                parkBillFind.setClientId((String)entity.get("clientId"));
                if(entity.get("settleDate")!=null){
                    parkBillFind.setSettleDate(sdf.parse((String)entity.get("settleDate")));
                }           
                parkBillDAO.save(parkBillFind);
            }       
        }
    
        @Override
        public MongoParking findMongoParking(String smallId){
            MongoParking mongoParking = parkingDAO.findBySmallId(smallId);
            return mongoParking;
        }
    
        @SuppressWarnings("unchecked")
        @Override
        public void updateAcc(String accountingBillStr) {
            Map<String,Object> map = getMapByXml(accountingBillStr);
            List<Map<String,Object>> lists = (List<Map<String, Object>>) map.get("list");
            for (Map<String, Object> entity : lists) {
                AccountingBill accountingBillFind = accountingBillDAO.findByBillNo((String)entity.get("billNo"));
                accountingBillFind.setPaystate((String)entity.get("paystate"));
                accountingBillFind.setBatNo((String)entity.get("batNo"));
                accountingBillFind.setStatus(entity.get("status").equals("1")?1:0);
                accountingBillFind.setReceipt((String)entity.get("receipt"));
                accountingBillFind.setClientId((String)entity.get("clientId"));
                accountingBillDAO.save(accountingBillFind);
            }
        }
    
        @Override
        public AccountingBill[] findAccountingEntitys(List<String> billNos) {
            AccountingBill[] accountingBills = accountingBillDAO.findByBillNoIn(billNos);
            return accountingBills;
        }
    
        @Override
        public AccountingBill findAccountingEntityOne(String clientId) {
            AccountingBill accountingBill = accountingBillDAO.findByClientId(clientId);
            return accountingBill;
        }
    
        @SuppressWarnings("unchecked")
        @Override
        public void updateOpe(String operateBillStr) throws ParseException {
            Map<String,Object> map = getMapByXml(operateBillStr);
            List<Map<String,Object>> lists = (List<Map<String, Object>>) map.get("list");
            for(Map<String,Object> entity:lists){
                OperateBill operateBillFind = operateBillDAO.findByBillNo((String)entity.get("billNo"));
                operateBillFind.setPaystate((String)entity.get("paystate"));
                operateBillFind.setBatNo((String)entity.get("batNo"));
                operateBillFind.setIsSettle(entity.get("isSettle").equals("true")?true:false);
                operateBillFind.setStatus(entity.get("status").equals("1")?1:0);
                operateBillFind.setReceipt((String)entity.get("receipt"));
                operateBillFind.setClientId((String)entity.get("clientId"));
                if(entity.get("settleDate")!=null){
                    operateBillFind.setSettleDate(sdf.parse((String)entity.get("settleDate")));
                }
    
                operateBillDAO.save(operateBillFind);
            }
        }
    
        @Override
        public OperateBill[] findOperateEntitys(List<String> billNos) {
            OperateBill[] operateBills = operateBillDAO.findByBillNoIn(billNos);
            return operateBills;
        }
    
        @Override
        public void setStatus(List<String> billNos) {
            for(String billNo:billNos){
                mongoTemplate.updateFirst(new Query(Criteria.where("outTradeNo").is(billNo)), new Update().set("orderPayStat", true), MobileMember.class);
            }
    
        }
    
        @Override
        public void createPayRecord(List<String>billNos,String operationPerson) {
            for(String billNo:billNos){
                if(monthCardPayRecordDAO.findByBillNo(billNo)==null){
                    MonthCardPayRecord record = new MonthCardPayRecord();
                    record.setBillNo(billNo);
                    record.setOperationPerson(operationPerson);
                    record.setPayTime(new Date());
                    record.setStatus(false);
                    monthCardPayRecordDAO.save(record);
    
                }
            }
    
        }
        @Override
        public void deletePayRecord(List<String>billNos,String operationPerson) {
            for(String billNo:billNos){
                MonthCardPayRecord record = monthCardPayRecordDAO.findByBillNo(billNo);
                if(record!=null){
                    monthCardPayRecordDAO.deleteByBillNo(billNo);
                }
    
            }
    
        }
    
        @Override
        public void setPayRecord(List<String> billNos,String operationPerson) {
            MonthCardPayRecord record =null;
            for(String billNo:billNos){
                record = monthCardPayRecordDAO.findByBillNo(billNo);
                if(record!=null){
                    record.setStatus(true);
                    monthCardPayRecordDAO.save(record);
                }           
            }
        }
    
        // 将收到的XML字符串转化为MAP
        @SuppressWarnings({ "rawtypes", "unchecked" })
        public static Map<String, Object> getMapByXml(String xml) {
            Map<String, Object> returnMap = new HashMap<String, Object>();
            Document document = null;
            try {
                document = DocumentHelper.parseText(xml);
            } catch (DocumentException e) {
                // throw new CiticDirectException(e);
            }
            Element infoElement = (Element) document.getRootElement();
            Iterator rootIter = infoElement.elementIterator();
            while (rootIter.hasNext()) {
                Element element = (Element) rootIter.next();
                // System.out.println(element.getName());
                if (element.getName().equals("list")) {
                    List<Map<String, Object>> list = new ArrayList();
                    Iterator rowIter = element.elementIterator();
                    while (rowIter.hasNext()) {
                        Map<String, Object> map = new HashMap<String, Object>();
                        Element rowEle = (Element) rowIter.next();
                        Iterator resIter = rowEle.elementIterator();
                        while (resIter.hasNext()) {
                            Element resEle = (Element) resIter.next();
                            map.put(resEle.getName(), resEle.getText());
                        }
                        list.add(map);
                    }
                    returnMap.put("list", list);
                } else {
                    returnMap.put(element.getName(), element.getText());
                }
            }
            return returnMap;
        }
    
    }// end class
    

    3.2.本地服务实现

    控制层实现 BillController

    package com.mallparking.controller;
    
    import java.util.HashMap;
    import java.util.List;
    import java.util.Map;
    
    import org.slf4j.Logger;
    import org.slf4j.LoggerFactory;
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.web.bind.annotation.RequestBody;
    import org.springframework.web.bind.annotation.RequestMapping;
    import org.springframework.web.bind.annotation.RequestMethod;
    import org.springframework.web.bind.annotation.RestController;
    
    import com.mallparking.exception.CiticConnectException;
    import com.mallparking.model.BillParam;
    import com.mallparking.model.QueryParam;
    import com.mallparking.service.BillService;
    import com.mallparking.utils.Constant;
    
    /**
     *
     * @ClassName: BillController
     * @Description: 根据账单转账控制器
     * @author 郭鹏远
     * @date 2017年4月20日
     * @version v1.0
     *
     */
    @RestController
    @RequestMapping("/bill")
    public class BillController {
    
        Logger logger = LoggerFactory.getLogger(BillController.class);
    
        @Autowired
        private BillService billService;
    
        // ------------------- 停车账单转账请求 -------------------------------------------
        @RequestMapping(value = "/transfer/parkbill", method = RequestMethod.POST)
        public Map<String, Object> parkBillTransfer(@RequestBody BillParam billParam) {
    
            List<String> billNos = billParam.getBillNos();
            String operationPerson = billParam.getOperationPerson();
            logger.info("开始处理停车账单转账请求,传入的账单号为[" + billNos.toString() + "],传入的操作人为[" + operationPerson + "]");
    
            // 记录开始时间
            long beginTime = System.currentTimeMillis();
            Map<String, Object> map = new HashMap<String, Object>();
            map.put("flag", Constant.RESPONSE_FLAG_FAILED);
    
            // Step1 - 检查参数是否合法(非空)
            for (String billNo : billNos) {
                if (billNo == null) {
                    map.put("msg", "提交失败");
                    return map;
                }
            }
    
            // Step2 - 调用service层方法
            try {
                Map<String, Object> result = billService.transferPark(billParam);
                map.putAll(result);
            } catch (CiticConnectException e) {
                e.printStackTrace();
                map.put("msg", "银企直联系统异常");
            } catch (Exception e) {
                e.printStackTrace();
                map.put("msg", "服务器异常");
            }
            logger.info("完成停车账单转账请求,耗时[" + (System.currentTimeMillis() - beginTime) + "]ms");
            return map;
        }
    
        // ------------------- 停车账单转账查询请求
        // --------------------------------------------
        @SuppressWarnings("unchecked")
        @RequestMapping(value = "/query/parkbill", method = RequestMethod.POST)
        public Map<String, Object> parkBillQuery(@RequestBody QueryParam queryParam) {
            String operationPerson = queryParam.getOperationPerson();
            Map<String, Object> queryMaps = queryParam.getQueryMaps();
            logger.info("开始停车账单转账查询请求,传入的操作人为[" + operationPerson + "]");
            // 开始时间
            long beginTime = System.currentTimeMillis();
            Map<String, Object> map = new HashMap<String, Object>();
            map.put("flag", Constant.RESPONSE_FLAG_FAILED);
    
    
            // Step1 - 检查参数是否合法(非空)
            if(queryMaps == null){
                map.put("msg", "提交失败");
                return map;
            }       
            for (Map.Entry<String, Object> entry : queryMaps.entrySet()) {
                logger.info("传入的批次号:" + entry.getKey() + ",传入批次号对应的账单编号:" + entry.getValue());
                for (String billNo : (List<String>) entry.getValue()) {
                    if (billNo == null) {
                        map.put("msg", "提交失败");
                        return map;
                    }
                }
            }
            // Step2 - 调用service层方法
            try {
                Map<String, Object> result = billService.queryPark(queryParam);
                map.putAll(result);
            } catch (CiticConnectException e) {
                e.printStackTrace();
                map.put("msg", "银企直联系统异常");
            } catch (Exception e) {
                e.printStackTrace();
                map.put("msg", "服务器异常");
            }
            logger.info("完成停车账单交易查询请求,耗时[" + (System.currentTimeMillis() - beginTime) + "]ms");
            return map;
        }
    
        // ------------------- 月卡账单转账请求 -------------------------------------------
        @RequestMapping(value = "/transfer/accountingbill", method = RequestMethod.POST)
        public Map<String, Object> accountingBillTransfer(@RequestBody BillParam billParam) {
            List<String> billNos = billParam.getBillNos();
            String operationPerson = billParam.getOperationPerson();
            logger.info("开始月卡账单转账查询请求,传入的账单号为[" + billNos.toString() + "],传入的操作人为[" + operationPerson + "]");
    
            // 记录开始时间
            long beginTime = System.currentTimeMillis();
            Map<String, Object> map = new HashMap<String, Object>();
            map.put("flag", Constant.RESPONSE_FLAG_FAILED);
    
            // Step1 - 检查参数是否合法(非空)
            for (String billNo : billNos) {
                if (billNo == null) {
                    map.put("msg", "提交失败");
                    return map;
                }
            }
            // Step2 - 调用service层方法
            try {
                Map<String, Object> result = billService.transferAccounting(billParam);
                map.putAll(result);
            } catch (CiticConnectException e) {
                e.printStackTrace();
                map.put("msg", "银企直联系统异常");
            } catch (Exception e) {
                e.printStackTrace();
                map.put("msg", "服务器异常");
            }
            logger.info("完成月卡账单转账请求,耗时[" + (System.currentTimeMillis() - beginTime) + "]ms");
            return map;
        }
    
        @SuppressWarnings("unchecked")
        @RequestMapping(value = "/query/accountingbill", method = RequestMethod.POST)
        public Map<String, Object> accountingBillQuery(@RequestBody QueryParam queryParam) {
    
            String operationPerson = queryParam.getOperationPerson();
            Map<String, Object> queryMaps = queryParam.getQueryMaps();
            logger.info("开始月卡账单转账查询请求,传入的操作人为[" + operationPerson + "]");
            // 开始时间
            long beginTime = System.currentTimeMillis();
            Map<String, Object> map = new HashMap<String, Object>();
            map.put("flag", Constant.RESPONSE_FLAG_FAILED);
            // Step1 - 检查参数是否合法(非空)
            if(queryMaps == null){
                map.put("msg", "提交失败");
                return map;
            }
            for (Map.Entry<String, Object> entry : queryMaps.entrySet()) {
                logger.info("传入的批次号:" + entry.getKey() + ",传入批次号对应的账单编号:" + entry.getValue());          
                for (String billNo : (List<String>) entry.getValue()) {
                    if (billNo == null) {
                        map.put("msg", "提交失败");
                        return map;
                    }
                }
            }
            // Step2 - 调用service层方法
            try {
                Map<String, Object> result = billService.queryAccounting(queryParam);
                map.putAll(result);
            } catch (CiticConnectException e) {
                e.printStackTrace();
                map.put("msg", "银企直联系统异常");
            } catch (Exception e) {
                e.printStackTrace();
                map.put("msg", "服务器异常");
            }
            logger.info("完成停车账单交易查询请求,耗时[" + (System.currentTimeMillis() - beginTime) + "]ms");
            return map;
        }
    
    }
    

    业务层 BillServiceImpl

    package com.mallparking.service;
    
    import java.text.DecimalFormat;
    import java.text.SimpleDateFormat;
    import java.util.ArrayList;
    import java.util.Arrays;
    import java.util.Date;
    import java.util.HashMap;
    import java.util.Iterator;
    import java.util.List;
    import java.util.Map;
    import org.dom4j.Document;
    import org.dom4j.DocumentException;
    import org.dom4j.DocumentHelper;
    import org.dom4j.Element;
    import org.slf4j.Logger;
    import org.slf4j.LoggerFactory;
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.stereotype.Service;
    import org.springframework.web.client.RestTemplate;
    import com.mallparking.config.CiticBankConfig;
    import com.mallparking.model.MongoParking;
    import com.mallparking.model.OperateBill;
    import com.mallparking.model.BillParam;
    import com.mallparking.model.AccountingBill;
    import com.mallparking.model.ParkBill;
    import com.mallparking.model.QueryParam;
    import com.mallparking.service.BillService;
    import com.mallparking.utils.Constant;
    import com.mallparking.utils.Encry_MD5;
    import com.mallparking.utils.HttpPost;
    
    /**
     * 
     * @ClassName: BillServiceImpl
     * @Description: 转账及查询业务实现
     * @author 郭鹏远
     * @date 2017年4月21日
     * @version V1.0
     *
     */
    @Service("billService")
    public class BillServiceImpl implements BillService {
    
        Logger logger = LoggerFactory.getLogger(BillServiceImpl.class);
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
        DecimalFormat df = new DecimalFormat("0000");
    
        @Autowired
        private CiticBankConfig citic;
    
        private RestTemplate restTemplate = new RestTemplate();
    
        @SuppressWarnings("unchecked")
        @Override
        public Map<String, Object> transferPark(BillParam param) throws Exception {
            logger.info("----------测试:名字[" + citic.getName() + "]付款帐号[" + citic.getPayaccount() + "]");
            logger.info("----------测试:本地[" + citic.getUrl() + "]云端[" + citic.getSerurl() + "]");
            logger.info("----------开始停车账单转账请求提交----------");
            // 开始时间
            long beginTime = System.currentTimeMillis();
            // xml解析成的map
            Map<String, Object> map = new HashMap<String, Object>();
            // 返回结果
            Map<String, Object> result = new HashMap<String, Object>();
            // 停车单批次账单:0:成功 1:失败
            List<ParkBill>[] results = new ArrayList[2];
            // 停车总批次账单: 0: 成功 1: 失败
            List<ParkBill>[] resultAll = new ArrayList[2];
            resultAll[0] = new ArrayList<ParkBill>();
            resultAll[1] = new ArrayList<ParkBill>();
            // 账单编号:0:成功 1:失败
            List<String>[] billData = new ArrayList[2];
            billData[0] = new ArrayList<String>();
            billData[1] = new ArrayList<String>();
    
            // Step 1 - 获取传入参数Param中的所有信息(billNo,operationPerson)
            // Step 1.1 - 得到账单编号billNos
            List<String> billNos = param.getBillNos();
            logger.info("----------账单编号:" + billNos.toString());
            // Step 1.2 - 得到操作人operationPerson
            String operationPerson = param.getOperationPerson();
    
            // Step 2 - 根据账单编号数组生成批量提交xml
            // Step 2.1 - 访问云端数据,根据账单编号数组得到所有的账单信息
            Map<String, Object> postMapPrk = getPostMapByBillNos(billNos);
            ParkBill[] parkBillsNew = restTemplate.postForObject(citic.getSerurl() + "/bill/find/billnos", postMapPrk,
                    ParkBill[].class);
            // Step 2.2 - 分批处理,将结果存储在ParkBill二维数组中
            ParkBill[][] parks = getBatch(parkBillsNew, 20);
    
            // Step 3 - 每批进行处理(发送,解析)
            for (ParkBill[] temp : parks) {
                // Step 3.1 - 对每一批次进行去除空值的操作,因最后一组数组可能存在null
                List<ParkBill> tmp = new ArrayList<ParkBill>();
                for (ParkBill parkBill : temp) {
                    if (parkBill != null)
                        tmp.add(parkBill);
                }
                temp = tmp.toArray(new ParkBill[] {});
                // Step 3.2 - 生成停车账单支付批量提交sendXml
                logger.info("----------开始生成停车账单支付批量提交的xml报文----------");
                //System.out.println(temp.toString());
                for(ParkBill prkBill:temp){
                    System.out.println(prkBill.toString());
                }
                String sendXml = genParkBillStr(temp);
                logger.info("----------开始发送停车账单支付批量提交请求----------");
                long beginTime1 = System.currentTimeMillis();
                String recXml = HttpPost.getInstance(citic.getUrl()).postRequest(sendXml);
                logger.info("----------发送停车账单支付批量提交请求成功,耗时[" + (System.currentTimeMillis() - beginTime1) + "]ms----------");
                // Step 3.3 - 根据提交返回状态决定流程
                logger.info("----------开始解析xml----------");
                map = getMapByXml(recXml);
                logger.info("----------解析成功,解析后的map为:[" + map + "]");
                String statusAll = (String) map.get("status");
                String statusText = (String) map.get("statusText");
                logger.info("----------查询过程状态,statusAll[" + statusAll + "],statusText[" + statusText + "]");
                // Step 3.4 - 过程成功,进行逻辑处理(调用handle)
                if ("AAAAAAA".equals(statusAll)) {
                    results = handle(map, temp);
                } else {
                    logger.info("----------本批查询过程不成功,状态:" + statusAll + "----------");
                }
                // Step 3.5 - 将每批次结果汇总
                if (results[0] != null)
                    resultAll[0].addAll(results[0]);
                if (results[1] != null)
                    resultAll[1].addAll(results[1]);
            }
            // Step 4 - 后期结果处理及数据处理
            // Step 4.1 - 由实体得到账单编号
            if (resultAll[0] != null) {
                for (ParkBill tmp : resultAll[0])
                    billData[0].add(tmp.getBillNo());
            }
            if (resultAll[1] != null) {
                for (ParkBill tmp : resultAll[1])
                    billData[1].add(tmp.getBillNo());
            }
            // Step 4.2 - 返回结果处理
            if (resultAll[0].size() == 0 && resultAll[1].size() == 0) {
                // a:过程失败
                result.put("sucData", billData[0].toString());
                result.put("errData", billData[1].toString());
                result.put("info", "过程失败");
                result.put("msg", "过程失败");
            } else if (resultAll[0].size() != 0 && resultAll[1].size() == 0) {
                // b: 全部成功
                result.put("sucData", billData[0].toString());
                result.put("errData", billData[1].toString());
                result.put("msg", "提交成功");
            } else {
                // c:部分失败或者全部失败
                result.put("sucData", billData[0].toString());
                result.put("errData", billData[1].toString());
                result.put("msg", "提交失败");
            }
            // Step 4.3 - 对成功的billNo进行创建monthCardPayRecord操作
            // 传入给云端的Param
            BillParam paramNew = new BillParam();
            paramNew.setBillNos(billData[0]);
            paramNew.setOperationPerson(operationPerson);
            if (billData[0] != null) {
                Map<String, Object> postMapCreatePayRecord = getPostMapByBillParam(paramNew);
                restTemplate.postForObject(citic.getSerurl() + "/bill/create/monthcardpayrecord", postMapCreatePayRecord,
                        Boolean.class);
            }
            // Step 4.4 - 进行数据的保存及更新
            if (resultAll[0] != null) {
                Map<String, Object> postMapPrkSaveSuc = getPostMapByPrk(resultAll[0]);
                restTemplate.postForObject(citic.getSerurl() + "/bill/update/parkbills", postMapPrkSaveSuc, Boolean.class);
            }
            if (resultAll[1] != null) {
                Map<String, Object> postMapPrkSaveErr = getPostMapByPrk(resultAll[1]);
                restTemplate.postForObject(citic.getSerurl() + "/bill/update/parkbills", postMapPrkSaveErr, Boolean.class);
            }
            logger.info("----------完成停车账单转账请求提交请求,耗时[" + (System.currentTimeMillis() - beginTime) + "]ms");
            return result;
        }
    
        @SuppressWarnings("unchecked")
        @Override
        public Map<String, Object> queryPark(QueryParam param) throws Exception {
            logger.info("----------开始停车账单支付批量查询----------");
            // 开始时间
            long beginTime1 = System.currentTimeMillis();
            // xml解析成的map
            Map<String, Object> map = new HashMap<String, Object>();
            // 函数返回结果
            Map<String, Object> result = new HashMap<String, Object>();
            // 停车单批次账单:0:成功 1:失败 2:正在处理中
            List<ParkBill>[] results = new List[3];
            results[0] = new ArrayList<ParkBill>();
            results[1] = new ArrayList<ParkBill>();
            results[2] = new ArrayList<ParkBill>();
            // 停车总批次账单:0:成功 1:失败 2:正在处理中
            List<ParkBill>[] resultAll = new List[3];
            resultAll[0] = new ArrayList<ParkBill>();
            resultAll[1] = new ArrayList<ParkBill>();
            resultAll[2] = new ArrayList<ParkBill>();
            // 账单编号:0:成功 1:失败 2:正在处理中
            List<String>[] billData = new ArrayList[3];
            billData[0] = new ArrayList<String>();
            billData[1] = new ArrayList<String>();
            billData[2] = new ArrayList<String>();
    
            // Step 1 - 获取传入参数Param中的所有信息(billNo,operationPerson)
            // Step 1.1 - 得到操作人operationPerson
            String operationPerson = param.getOperationPerson();
            Map<String, Object> queryMaps = param.getQueryMaps();
            // 分批处理
            for (Map.Entry<String, Object> entry : queryMaps.entrySet()) {
                String batNo = entry.getKey();
                List<String> billNos = (List<String>) entry.getValue();
                logger.info("----------批次号:" + batNo);
                logger.info("----------账单编号:" + billNos.toString());
    
                // Step 2 - 生成停车账单支付批量查询sendXmlQuery
                logger.info("----------开始生成停车账单支付批量查询的xml报文----------");
                String sendXmlQuery = genParkBillQuery(batNo);
    
                // Step 3 - 发送批量查询请求,并对结果进行解析
                // Step 3.1 - 发送批量查询请求,得到查询返回状态
                logger.info("----------开始发送停车账单支付批量查询请求----------");
                long beginTime = System.currentTimeMillis();
                String recXmlQuery = HttpPost.getInstance(citic.getUrl()).postRequest(sendXmlQuery);
                logger.info("----------发送停车账单支付批量查询请求成功,耗时[" + (System.currentTimeMillis() - beginTime) + "]ms----------");
                // Step 3.2 - 根据提交返回状态决定流程
                logger.info("----------开始解析xml----------");
                map = getMapByXml(recXmlQuery);
                logger.info("----------解析成功,解析后的map为:[" + map + "]");
                String statusAll = (String) map.get("status");
                String statusText = (String) map.get("statusText");
                logger.info("----------查询过程状态,statusAll[" + statusAll + "],statusText[" + statusText + "]");
                // Step 3.3 - 过程成功,进行逻辑处理(调用queryHandlePark)
                if ("AAAAAAA".equals(statusAll)) {
                    results = queryHandlePark(map, billNos);
                } else {
                    logger.info("----------本批查询过程不成功,状态:" + statusAll + "----------");
                }
                // Step 3.4 - 将每批次结果汇总
                if (results[0] != null)
                    resultAll[0].addAll(results[0]);
                if (results[1] != null)
                    resultAll[1].addAll(results[1]);
                if (results[2] != null)
                    resultAll[2].addAll(results[2]);
            }
    
            // Step 4 - 汇总结果整体处理
            // Step 4.1 - 由实体得到账单编号
            if (resultAll[0] != null)
                for (ParkBill tmp : resultAll[0])
                    billData[0].add(tmp.getBillNo());
            if (resultAll[1] != null)
                for (ParkBill tmp : resultAll[1])
                    billData[1].add(tmp.getBillNo());
            if (resultAll[2] != null) {
                for (ParkBill tmp : resultAll[2])
                    billData[2].add(tmp.getBillNo());
            }
            // Step 4.2 - 对于交易成功的账单,将表monthcardpayrecords中status改为true
            // 传入云端的参数Param
            BillParam paramNewSuc = new BillParam();
            paramNewSuc.setBillNos(billData[0]);
            paramNewSuc.setOperationPerson(operationPerson);
            if (billData[0] != null) {
                Map<String, Object> postMapSetPayRecord = getPostMapByBillParam(paramNewSuc);
                restTemplate.postForObject(citic.getSerurl() + "/bill/set/monthcardpayrecord", postMapSetPayRecord,
                        Boolean.class);
            }
            // Step 4.3 - 对于交易失败的账单,删除表monthcardpayrecords中数据
            // 传入云端的参数Param
            BillParam paramNewErr = new BillParam();
            paramNewErr.setBillNos(billData[1]);
            paramNewErr.setOperationPerson(operationPerson);
            if (billData[1] != null) {
                Map<String, Object> postMapSetPayRecord = getPostMapByBillParam(paramNewErr);
                restTemplate.postForObject(citic.getSerurl() + "/bill/delete/monthcardpayrecord", postMapSetPayRecord,
                        Boolean.class);
            }
            // Step 4.4 - result返回值处理
            if (resultAll[1].size() == 0 && resultAll[0].size() == 0 && resultAll[2].size() == 0) {
                // a:过程失败
                result.put("msg", "过程失败");
                result.put("info", "全部查询过程失败");
                result.put("sucData", billData[0].toString());
                result.put("errData", billData[1].toString());
                result.put("proData", billData[2].toString());
            } else if (resultAll[0].size() != 0 && resultAll[1].size() == 0 && resultAll[2].size() == 0) {
                // b:过程成功并且查询成功
                result.put("flag", Constant.RESPONSE_FLAG_SUCCESS);
                result.put("msg", "查询成功");
                result.put("sucData", billData[0].toString());
                result.put("errData", billData[1].toString());
                result.put("proData", billData[2].toString());
            } else if (resultAll[2].size() != 0) {
                // c:过程成功并且有正在处理中
                result.put("msg", "正在处理中");
                result.put("sucData", billData[0].toString());
                result.put("errData", billData[1].toString());
                result.put("proData", billData[2].toString());
            } else {
                // d:过程成功并且查询失败
                result.put("msg", "查询失败");
                result.put("sucData", billData[0].toString());
                result.put("errData", billData[1].toString());
                result.put("proData", billData[2].toString());
            }
            // Step 4.4 - 进行数据的保存及更新
            if (resultAll[0] != null) {
                Map<String, Object> postMapPrkSaveSuc = getPostMapByPrk(resultAll[0]);
                restTemplate.postForObject(citic.getSerurl() + "/bill/update/parkbills", postMapPrkSaveSuc, Boolean.class);
            }
            if (resultAll[1] != null) {
                Map<String, Object> postMapPrkSaveErr = getPostMapByPrk(resultAll[1]);
                restTemplate.postForObject(citic.getSerurl() + "/bill/update/parkbills", postMapPrkSaveErr, Boolean.class);
            }
            // resultAll[2]未进行更新不用处理
            logger.info("----------完成停车账单支付批量查询请求,耗时[" + (System.currentTimeMillis() - beginTime1) + "]ms----------");
            return result;
        }
    
        @SuppressWarnings("unchecked")
        @Override
        public Map<String, Object> transferAccounting(BillParam param) throws Exception {
            logger.info("----------测试:名字[" + citic.getName() + "]付款帐号[" + citic.getPayaccount() + "]");
            logger.info("----------开始月卡账单转账请求提交----------");
            // 开始时间
            long beginTime = System.currentTimeMillis();
            // xml解析成的map
            Map<String, Object> map = new HashMap<String, Object>();
            // 返回结果
            Map<String, Object> result = new HashMap<String, Object>();
            // 单批次月卡账单 0:成功,1:失败
            List<AccountingBill>[] results = new ArrayList[2];
            // 总批次月卡账单 0:成功,1:失败
            List<AccountingBill>[] resultAll = new ArrayList[2];
            resultAll[0] = new ArrayList<AccountingBill>();
            resultAll[1] = new ArrayList<AccountingBill>();
            // 账单编号
            List<String>[] billData = new ArrayList[2];
            billData[0] = new ArrayList<String>();
            billData[1] = new ArrayList<String>();
    
            // Step 1 - 获取传入参数Param中的所有信息(billNo,operationPerson)
            // Step 1.1 - 得到账单编号billNos
            List<String> billNos = param.getBillNos();
            logger.info("----------账单编号:" + billNos.toString());
            // Step 1.2 - 得到操作人operationPerson
            String operationPerson = param.getOperationPerson();
    
            // Step 2 - 根据账单编号数组生成批量提交xml
            // Step 2.1 - 访问云端数据,根据账单编号数组得到所有的账单信息
            Map<String, Object> postMapAcc = getPostMapByBillNos(billNos);
            AccountingBill[] accountingBillsNew = restTemplate
                    .postForObject(citic.getSerurl() + "/bill/find/billnos/accounting", postMapAcc, AccountingBill[].class);
    
            // Step 2.2 - 分批处理,将结果存储在AccountingBill二维数组中
            AccountingBill[][] bills = getBatch(accountingBillsNew, 20);
    
            // Step 3 - 每批进行处理(发送,解析)
            for (AccountingBill[] temp : bills) {
                // Step 3.1 - 对每一批次进行去除空值的操作 - 因最后一组数组可能存在null
                List<AccountingBill> tmp = new ArrayList<AccountingBill>();
                for (AccountingBill accountingBill : temp) {
                    if (accountingBill != null)
                        tmp.add(accountingBill);
                }
                temp = tmp.toArray(new AccountingBill[] {});
                // Step 3.2 - 相关信息非空判断,生成停车账单支付批量提交sendXml
                logger.info("----------开始生成月卡账单支付批量提交的xml报文----------");
                String sendXml = genAccountingBillStr(temp);
                // Step 3.3 - 发送批量查询请求,得到查询返回状态
                logger.info("----------开始发送月卡账单支付批量提交请求----------");
                long beginTime1 = System.currentTimeMillis();
                String recXml = HttpPost.getInstance(citic.getUrl()).postRequest(sendXml);
                logger.info("----------发送月卡账单支付批量提交请求成功,耗时[" + (System.currentTimeMillis() - beginTime1) + "]ms----------");
                // Step 3.4 - 根据提交返回状态决定流程
                logger.info("----------开始解析xml----------");
                map = getMapByXml(recXml);
                logger.info("----------解析成功,解析后的map为:[" + map + "]");
                String statusAll = (String) map.get("status");
                String statusText = (String) map.get("statusText");
                logger.info("----------查询过程状态,statusAll[" + statusAll + "],statusText[" + statusText + "]");
                // Step 3.5 - 过程成功,进行逻辑处理(调用queryHandle)
                if ("AAAAAAA".equals(statusAll)) {
                    results = handle(map, temp);
                } else {
                    logger.info("----------本批查询过程不成功,状态:" + statusAll + "----------");
                }
                // Step 3.6 - 将每批次结果汇总
                if (results[0] != null)
                    resultAll[0].addAll(results[0]);
                if (results[1] != null)
                    resultAll[1].addAll(results[1]);
            }
    
            // Step 4 - 汇总结果处理及数据处理
            // Step 4.1 - 由实体得到账单编号
            if (resultAll[0] != null) {
                for (AccountingBill tmp : resultAll[0])
                    billData[0].add(tmp.getBillNo());
            }
            if (resultAll[1] != null) {
                for (AccountingBill tmp : resultAll[1])
                    billData[1].add(tmp.getBillNo());
            }
            // Step 4.2 - 返回结果处理
            if ((resultAll[1].size() == 0) && (resultAll[0].size() == 0)) {
                // a:过程失败
                result.put("sucData", billData[0].toString());
                result.put("errData", billData[1].toString());
                result.put("info", "过程失败");
                result.put("msg", "过程失败");
            } else if ((results[1].size() == 0) && (results[0].size() != 0)) {
                // b:过程成功并提交全部成功
                result.put("flag", Constant.RESPONSE_FLAG_SUCCESS);
                result.put("sucData", billData[0].toString());
                result.put("errData", billData[1].toString());
                result.put("msg", "提交成功");
            } else {
                // c:过程成功并提交失败(包括部分和全部)
                result.put("sucData", billData[0].toString());
                result.put("errData", billData[1].toString());
                result.put("msg", "提交失败");
            }
            // Step 4.3 - 同步每天月卡运营账单信息,并保存
            ArrayList<AccountingBill> lists = new ArrayList<AccountingBill>();
            if (resultAll[0] != null) {
                lists.addAll(resultAll[0]);
            }
            if (resultAll[1] != null) {
                lists.addAll(resultAll[1]);
            }
            if (lists != null) {
                Map<String, Object> postMapOpe = getPostMapByBillNos(billNos);
                OperateBill[] operateBills = restTemplate.postForObject(citic.getSerurl() + "/bill/find/billnos/operate",
                        postMapOpe, OperateBill[].class);
                for (AccountingBill aBill : lists) {
                    for (OperateBill oBill : operateBills) {
                        if (oBill.getBillNo().equals(aBill.getBillNo())) {
                            oBill.setBatNo(aBill.getBatNo());
                            oBill.setClientId(aBill.getClientId());
                            oBill.setPaystate(aBill.getPaystate());
                        }
                    }
                }
                // 保存每天月卡运营账单
                List<OperateBill> operatebills = new ArrayList<OperateBill>();
                operatebills = Arrays.asList(operateBills);
                Map<String, Object> postMapOpeSave = getPostMapByOpe(operatebills);
                restTemplate.postForObject(citic.getSerurl() + "/bill/update/operatebills", postMapOpeSave, Boolean.class);
            }
            // Step 4.4 - 对成功的billNo进行创建monthCardPayRecord操作
            BillParam paramNew = new BillParam();
            paramNew.setBillNos(billData[0]);
            paramNew.setOperationPerson(operationPerson);
            if (billData[0] != null) {
                Map<String, Object> mapPostCreatePayRecord = getPostMapByBillParam(paramNew);
                restTemplate.postForObject(citic.getSerurl() + "/bill/create/monthcardpayrecord", mapPostCreatePayRecord,
                        Boolean.class);
            }
            // Step 4.5 - 进行月卡账单数据的保存及更新
            if (resultAll[0] != null) {
                Map<String, Object> mapPostAccSaveSuc = getPostMapByAcc(resultAll[0]);
                restTemplate.postForObject(citic.getSerurl() + "/bill/update/accountingbills", mapPostAccSaveSuc,
                        Boolean.class);
            }
            if (resultAll[1] != null) {
                Map<String, Object> mapPostAccSaveErr = getPostMapByAcc(resultAll[1]);
                restTemplate.postForObject(citic.getSerurl() + "/bill/update/accountingbills", mapPostAccSaveErr,
                        Boolean.class);
            }
            logger.info("----------完成月卡账单转账请求提交请求,耗时[" + (System.currentTimeMillis() - beginTime) + "]ms");
            return result;
        }
    
        @SuppressWarnings("unchecked")
        @Override
        public Map<String, Object> queryAccounting(QueryParam param) throws Exception {
            logger.info("----------开始月卡账单支付批量查询----------");
            // 开始时间
            long beginTime = System.currentTimeMillis();
            // xml解析成的map
            Map<String, Object> map = new HashMap<String, Object>();
            // 返回结果
            Map<String, Object> result = new HashMap<String, Object>();
            // 月卡单批次账单:0:成功 1:失败 2:正在处理中
            List<AccountingBill>[] results = new List[3];
            // 月卡总批次账单:0:成功 1:失败 2:正在处理中
            List<AccountingBill>[] resultAll = new List[3];
            resultAll[0] = new ArrayList<AccountingBill>();
            resultAll[1] = new ArrayList<AccountingBill>();
            resultAll[2] = new ArrayList<AccountingBill>();
            // 账单编号:0:成功 1:失败 2:正在处理中
            List<String>[] billData = new ArrayList[3];
            billData[0] = new ArrayList<String>();
            billData[1] = new ArrayList<String>();
            billData[2] = new ArrayList<String>();
            // 所有账单编号
            List<String> billNoAll = new ArrayList<String>();
    
            // Step 1 - 获取传入参数Param中的所有信息(billNo,operationPerson)
            // Step 1.1 - 得到操作人operationPerson
            String operationPerson = param.getOperationPerson();
            Map<String, Object> queryMaps = param.getQueryMaps();
            // 分批处理
            for (Map.Entry<String, Object> entry : queryMaps.entrySet()) {
                String batNo = entry.getKey();
                List<String> billNos = (List<String>) entry.getValue();
                logger.info("----------批次号:" + batNo);
                logger.info("----------账单编号:" + billNos.toString());
    
                // Step 2 - 相关信息非空判断,生成月卡账单支付批量查询sendXmlQuery
                logger.info("----------开始生成月卡账单支付批量查询的xml报文----------");
                String sendXmlQuery = genAccountingBillQuery(batNo);
    
                // Step 3 - 发送批量查询请求,并对结果进行解析
                // Step 3.1 - 发送批量查询请求,得到查询返回状态
                logger.info("----------开始发送月卡账单支付批量查询请求----------");
                long beginTime1 = System.currentTimeMillis();
                String recXmlQuery = HttpPost.getInstance(citic.getUrl()).postRequest(sendXmlQuery);
                logger.info("----------发送月卡账单支付批量查询请求成功,耗时[" + (System.currentTimeMillis() - beginTime1) + "]ms----------");
                // Step 3.2 - 根据提交返回状态决定流程
                logger.info("----------开始解析xml----------");
                map = getMapByXml(recXmlQuery);
                logger.info("----------解析成功,解析后的map为:[" + map + "]");
                String statusAll = (String) map.get("status");
                String statusText = (String) map.get("statusText");
                logger.info("----------查询过程状态,statusAll[" + statusAll + "],statusText[" + statusText + "]");
                // Step 3.3 - 过程成功,进行逻辑处理(调用queryHandle)
                if ("AAAAAAA".equals(statusAll)) {
                    results = queryHandleAccounting(map,billNos);
                } else {
                    logger.info("----------本批查询过程不成功,状态:" + statusAll + "----------");
                }
                // Step 3.4 - 将每批次结果汇总
                if (results[0] != null)
                    resultAll[0].addAll(results[0]);
                if (results[1] != null)
                    resultAll[1].addAll(results[1]);
                if (results[2] != null)
                    resultAll[2].addAll(results[2]);
                // 得到所有账单编号
                if (billNos!=null){
                    billNoAll.addAll(billNos);
                }
    
            }
    
            // Step 4 - 汇总结果整体处理
            // Step 4.1 - 由实体得到账单编号
            if (resultAll[0] != null) {
                for (AccountingBill tmp : resultAll[0])
                    billData[0].add(tmp.getBillNo());
            }
            if (resultAll[1] != null) {
                for (AccountingBill tmp : resultAll[1])
                    billData[1].add(tmp.getBillNo());
            }
            if (resultAll[2] != null) {
                for (AccountingBill tmp : resultAll[2])
                    billData[2].add(tmp.getBillNo());
            }
            // Step 4.2 - 根据成功的账单编号更新月卡操作记录中的OrderPayStat字段
            Map<String, Object> postMapSetOrderpaystat = getPostMapByBillNos(billData[0]);
            if (billData[0] != null) {
                restTemplate.postForObject(citic.getSerurl() + "/bill/set/orderpaystat", postMapSetOrderpaystat,
                        Boolean.class);
            }
            // Step 4.3 - result返回值处理
            if (resultAll[0].size() == 0 && resultAll[1].size() == 0 && resultAll[2].size() == 0) {
                // a:过程失败
                result.put("msg", "过程失败");
                result.put("info", "全部查询过程失败");
                result.put("sucData", billData[0].toString());
                result.put("errData", billData[1].toString());
                result.put("proData", billData[2].toString());
            } else if (resultAll[0].size() != 0 && resultAll[1].size() == 0 && resultAll[2].size() == 0) {
                // b:过程成功并且查询成功
                result.put("flag", Constant.RESPONSE_FLAG_SUCCESS);
                result.put("msg", "查询成功");
                result.put("sucData", billData[0].toString());
                result.put("errData", billData[1].toString());
                result.put("proData", billData[2].toString());
            } else if (resultAll[2].size() != 0) {
                // c:过程成功并且有正在处理中
                result.put("msg", "正在处理中");
                result.put("sucData", billData[0].toString());
                result.put("errData", billData[1].toString());
                result.put("proData", billData[2].toString());
            } else {
                // d:过程成功并且查询失败
                result.put("msg", "查询失败");
                result.put("sucData", billData[0].toString());
                result.put("errData", billData[1].toString());
                result.put("proData", billData[2].toString());
            }
            // Step 4.4 - 同步每天月卡运营账单信息,并保存
            ArrayList<AccountingBill> lists = new ArrayList<AccountingBill>();
            if (resultAll[1] != null) {
                lists.addAll(resultAll[1]);
            }
            if (resultAll[2] != null) {
                lists.addAll(resultAll[2]);
            }
            if (lists != null || resultAll[0] != null) {
                Map<String, Object> postMapOpe = getPostMapByBillNos(billNoAll);
                OperateBill[] operateBills = restTemplate.postForObject(citic.getSerurl() + "/bill/find/billnos/operate",
                        postMapOpe, OperateBill[].class);
                // 成功需设置isSettle=true
                if (resultAll[0] != null) {
                    for (AccountingBill aBill : resultAll[0]) {
                        for (OperateBill oBill : operateBills) {
                            if (oBill.getBillNo().trim().equals(aBill.getBillNo().trim())) {
                                oBill.setBatNo(aBill.getBatNo());
                                oBill.setClientId(aBill.getClientId());
                                oBill.setPaystate(aBill.getPaystate());
                                oBill.setStatus(aBill.getStatus());
                                oBill.setReceipt(aBill.getReceipt());
                                oBill.setSettleDate(new Date());
                                oBill.setIsSettle(true);
                            }
                        }
                    }
                }
                if (lists != null) {
                    for (AccountingBill aBill : lists) {
                        for (OperateBill oBill : operateBills) {
                            if (oBill.getBillNo().trim().equals(aBill.getBillNo().trim())) {
                                oBill.setBatNo(aBill.getBatNo());
                                oBill.setClientId(aBill.getClientId());
                                oBill.setPaystate(aBill.getPaystate());
                                oBill.setStatus(aBill.getStatus());
                                oBill.setReceipt(aBill.getReceipt());
                            }
                        }
                    }
                }
                // 保存每天月卡运营账单
                List<OperateBill> postListOpe = Arrays.asList(operateBills);
                Map<String, Object> postMapOpeSave = getPostMapByOpe(postListOpe);
                restTemplate.postForObject(citic.getSerurl() + "/bill/update/operatebills", postMapOpeSave, Boolean.class);
            }
            // Step 4.5 - 对于交易成功的账单,将表monthcardpayrecords中status改为true
            // 传入给云端接口的Param
            BillParam paramNewSuc = new BillParam();
            paramNewSuc.setBillNos(billData[0]);
            paramNewSuc.setOperationPerson(operationPerson);
            if (billData[0] != null) {
                Map<String, Object> postMapSetStatusTrue = getPostMapByBillParam(paramNewSuc);
                restTemplate.postForObject(citic.getSerurl() + "/bill/set/monthcardpayrecord", postMapSetStatusTrue,
                        Boolean.class);
            }
            // Step 4.6 - 对于交易失败的账单,删除表monthcardpayrecords中数据
            // 传入云端的参数Param
            BillParam paramNewErr = new BillParam();
            paramNewErr.setBillNos(billData[1]);
            paramNewErr.setOperationPerson(operationPerson);
            if (billData[1] != null) {
                Map<String, Object> postMapSetPayRecord = getPostMapByBillParam(paramNewErr);
                restTemplate.postForObject(citic.getSerurl() + "/bill/delete/monthcardpayrecord", postMapSetPayRecord,
                        Boolean.class);
            }
            // Step 4.7 - 进行数据的保存及更新
            if (resultAll[0] != null) {
                Map<String, Object> postMapAccSaveSuc = getPostMapByAcc(resultAll[0]);
                restTemplate.postForObject(citic.getSerurl() + "/bill/update/accountingbills", postMapAccSaveSuc,
                        Boolean.class);
            }
            if (resultAll[1] != null) {
                Map<String, Object> postMapAccSaveErr = getPostMapByAcc(resultAll[1]);
                restTemplate.postForObject(citic.getSerurl() + "/bill/update/accountingbills", postMapAccSaveErr,
                        Boolean.class);
            }
            // resultAll[2]未进行更新,可以不用处理
            logger.info("----------完成月卡账单支付批量查询请求,耗时[" + (System.currentTimeMillis() - beginTime) + "]ms----------");
            return result;
        }
    
        // 对提交过程成功返回报文进行处理,显示每条账单处理状态并作出相应提示,保存相关数据,
        // 返回包含成功的账单数组results[0]与包含失败的账单数组results[1]的List数组
        @SuppressWarnings("unchecked")
        public List<ParkBill>[] handle(Map<String, Object> map, ParkBill[] parkBills) throws Exception {
            // List<String> results = new ArrayList<String>();
            List<ParkBill>[] results = new List[2];
            // 保存成功的账单
            results[0] = new ArrayList<ParkBill>();
            // 保存失败的账单
            results[1] = new ArrayList<ParkBill>();
            // 解析批次号
            String batNo = (String) map.get("batNo");
            // 解析数量
            Integer sucTotalNum = Integer.parseInt((String) map.get("sucTotalNum"));
            Integer errTotalNum = Integer.parseInt((String) map.get("errTotalNum"));
            Integer totalNum = sucTotalNum + errTotalNum;
            logger.info("----------解析出总笔数:[" + totalNum + "]");
            // 解析所有账单于Map<String,Object> lists中
            List<Map<String, Object>> lists = new ArrayList<Map<String, Object>>();
            lists = (ArrayList<Map<String, Object>>) map.get("list");
            for (Map<String, Object> entity : lists) {
                // 单笔交易状态
                String status = (String) entity.get("status");
                // 单笔交易状态提示
                String statusTextOne = (String) entity.get("statusText");
                String clientID = (String) entity.get("clientID");
    
                // 根据clientID从parkBills数组中找到制定parkBillTmp(clientId=clientId)
                // ParkBill parkBillTmp =
                // restTemplate.postForObject(citic.getFindurlone(),clientID,ParkBill.class);
                ParkBill parkBillTmp = null;
                for (int i = 0; i < parkBills.length; i++) {
                    if (clientID.equals(parkBills[i].getClientId()))
                        parkBillTmp = parkBills[i];
                }
                String billNo = parkBillTmp.getBillNo();
                if ("AAAAAAA".equals(status) || "AAAAAAE".equals(status)) {
                    // a:单笔提交成功
                    logger.info("账单编号[" + billNo + "]客户流水号[" + clientID + "]提交成功");
                    parkBillTmp.setPaystate("正在付款");
                    parkBillTmp.setBatNo(batNo);
                    parkBillTmp.setClientId(clientID);
                    results[0].add(parkBillTmp);
                } else {
                    // b:单笔提交失败
                    logger.info("账单编号[" + billNo + "]客户流水号[" + clientID + "]提交失败,状态码[" + status + "],原因[" + statusTextOne
                            + "]");
                    parkBillTmp.setBatNo("");
                    parkBillTmp.setClientId(clientID);
                    results[1].add(parkBillTmp);
                }
            }
            return results;
        }
    
        // 对提交过程成功返回报文进行处理,显示每条账单处理状态并作出相应提示,保存相关数据,
        // 返回包含成功的账单数组results[0]与包含失败的账单数组results[1]的List数组
        @SuppressWarnings("unchecked")
        public List<AccountingBill>[] handle(Map<String, Object> map, AccountingBill[] accountingBills) throws Exception {
            // List<String> results = new ArrayList<String>();
            List<AccountingBill>[] results = new List[2];
            // 保存成功的月卡账单
            results[0] = new ArrayList();
            // 保存失败的月卡账单
            results[1] = new ArrayList();
            // 解析批次号
            String batNo = (String) map.get("batNo");
            // 解析数量
            Integer sucTotalNum = Integer.parseInt((String) map.get("sucTotalNum"));
            Integer errTotalNum = Integer.parseInt((String) map.get("errTotalNum"));
            Integer totalNum = sucTotalNum + errTotalNum;
            logger.info("----------解析出总笔数:[" + totalNum + "]");
            // 解析所有账单于Map<String,Object> lists中
            List<Map<String, Object>> lists = new ArrayList<Map<String, Object>>();
            lists = (ArrayList<Map<String, Object>>) map.get("list");
            for (Map<String, Object> entity : lists) {
                // 单笔交易状态
                String status = (String) entity.get("status");
                // 单笔交易状态提示
                String statusTextOne = (String) entity.get("statusText");
                String clientID = (String) entity.get("clientID");
    
                // 根据clientID从parkBills数组中找到制定parkBillTmp(clientId=clientId)
                // ParkBill parkBillTmp =
                // restTemplate.postForObject(citic.getFindurlone(),clientID,ParkBill.class);
                AccountingBill accountingBillTmp = null;
                for (int i = 0; i < accountingBills.length; i++) {
                    if (clientID.equals(accountingBills[i].getClientId()))
                        accountingBillTmp = accountingBills[i];
                }
                String billNo = accountingBillTmp.getBillNo();
                if ("AAAAAAA".equals(status) || "AAAAAAE".equals(status)) {
                    // a:单笔提交成功
                    logger.info("账单编号[" + billNo + "]客户流水号[" + clientID + "]提交成功");
                    accountingBillTmp.setPaystate("正在付款");
                    accountingBillTmp.setBatNo(batNo);
                    accountingBillTmp.setClientId(clientID);
                    results[0].add(accountingBillTmp);
                } else {
                    // b:单笔提交失败
                    logger.info("账单编号[" + billNo + "]客户流水号[" + clientID + "]提交失败,状态码[" + status + "],原因[" + statusTextOne
                            + "]");
                    accountingBillTmp.setBatNo("");
                    accountingBillTmp.setClientId(clientID);
                    results[1].add(accountingBillTmp);
                }
            }
            return results;
        }
    
        // 对查询过程成功返回报文进行处理,显示每条账单处理状态并作出相应提示,保存相关数据,
        // 返回包含成功的账单数组results[0]与包含失败的账单数组results[1]的List数组
        @SuppressWarnings("unchecked")
        public List<ParkBill>[] queryHandlePark(Map<String, Object> map, List<String> billNos) throws Exception {
            List<Map<String, Object>> lists = new ArrayList<Map<String, Object>>();
            List<ParkBill>[] results = new List[3];
            // 保存成功的账单
            results[0] = new ArrayList<ParkBill>();
            // 保存失败的账单
            results[1] = new ArrayList<ParkBill>();
            // 保存正在处理中的账单
            results[2] = new ArrayList<ParkBill>();
            lists = (ArrayList<Map<String, Object>>) map.get("list");
            for (Map<String, Object> entity : lists) {
                String status = (String) entity.get("tranStt");
                logger.info("单条交易状态:tranStt[" + status + "]");
                String clientID = (String) entity.get("clientID");
                // ParkBill parkBillTmp = parkBillDAO.findByClientId(clientId);
                Map<String, Object> postMapClientId = getPostMapByClientId(clientID);
                ParkBill parkBillTmp = restTemplate.postForObject(citic.getSerurl() + "/bill/find/client", postMapClientId,
                        ParkBill.class);
                String billNo = parkBillTmp.getBillNo();
                // 判断所处理的账单号包含在前端提交的账单编号内
                if (billNos.contains(billNo)) {
                    // 单笔交易成功-更新状态(isSettle:true,status:1,paystate:"付款完成")
                    if ("7".equals(status.trim())) {
                        logger.info("账单编号[" + billNo + "]客户流水号[" + clientID + "]交易成功");
                        // results[0].add(billNo);
                        parkBillTmp.setIsSettle(true);
                        parkBillTmp.setStatus(1);
                        parkBillTmp.setSettleDate(new Date());
                        parkBillTmp.setPaystate("付款完成");
                        // 将正确的解析结果放到receipt中,并生成receipt
                        parkBillTmp.setReceipt(getReceipt(entity));
                        results[0].add(parkBillTmp);
                    } // 单笔交易正在处理中(4,6,10,11,12)-不更新状态
                    else if ("4".equals(status.trim()) || "6".equals(status.trim()) || "10".equals(status.trim())
                            || "11".equals(status.trim()) || "12".equals(status.trim())) {
                        logger.info("账单编号[" + billNo + "]客户流水号[" + clientID + "]正在处理中,状态码为[" + status.trim() + "]");
                        results[2].add(parkBillTmp);
                    } // 单笔交易失败-更新状态(paystate:"",batNo:null)
                    else {
                        logger.info("账单编号[" + billNo + "]客户流水号[" + clientID + "]交易失败,状态码为[" + status.trim() + "]");
                        parkBillTmp.setPaystate("");
                        parkBillTmp.setBatNo("");
                        results[1].add(parkBillTmp);
                    }
    
                }
    
            }
            return results;
        }
    
        // 对查询过程成功返回报文进行处理,显示每条账单处理状态并作出相应提示,保存相关数据,
        // 返回包含成功的账单数组results[0]与包含失败的账单数组results[1]的List数组
        @SuppressWarnings("unchecked")
        public List<AccountingBill>[] queryHandleAccounting(Map<String, Object> map, List<String> billNos)
                throws Exception {
            List<Map<String, Object>> lists = new ArrayList<Map<String, Object>>();
            List<AccountingBill>[] results = new List[3];
            // 保存成功的账单
            results[0] = new ArrayList<AccountingBill>();
            // 保存失败的账单
            results[1] = new ArrayList<AccountingBill>();
            // 保存正在处理中的账单
            results[2] = new ArrayList<AccountingBill>();
            lists = (ArrayList<Map<String, Object>>) map.get("list");
            for (Map<String, Object> entity : lists) {
                String status = (String) entity.get("tranStt");
                logger.info("单条交易状态:tranStt[" + status + "]");
                String clientID = (String) entity.get("clientID");
                Map<String, Object> postMapClientId = getPostMapByClientId(clientID);
                AccountingBill accountingBillTmp = restTemplate.postForObject(
                        citic.getSerurl() + "/bill/find/client/accounting", postMapClientId, AccountingBill.class);
                String billNo = accountingBillTmp.getBillNo();
                // 判断所处理的账单号包含在前端提交的账单编号内
                if (billNos.contains(billNo)) {
                    // 单笔交易成功-更新状态(isSettle:true,status:1,paystate:"付款完成")          
                    if ("7".equals(status.trim())) {
                        logger.info("账单编号[" + billNo + "]客户流水号[" + clientID + "]交易成功");
                        // accountingBillTmp.setIsSettle(true);
                        accountingBillTmp.setStatus(1);
                        accountingBillTmp.setPaystate("付款完成");
                        // 将正确的解析结果放到receipt中,并生成receipt
                        accountingBillTmp.setReceipt(getReceipt(entity));
                        results[0].add(accountingBillTmp);
                    } // 单笔交易正在处理中(4,6,10,11,12)-不更新状态
                    else if ("4".equals(status.trim()) || "6".equals(status.trim()) || "10".equals(status.trim())
                            || "11".equals(status.trim()) || "12".equals(status.trim())) {
                        logger.info("账单编号[" + billNo + "]客户流水号[" + clientID + "]正在处理中,状态码为[" + status.trim() + "]");
                        results[2].add(accountingBillTmp);
                    } // 单笔交易失败-更新状态(paystate:"",batNo:null)
                    else {
                        logger.info("账单编号[" + billNo + "]客户流水号[" + clientID + "]交易失败,状态码为[" + status.trim() + "]");
                        accountingBillTmp.setPaystate("");
                        accountingBillTmp.setBatNo("");
                        results[1].add(accountingBillTmp);
                    }
                }
            }
            return results;
        }
    
        // 生成交易成功后保存银行返回的信息receipt字段
        public String getReceipt(Map<String, Object> entity) {
            String receipt = "流水号" + (String) entity.get("clientID") + "{付款名称:" + (String) entity.get("payAccountName")
                    + ",付款帐号:" + (String) entity.get("payAccountNo") + ",收款名称:" + (String) entity.get("recAccountName")
                    + ",收款帐号:" + (String) entity.get("recAccountNo") + ",转账金额:" + entity.get("tranAmount") + ",转账日期:"
                    + (String) entity.get("operateDate") + "}";
            return receipt;
        }
    
        // 拼接停车账单批量提交字符串
        private String genParkBillStr(ParkBill[] parkBills) {
            StringBuffer sb = new StringBuffer();
            sb.append("<?xml version=\"1.0\" encoding=\"GBK\"?>");
            sb.append("<stream>");
            sb.append("<action>DLOUTTNB</action>");
            sb.append("<userName>" + citic.getName() + "</userName>");
            sb.append("<list name=\"userDataList\">");
    
            for (int i = 0; i < parkBills.length; i++) {
                sb.append("<row>");
                logger.info("----------账单详情:" + parkBills[i].toString());
                String clientID = getClientID(i, parkBills[i]);
                if (clientID == null) {
                    logger.info("第" + (i + 1) + "笔交易客户流水号为空,");
                }
                sb.append("<clientID>" + clientID + "</clientID>");
                sb.append("<preFlg>0</preFlg>");
                sb.append("<preDate></preDate>");
                sb.append("<preTime></preTime>");
                String payType = getPayType(parkBills[i]);
                if (payType == null) {
                    logger.info("第" + (i + 1) + "笔交易付款方式为空,");
                }
                sb.append("<payType>" + payType + "</payType>");
                sb.append("<recBankNo></recBankNo>");
                sb.append("<payAccountNo>" + citic.getPayaccount() + "</payAccountNo>");
                String recAccountNo = parkBills[i].getBankAccount();
                if (recAccountNo == null) {
                    logger.info("第" + (i + 1) + "笔交易收款帐号为空,");
                }
                sb.append("<recAccountNo>" + recAccountNo + "</recAccountNo>");
                String recAccountName = parkBills[i].getRealName();
                if (recAccountName == null) {
                    logger.info("第" + (i + 1) + "笔交易收款帐号为空,");
                }
                sb.append("<recAccountName>" + recAccountName + "</recAccountName>");
                String recOpenBankName = parkBills[i].getBankName();
                if (recOpenBankName == null) {
                    logger.info("第" + (i + 1) + "笔交易收款银行名称为空,");
                }
                sb.append("<recOpenBankName>" + recOpenBankName + "</recOpenBankName>");
                sb.append("<recOpenBankCode></recOpenBankCode>");
                Double tranAmount = parkBills[i].getBalance();
                if (tranAmount == null) {
                    logger.info("第" + (i + 1) + "笔交易转账金额为空,");
                }
                sb.append("<tranAmount>" + tranAmount + "</tranAmount>");
                String citicBankFlag = getCiticbankFlag(parkBills[i]);
                if (citicBankFlag == null) {
                    logger.info("第" + (i + 1) + "笔交易中信银行标记为空,");
                }
                sb.append("<citicbankFlag>" + citicBankFlag + "</citicbankFlag>");
                String cityFlag = getCityFlag(parkBills[i]);
                if (cityFlag == null) {
                    logger.info("第" + (i + 1) + "笔交易同城标记标记为空,");
                }
                sb.append("<cityFlag>" + cityFlag + "</cityFlag>");
                sb.append("<abstract></abstract>");
                sb.append("<memo></memo>");
                sb.append("<takerName></takerName>");
                sb.append("<takerID></takerID>");
                sb.append("<takerIDType></takerIDType>");
                sb.append("</row>");
            }
            sb.append("</list>");
            sb.append("</stream>");
    
            return sb.toString();
        } // end genParkBillStr
    
        // 拼接月卡账单批量提交字符串
        @SuppressWarnings("unused")
        private String genAccountingBillStr(AccountingBill[] accountingBills) {
            StringBuffer sb = new StringBuffer();
            sb.append("<?xml version=\"1.0\" encoding=\"GBK\"?>");
            sb.append("<stream>");
            sb.append("<action>DLOUTTNB</action>");
            sb.append("<userName>" + citic.getName() + "</userName>");
            sb.append("<list name=\"userDataList\">");
            for (int i = 0; i < accountingBills.length; i++) {
                sb.append("<row>");
                logger.info("----------账单详情:" + accountingBills[i].toString());
                String clientID = getClientID(i, accountingBills[i]);
                if (clientID == null) {
                    logger.info("第" + (i + 1) + "笔交易客户流水号为空,");
                }
                sb.append("<clientID>" + clientID + "</clientID>");
    
                sb.append("<preFlg>0</preFlg>");
                sb.append("<preDate></preDate>");
                sb.append("<preTime></preTime>");
                String payType = getPayType(accountingBills[i]);
                if (payType == null) {
                    logger.info("第" + (i + 1) + "笔交易付款方式为空,");
                }
                sb.append("<payType>" + payType + "</payType>");
                sb.append("<recBankNo></recBankNo>");
                sb.append("<payAccountNo>" + citic.getPayaccount() + "</payAccountNo>");
                String recAccountNo = accountingBills[i].getBankAccount();
                if (recAccountNo == null) {
                    logger.info("第" + (i + 1) + "笔交易收款帐号为空,");
                }
                sb.append("<recAccountNo>" + recAccountNo + "</recAccountNo>");
                String recAccountName = accountingBills[i].getRealName();
                if (recAccountName == null) {
                    logger.info("第" + (i + 1) + "笔交易收款帐号为空,");
                }
                sb.append("<recAccountName>" + recAccountName + "</recAccountName>");
                String recOpenBankName = accountingBills[i].getBankName();
                if (recOpenBankName == null) {
                    logger.info("第" + (i + 1) + "笔交易收款银行名称为空,");
                }
                sb.append("<recOpenBankName>" + recOpenBankName + "</recOpenBankName>");
                sb.append("<recOpenBankCode></recOpenBankCode>");
                Double tranAmount = accountingBills[i].getBalance();
                if (tranAmount == null) {
                    logger.info("第" + (i + 1) + "笔交易转账金额为空,");
                }
                sb.append("<tranAmount>" + tranAmount + "</tranAmount>");
                String citicBankFlag = getCiticbankFlag(accountingBills[i]);
                if (citicBankFlag == null) {
                    logger.info("第" + (i + 1) + "笔交易中信银行标记为空,");
                }
                sb.append("<citicbankFlag>" + citicBankFlag + "</citicbankFlag>");
                String cityFlag = getCityFlag(accountingBills[i]);
                if (cityFlag == null) {
                    logger.info("第" + (i + 1) + "笔交易同城标记标记为空,");
                }
                sb.append("<cityFlag>" + cityFlag + "</cityFlag>");
                sb.append("<abstract></abstract>");
                sb.append("<memo></memo>");
                sb.append("<takerName></takerName>");
                sb.append("<takerID></takerID>");
                sb.append("<takerIDType></takerIDType>");
                sb.append("</row>");
            }
            sb.append("</list>");
            sb.append("</stream>");
    
            return sb.toString();
        } // end genParkBillStr
    
        // 拼接停车账单批量查询字符串
        @SuppressWarnings("unused")
        private String genParkBillQuery(String batNo) {
            StringBuffer sb = new StringBuffer();
            sb.append("<?xml version=\"1.0\" encoding=\"GBK\"?>");
            sb.append("<stream>");
            sb.append("<action>DLOUTQRY</action>");
            sb.append("<userName>" + citic.getName() + "</userName>");
            if (batNo == null) {
                logger.info("----------批次号为空----------");
            }
            sb.append("<batNo>" + batNo + "</batNo>");
            sb.append("<payAccountNo>" + citic.getPayaccount() + "</payAccountNo>");
            sb.append("<recAccountNo></recAccountNo>");
            sb.append("<startDate></startDate>");
            sb.append("<endDate></endDate>");
            sb.append("<startRecord>" + 1 + "</startRecord>");
            sb.append("<pageNumber>" + 20 + "</pageNumber>");
            sb.append("</stream>");
            return sb.toString();
        }
    
        // 拼接月卡账单批量查询字符串
        @SuppressWarnings("unused")
        private String genAccountingBillQuery(String batNo) {
            StringBuffer sb = new StringBuffer();
            sb.append("<?xml version=\"1.0\" encoding=\"GBK\"?>");
            sb.append("<stream>");
            sb.append("<action>DLOUTQRY</action>");
            sb.append("<userName>" + citic.getName() + "</userName>");
            if (batNo == null) {
                logger.info("----------批次号为空----------");
            }
            sb.append("<batNo>" + batNo + "</batNo>");
            sb.append("<payAccountNo>" + citic.getPayaccount() + "</payAccountNo>");
            sb.append("<recAccountNo></recAccountNo>");
            sb.append("<startDate></startDate>");
            sb.append("<endDate></endDate>");
            sb.append("<startRecord>" + 1 + "</startRecord>");
            sb.append("<pageNumber>" + 20 + "</pageNumber>");
            sb.append("</stream>");
            return sb.toString();
        }
    
        // 生成停车账单客户流水号clientID,并保存到实体中
        public String getClientID(int i, ParkBill parkBill) {
            if (parkBill.getClientId() != null && parkBill.getClientId() != "") {
                return parkBill.getClientId();
            }
            // 流水号生成规则:时间(yyyyMMddHHmmss)+账单标记(PB:停车账单/OB:会员账单)+本次提交编号(4位:i格式转换成的4位数)
            String clientId = sdf.format(new Date()) + "PB" + df.format(i);
            parkBill.setClientId(clientId);
            return clientId;
        }
    
        // 生成月卡账单客户流水号clientID,并保存到AccountingBill,OperateBill实体中
        public String getClientID(int i, AccountingBill accountingBill) {
            if (accountingBill.getClientId() != null && accountingBill.getClientId() != "") {
                return accountingBill.getClientId();
            }
            // 流水号生成规则:时间(yyyyMMddHHmmss)+账单标记(PB:停车账单/OB:会员账单)+本次提交编号(4位:i格式转换成的4位数)
            String clientId = sdf.format(new Date()) + "OB" + df.format(i);
            accountingBill.setClientId(clientId);
            return clientId;
        }
    
        // 得到停车账单付费方式payType
        public String getPayType(ParkBill parkBill) {
            if (parkBill.getBankName().indexOf("中信银行") != -1)
                return Constant.CITIC_PAYTYPE_INSIDE;// 中信内部转账
            if (parkBill.getBalance() > 50000)
                return Constant.CITIC_PAYTYPE_LARGE;// 大额支付
            return Constant.CITIC_PAYTYPE_SMALL;// 小额支付
        }
    
        // 得到月卡账单付费方式payType
        public String getPayType(AccountingBill accountingBill) {
            if (accountingBill.getBankName().indexOf("中信银行") != -1)
                return Constant.CITIC_PAYTYPE_INSIDE;// 中信内部转账
            if (accountingBill.getBalance() > 50000)
                return Constant.CITIC_PAYTYPE_LARGE;// 大额支付
            return Constant.CITIC_PAYTYPE_SMALL;// 小额支付
        }
    
        // 得到停车账单中信标志(是否为中信转中信)0:中信 1:他行 前提我们转账用的是中信银行信用卡
        public String getCiticbankFlag(ParkBill parkBill) {
            if (parkBill.getBankName().indexOf("中信银行") != -1)
                return Constant.CITIC_CITICBANK;
            return Constant.CITIC_OTHERBANK;
        }
    
        // 得到月卡账单中信标志(是否为中信转中信)0:中信 1:他行 前提我们转账用的是中信银行信用卡
        public String getCiticbankFlag(AccountingBill accountingBill) {
            if (accountingBill.getBankName().indexOf("中信银行") != -1)
                return Constant.CITIC_CITICBANK;
            return Constant.CITIC_OTHERBANK;
        }
    
        // 得到停车账单同城标记 0:同城 1:异地
        public String getCityFlag(ParkBill parkBill) {
            // MongoParking mongoParking =
            // parkingDAO.findBySmallId(parkBill.getSmallId());
            Map<String, Object> postMapSmallId = getPostMapMongoParkingBySmallId(parkBill.getSmallId());
            MongoParking mongoParking = restTemplate.postForObject(citic.getSerurl() + "/bill/find/mongoparking",
                    postMapSmallId, MongoParking.class);
            Boolean notLocalBank = mongoParking.getParking().getNotLocalBank();
            if (notLocalBank != null && notLocalBank) {
                return Constant.CITIC_CITYFLAG_DIFFERENT;
            }
            return Constant.CITIC_CITYFLAG_SAME;
        }
    
        // 得到月卡账单同城标记 0:同城 1:异地
        public String getCityFlag(AccountingBill accountingBill) {
            // MongoParking mongoParking =
            // parkingDAO.findBySmallId(parkBill.getSmallId());
            Map<String, Object> postMapSmallId = getPostMapMongoParkingBySmallId(accountingBill.getSmallId());
            MongoParking mongoParking = restTemplate.postForObject(citic.getSerurl() + "/bill/find/mongoparking",
                    postMapSmallId, MongoParking.class);
            Boolean notLocalBank = mongoParking.getParking().getNotLocalBank();
            if (notLocalBank != null && notLocalBank) {
                return Constant.CITIC_CITYFLAG_DIFFERENT;
            }
            return Constant.CITIC_CITYFLAG_SAME;
        }
    
        // 将收到的XML字符串转化为MAP
        public static Map<String, Object> getMapByXml(String xml) {
            Map<String, Object> returnMap = new HashMap<String, Object>();
            Document document = null;
            try {
                document = DocumentHelper.parseText(xml);
            } catch (DocumentException e) {
                // throw new CiticDirectException(e);
            }
            Element infoElement = (Element) document.getRootElement();
            Iterator rootIter = infoElement.elementIterator();
            while (rootIter.hasNext()) {
                Element element = (Element) rootIter.next();
                // System.out.println(element.getName());
                if (element.getName().equals("list")) {
                    List list = new ArrayList();
                    Iterator rowIter = element.elementIterator();
                    while (rowIter.hasNext()) {
                        Map<String, Object> map = new HashMap<String, Object>();
                        Element rowEle = (Element) rowIter.next();
                        Iterator resIter = rowEle.elementIterator();
                        while (resIter.hasNext()) {
                            Element resEle = (Element) resIter.next();
                            map.put(resEle.getName(), resEle.getText());
                        }
                        list.add(map);
                    }
                    returnMap.put("list", list);
                } else {
                    returnMap.put(element.getName(), element.getText());
                }
            }
            return returnMap;
        }
    
        // 将所有停车账单账单按照每len长度进行分批次进行处理
        public ParkBill[][] getBatch(ParkBill[] parkBills, int len) {
            int size = parkBills.length;
            ParkBill[][] parks = new ParkBill[(size / len) + 1][len];
            for (int i = 0; i < (size / len); i++) {
                for (int j = 0; j < len; j++) {
                    parks[i][j] = parkBills[len * i + j];
                }
            }
            for (int z = 0; z < (size % len); z++) {
                parks[size / len][z] = parkBills[(size / len) * len + z];
            }
            return parks;
        }
    
        // 将所有月卡账单账单按照每len长度进行分批次进行处理
        public AccountingBill[][] getBatch(AccountingBill[] accountingBills, int len) {
            int size = accountingBills.length;
            AccountingBill[][] parks = new AccountingBill[(size / len) + 1][len];
            for (int i = 0; i < (size / len); i++) {
                for (int j = 0; j < len; j++) {
                    parks[i][j] = accountingBills[len * i + j];
                }
            }
            for (int z = 0; z < (size % len); z++) {
                parks[size / len][z] = accountingBills[(size / len) * len + z];
            }
            return parks;
        }
    
        /*
         * 以下代码:处理生成发送给云端的postMap
         */
        // 通过List<String> billNos得到发送给云端的postMap
        public Map<String, Object> getPostMapByBillNos(List<String> billNos) {
            Map<String, Object> postParam = new HashMap<String, Object>();
            postParam.put("billNos", billNos);
            String sign = Encry_MD5.getSign(postParam);
            Map<String, Object> postMap = new HashMap<String, Object>();
            postMap.put("billNos", billNos);
            postMap.put("sign", sign);
            return postMap;
        }
    
        // 通过billNo得到发送给云端的postMap
        public Map<String, Object> getPostMapByBillNo(String billNo) {
            Map<String, Object> postParam = new HashMap<String, Object>();
            postParam.put("billNo", billNo);
            String sign = Encry_MD5.getSign(postParam);
            Map<String, Object> postMap = new HashMap<String, Object>();
            postMap.put("billNo", billNo);
            postMap.put("sign", sign);
            return postMap;
        }
    
        // 通过clientId得到发送给云端的postMap
        public Map<String, Object> getPostMapByClientId(String clientId) {
            Map<String, Object> postParam = new HashMap<String, Object>();
            postParam.put("clientId", clientId);
            String sign = Encry_MD5.getSign(postParam);
            Map<String, Object> postMap = new HashMap<String, Object>();
            postMap.put("clientId", clientId);
            postMap.put("sign", sign);
            return postMap;
        }
    
        // 通过billParam得到发送给云端的postMap
        public Map<String, Object> getPostMapByBillParam(BillParam billParam) {
            Map<String, Object> postParam = new HashMap<String, Object>();
            postParam.put("billNos", billParam.getBillNos());
            postParam.put("operationPerson", billParam.getOperationPerson());
            String sign = Encry_MD5.getSign(postParam);
            Map<String, Object> postMap = new HashMap<String, Object>();
            postMap.put("billNos", billParam.getBillNos());
            postMap.put("operationPerson", billParam.getOperationPerson());
            postMap.put("sign", sign);
            return postMap;
        }
    
        // 通过List<AccountingBill>得到发送给云端的postMap
        public Map<String, Object> getPostMapByAcc(List<AccountingBill> lists) {
            Map<String, Object> postParam = new HashMap<String, Object>();
            // 生成发给云端的List<AccountingBill>的String
            String accountingBills = genAccountingBill(lists);
            postParam.put("accountingBills", accountingBills);
            String sign = Encry_MD5.getSign(postParam);
            Map<String, Object> postMap = new HashMap<String, Object>();
            postMap.put("accountingBills", accountingBills);
            postMap.put("sign", sign);
            return postMap;
        }
    
        // 通过List<OperateBill>得到发送给云端的postMap
        public Map<String, Object> getPostMapByOpe(List<OperateBill> lists) {
            Map<String, Object> postParam = new HashMap<String, Object>();
            // 生成发给云端的List<OperateBill>的String
            String operateBills = genOperateBill(lists);
            postParam.put("operateBills", operateBills);
            String sign = Encry_MD5.getSign(postParam);
            Map<String, Object> postMap = new HashMap<String, Object>();
            postMap.put("operateBills", operateBills);
            postMap.put("sign", sign);
            return postMap;
        }
    
        // 通过List<ParkBill>得到发送给云端的postMap
        public Map<String, Object> getPostMapByPrk(List<ParkBill> lists) {
            Map<String, Object> postParam = new HashMap<String, Object>();
            // 生成发给云端的List<ParkBill>的String
            String parkBills = genParkBill(lists);
            postParam.put("parkBills", parkBills);
            String sign = Encry_MD5.getSign(postParam);
            Map<String, Object> postMap = new HashMap<String, Object>();
            postMap.put("parkBills", parkBills);
            postMap.put("sign", sign);
            return postMap;
        }
    
        // 通过smallId得到发送给云端的postMap
        public Map<String, Object> getPostMapMongoParkingBySmallId(String smallId) {
            Map<String, Object> postParam = new HashMap<String, Object>();
            postParam.put("smallId", smallId);
            String sign = Encry_MD5.getSign(postParam);
            Map<String, Object> postMap = new HashMap<String, Object>();
            postMap.put("smallId", smallId);
            postMap.put("sign", sign);
            return postMap;
        }
    
        /*
         * 以下代码:生成发送给云端包含实体部分字段的String
         */
        // 生成传送给云端accountingBills实体字段String
        public String genAccountingBill(List<AccountingBill> accountingBills) {
            StringBuilder sb = new StringBuilder();
            sb.append("<?xml version=\"1.0\" encoding=\"GBK\"?>");
            sb.append("<stream>");
            sb.append("<list name=\"userDataList\">");
            for (AccountingBill accountingBill : accountingBills) {
                sb.append("<row>");
                sb.append("<billNo>" + accountingBill.getBillNo() + "</billNo>");
                sb.append("<paystate>" + accountingBill.getPaystate() + "</paystate>");
                sb.append("<batNo>" + accountingBill.getBatNo() + "</batNo>");
                sb.append("<status>" + accountingBill.getStatus() + "</status>");
                sb.append("<receipt>" + accountingBill.getReceipt() + "</receipt>");
                sb.append("<clientId>" + accountingBill.getClientId() + "</clientId>");
                sb.append("</row>");
            }
            sb.append("</list>");
            sb.append("</stream>");
            return sb.toString();
        }
    
        // 生成传送给云端operateBills实体字段String
        public String genOperateBill(List<OperateBill> operateBills) {
            StringBuilder sb = new StringBuilder();
            sb.append("<?xml version=\"1.0\" encoding=\"GBK\"?>");
            sb.append("<stream>");
            sb.append("<list>");
            for (OperateBill operateBill : operateBills) {
                sb.append("<row>");
                sb.append("<billNo>" + operateBill.getBillNo() + "</billNo>");
                sb.append("<paystate>" + operateBill.getPaystate() + "</paystate>");
                sb.append("<batNo>" + operateBill.getBatNo() + "</batNo>");
                sb.append("<isSettle>" + operateBill.getIsSettle() + "</isSettle>");
                sb.append("<status>" + operateBill.getStatus() + "</status>");
                sb.append("<receipt>" + operateBill.getReceipt() + "</receipt>");
                sb.append("<clientId>" + operateBill.getClientId() + "</clientId>");
                if (operateBill.getSettleDate() != null) {
                    sb.append("<settleDate>" + sdf.format(operateBill.getSettleDate()) + "</settleDate>");
                }
    
                sb.append("</row>");
            }
            sb.append("</list>");
            sb.append("</stream>");
            return sb.toString();
        }
    
        // 生成传送给云端parkBill实体字段String
        public String genParkBill(List<ParkBill> parkBills) {
            StringBuilder sb = new StringBuilder();
            sb.append("<?xml version=\"1.0\" encoding=\"GBK\"?>");
            sb.append("<stream>");
            sb.append("<list>");
            for (ParkBill parkBill : parkBills) {
                sb.append("<row>");
                sb.append("<billNo>" + parkBill.getBillNo() + "</billNo>");
                sb.append("<paystate>" + parkBill.getPaystate() + "</paystate>");
                sb.append("<batNo>" + parkBill.getBatNo() + "</batNo>");
                sb.append("<isSettle>" + parkBill.getIsSettle() + "</isSettle>");
                sb.append("<status>" + parkBill.getStatus() + "</status>");
                sb.append("<receipt>" + parkBill.getReceipt() + "</receipt>");
                sb.append("<clientId>" + parkBill.getClientId() + "</clientId>");
                if (parkBill.getSettleDate() != null) {
                    sb.append("<settleDate>" + sdf.format(parkBill.getSettleDate()) + "</settleDate>");
                }
    
                sb.append("</row>");
            }
            sb.append("</list>");
            sb.append("</stream>");
            return sb.toString();
        }
    }// end class
    

    4.对接步骤

    • 找中信财务经理和技术人员获取对接文档及相关测试环境。
    • 安装测试银企直连软件,安装相关文字证书。
    • 云端与本地开发,进行联调。
    • 申请正式环境,切换正式环境上线。

    5.上线准备

    • 财务端电脑安装前置机
    • 财务端安装飞天驱动(相当于证书)
    • 财务端安装jdk1.8(本地服务需要)
    • 本地服务部署在财务端并启动
    • 云端部署云端服务并上线
    • web代码部署并上线

    6.其他注意事项

    等正式上线再补充

    本人邮箱:823532258@qq.com 如果有问题可以联系我

    展开全文
  • arcgis 直连oracle那点事

    2019-04-13 14:58:24
    arcgis 直连oracle那点事 安装环境: win7 64位。 准备内容: arcMap10.2、oracle11、oracle 11客户端32位和64位。 (注意:是否需要oracle客户端32位取决于,arcgis desktop 是否是32位) 主要介绍:从arcgis10.1...

    arcgis 直连oracle那点事

    安装环境: win7 64位。
    准备内容: arcMap10.2、oracle11、oracle 11客户端32位和64位。
    (注意:是否需要oracle客户端32位取决于,arcgis desktop 是否是32位)
    主要介绍:从arcgis10.1开始,arcgis可以直连数据库,而arcgis desktop大多数是32位,就需要用oracle32位客户端来连接数据库,arcgis server是64位,需要用到oracle64位客户端来注册数据库,这里安装的是arcgis desktop和arcgis server在一台机器上,所以oracle32位客户端和64位客户端,都需要安装,如何查看自己的arcgis desktop是否是32位,如下图:
    在这里插入图片描述
    这里主要讲解,arcgis desktop和arcgis server如何连接oracle数据库。
    配置oracle32位客户端

    1. 从网上下载instantclient 32位,下载自己需要的版本,解压文件即可,不需要安装,下一步需要从oracle数据库中找到tnsname.ora文件,拷贝到刚刚下载的instantclient文件下在这里插入图片描述
      打开tnsname.ora文件,如果是远程连接oracle,HOST的值需要改成远程服务器的ip地址。在这里插入图片描述

    2. 在配置Path系统变量中增加oracle客户端根目录。
      在这里插入图片描述

    3. 新增TNS_ADMIN变量,变量名oracle客户端根目录,变量指向tansname.ora文件路径,点击确定。
      在这里插入图片描述

    配置oracle64位客户端:配置64位客户端和配置32为客户端类似

    1. 解压instantclient64客户端,从oracle数据库拷贝tansname.ora文件到instantclient64客户端文件夹下
    2. 在配置Path系统变量中增加oracle64客户端根目录
    3. 在TNS_ADMIN变量,增加变量名oracle64客户端根目录,变量指向tansname.ora文件路径,点击确定。

    创建地理数据库

    1. 打开arcMap–》ArcToolbox–》数据管理工具–》地理数据库管理–》创建企业级地理数据库
      在这里插入图片描述
      点击确定,创建完地理数据库,现在实现连接数据库
      arcgis desktop连接数据库

    2. 目录–》数据库连接–》添加数据库连接 如下图:
      在这里插入图片描述

    arcgis server注册数据库

    1. arcgsi on localhost_6080(系统管理)–》服务器属性
      在这里插入图片描述
      在这里插入图片描述
      填写名称,点击添加,数据库连接 和arcgis desktop连接数据库填写内容一样。
    展开全文
  • sde直连Oracle数据库报错ora-12154 使用arcgis10.2创建Oracle企业级数据库时报错ora-12154 ! Oracle版本为11g,客户端32位 使用sqlplus可以连接上,plsql也能正常使用,并未报监听错误。 就只在sde直连的时候报错,...

    sde直连Oracle数据库报错ora-12154

    使用arcgis10.2创建Oracle企业级数据库时报错ora-12154
    !如图
    Oracle版本为11g,客户端32位
    如图
    使用sqlplus可以连接上,plsql也能正常使用,并未报监听错误。
    就只在sde直连的时候报错,经多处排查也未能发现原因,求大佬解惑?

    展开全文
  • 最近安装部署ArcGIS 10.5连接Oracle 12c,记录一下相关步骤和注意事项。  ESRI  参考官方文件 ... 1.... 2.... 3.... 1.... 2....创建SDE企业级数据库——在 Oracle 中配置 extproc 以访问 ST_Geometry
  • 上汽大众直连EDI项目

    2018-12-25 17:47:04
    上汽大众汽车有限公司(简称“上汽大众”)是一家中德...前期准备阶段,大众主要进行EDI直连意向咨询,并鼓励供应商采用EDI直连方式。对于暂时不想接入EDI的供应商,可以使用上汽大众提供的EDI-WEB平台。 之前有...
  • PKI-银企直连

    千次阅读 2008-09-05 11:21:00
    PKI-银企直连 与企业ERP系统对接的现金管理工具 ERP(Enterprise Resource Planning, 企业资源计划系统),是指建立在信息技术基础上,以系统化的管理思想,为企业决策层及员工提供决策运行手段的管理平台。...
  • EDI的两种解决方案:直连EDI和Web-EDI

    千次阅读 2019-01-17 14:45:11
    常见的EDI(电子数据交换)平台有三种,直连EDI、Web-EDI和增值网络VAN。 VAN是一种比较落后的EDI对接方式,这种方式由于自身的很多局限性,会逐渐被取代,我们就不详细说明了。今天我们主要了解下直连EDI和Web-EDI...
  • 直连路由和静态路由

    千次阅读 2017-04-13 00:02:00
    直连路由和静态路由  作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任。   一.简单直连路由拓扑  上图中路由器不需要任何配置就能互相访问,因为这三个网段的网关地址都在同一个路由器的接口上...
  • 浅谈Web EDI与直连EDI

    千次阅读 2019-01-16 17:44:53
    2018年六月自己开始从事EDI实施工作,慢慢的开始进入该行业,说实话在做EDI实施顾问之前,我甚至不知道...什么是Web EDI、直连EDI?那今天就来给大家简单的分享下。 EDI 我们先来说下什么是EDI吧,EDI全称是 Electro...
  • 亚马逊 Amazon EDI直连案例

    千次阅读 多人点赞 2018-12-12 11:14:17
    项目概览 亚马逊公司(以下简称...2017年底,知行软件为客户实现了与Amazon的直连EDI对接, 通过知行RSSBus EDI系统,客户可以直接接收Amazon PO 和 Route Instructions,发出PO ACK、Route Quest、ASN、Invoice、I...
  • 华为路由器与PC直连设置

    千次阅读 2018-12-01 21:38:39
    华为路由器与PC直连设置实验环境使用华为仿真平台eNSP建立,主要对企业网路由器、交换机、WLAN等设备进行软件仿真,完美呈现真实设备部署实景,支持大型网络模拟。实验组网描述:   华为路由器AR2220的GE 0/0/0 ...
  • 建行银企直连密钥传输交换接口加密 最近在做建行银企直连项目,给的接口文档描述的不清楚,在网上找了很久都没有一个能用的例子,在第一步密钥传输交换接口就调试了半个月才解决,下面我将加解密的代码发出来给后来...
  • 在ArcGIS 10.1 中创建企业级地理数据库遇到如下问题: 用户不具有创建数据库对象的必要权限。 [ERROR: Must be connected to a 64-bit database to create geodatabase. ] 执行(CreateEnterpriseGeodatabase)失败。
  • 但原来程序中一直使用10.1版本的API操作sde企业级地理数据库,可以分为直连与服务连两种方式。现在需要探索在10.5版本下操作SDE企业级地理数据库的方法,图层要素的增删改查。 oracle环境的搭建 Oracle 11g安装...
  • ArcMap10.5直连Oracle 11g

    千次阅读 2019-03-06 20:37:34
    ArcGIS 10.5版本直连Oracle 一、环境 包含的软件版本有 ①ArcMap10.5 ②Oracle 11g R2(包含64位安装包,及64和32位客户端安装包) 链接:https://pan.baidu.com/s/1ldHOkFJtglV642NReTdbLw 提取码:q5y6 1....
  • SAP本地化-银企直连

    千次阅读 2015-08-06 11:56:10
    原文地址:SAP本地化-银企直连作者:SAP-Frankyue  转载请带链接转载。   一、发展历史 2011年,在SAP ECC6 Ehp5中,通过功能增强FIN_LOC_CI_16发布中国版的银企直连(Electronic payment integration with ...
  • Linux网线直连IP配置

    千次阅读 2018-03-30 21:10:00
    2019独角兽企业重金招聘Python工程师标准>>> ...
  • PKI-银企直连解决方案

    千次阅读 2008-09-05 11:33:00
    PKI-银企直连解决方案银企直连是由银行端提供操作的接口,企业端对自己的ERP系统进行修改,然后调用银行端的接口,但是这个过程比较麻烦的地方就是对数据的安全性和不可否认性无法保证。所以采用SSL通讯,保证数据...
  • 实验3:二层直连式WLAN组网设计

    千次阅读 2020-03-25 07:35:06
    1.理解二层直连式组网工作原理。 2.掌握二层直连式WLAN组网配置方法。 【实验环境】 1.安装Win10/Win7/XP操作系统的PC计算机。 2.ENSP软件 【实验内容、要求】 为一小型公司组建二层直连式无线局域网,要求各pc...
  • SAP EPIC 银企直连 系列知识分享

    千次阅读 2016-09-26 14:42:45
    因为对SAP的银企直连比较了解,但是确实看到许多正在实施或者打算实施的顾问或者企业对这个产品不太了解而花费了较大的成本精力,所以想利用网络这个渠道为大家分享一些我了解的以期待能帮助到大家一些,但是这些...
  • VDL Nedcar直连EDI解决方案

    千次阅读 2018-12-20 14:33:03
    2015年,知行软件作为国内某汽车企业EDI 服务提供商,助力客户成功对接VDL EDI 系统,实现业务数据安全、自动、可控传输。 业务概览 需求概览 EDI连接 传输协议:OFTP2 via INTERNET 报文翻译 报文标准:...
  • 帆软发布大数据直连引擎FineDirect,对焦大数据BI

    千次阅读 多人点赞 2017-06-01 11:48:27
    摘要:近日,帆软官方正式发布大数据直连引擎FineDirect模块。通过该模块,企业在应用FineBI原有功能的基础上,可直接对接现有数据源,无论是传统的关系型数据库,还是Hadoop生态圈、Mpp构架,都可以直接自助取数...
  • 招商直连系统,转账接口

    千次阅读 2018-10-31 10:35:02
    联必须用企业提供 EPTDAT 期望日 D 默认为当前日期 可   EPTTIM 期望时间 ...
  • Android -wifi 直连(wifi direct

    千次阅读 2012-09-06 10:56:23
    Android -wifi 直连(wifi direct ) 分类: Android 2012-02-27 15:47 1837人阅读 评论(0) 收藏 举报 现在,Android的支持Wi -Fi的直接点对点点对点(P2P)Android系统的供电设备和其他类型的设备...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 53,235
精华内容 21,294
关键字:

企业直连