Search in sources :

Example 86 with Enterprise

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

the class BillServiceImpl method getEnterpriseMapByUserInfoId.

/**
 * 根据用户id查询订单表中对应的企业Map
 *
 * @param userInfo
 * @return
 */
public Map<Long, Enterprise> getEnterpriseMapByUserInfoId(Long userInfo) {
    Map<Long, Enterprise> enterpriseMap = new HashMap<Long, Enterprise>();
    List<Long> enterpriseIds = sqlSession.selectList("com.itrus.portal.db.BillMapper.selectEnterprisesByUserInfo", userInfo);
    if (null != enterpriseIds && !enterpriseIds.isEmpty()) {
        EnterpriseExample example = new EnterpriseExample();
        EnterpriseExample.Criteria criteria = example.or();
        criteria.andIdIn(enterpriseIds);
        enterpriseMap = sqlSession.selectMap("com.itrus.portal.db.EnterpriseMapper.selectByExample", example, "id");
    }
    return enterpriseMap;
}
Also used : EnterpriseExample(com.itrus.portal.db.EnterpriseExample) HashMap(java.util.HashMap) Enterprise(com.itrus.portal.db.Enterprise)

Example 87 with Enterprise

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

the class ReviewServiceImpl method agreeBillReview.

/**
 * pfx证书,当不要审核的时候,自动生成审核记录
 * @param bill
 */
public void agreeBillReview(Bill bill) {
    if (null == bill) {
        return;
    }
    // 填充营业执照运营时间
    Enterprise enterpriseInBill = enterpriseService.getEnterpriseByBillId(bill.getId());
    String soperationStart = null;
    String soperationEnd = null;
    List<BusinessLicense> oldBusinessLicenses = businessService.getBusinessLicensesNews(bill.getEnterprise());
    if (null != oldBusinessLicenses && !oldBusinessLicenses.isEmpty()) {
        for (BusinessLicense businessLicense1 : oldBusinessLicenses) {
            if (null != businessLicense1.getOperationStart() || null != businessLicense1.getOperationEnd()) {
                SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
                if (null != businessLicense1.getOperationStart()) {
                    soperationStart = format.format(businessLicense1.getOperationStart());
                }
                if (null != businessLicense1.getOperationEnd()) {
                    soperationEnd = format.format(businessLicense1.getOperationEnd());
                }
                break;
            }
        }
    }
    Product product = sqlSession.selectOne("com.itrus.portal.db.ProductMapper.selectByPrimaryKey", bill.getProduct());
    DigitalCert cert = sqlSession.selectOne("com.itrus.portal.db.DigitalCertMapper.selectByPrimaryKey", product.getCert());
    Certification certification = sqlSession.selectOne("com.itrus.portal.db.CertificationMapper.selectByPrimaryKey", product.getAuthentication());
    Project project = billService.getProjectByBillId(bill.getId());
    BusinessLicense businessLicense = businessService.getBusinessByBillId(bill.getId(), null);
    OrgCode orgCode = orgCodeService.getOrgCodeByBillId(bill.getId(), null);
    TaxRegisterCert taxregisterCert = taxCertService.getTaxRegisterCertByBillId(bill.getId(), null);
    IdentityCard identityCard = identityCardService.getIdentityCardByBillId(bill.getId(), null);
    Agent agent = agentService.getAgentByBillId(bill.getId(), null);
    Proxy proxy = proxyService.getProxyByBillId(bill.getId());
    // 更新管理员提交的认证项资料信息
    DefaultTransactionDefinition def = new DefaultTransactionDefinition();
    def.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);
    TransactionStatus status = transactionManager.getTransaction(def);
    try {
        Long businessId = null;
        Long orgCodeId = null;
        Long taxregisterId = null;
        Long identityCardId = null;
        Long agentId = null;
        Long proxyId = null;
        // 更新营业执照信息
        if (null != businessLicense && null != businessLicense.getId()) {
            businessLicense = businessService.updateBusinessLicense(soperationStart, soperationEnd, businessLicense, ComNames.ITEM_STATUS_2, bill.getEnterprise(), bill.getId(), bill.getUniqueId(), null);
            businessId = businessLicense.getId();
        }
        // 更新组织机构代码
        if (null != orgCode && null != orgCode.getId()) {
            orgCode = orgCodeService.updateOrgCode(orgCode, ComNames.ITEM_STATUS_2, bill.getEnterprise(), bill.getId(), bill.getUniqueId(), null);
            orgCodeId = orgCode.getId();
        }
        // 更新税务登记
        if (null != taxregisterCert && null != taxregisterCert.getId()) {
            taxregisterCert = taxCertService.updateTaxRegisterCert(taxregisterCert, ComNames.ITEM_STATUS_2, bill.getEnterprise(), bill.getId(), bill.getUniqueId(), null);
            taxregisterId = taxregisterCert.getId();
        }
        // 更新法定代表人
        if (null != identityCard && null != identityCard.getId()) {
            identityCard = identityCardService.updateIdentityCard(identityCard, ComNames.ITEM_STATUS_2, bill.getEnterprise(), bill.getId(), bill.getUniqueId(), null);
            identityCardId = identityCard.getId();
        }
        // 更新代理人
        if (null != agent && null != agent.getId()) {
            agent = agentService.updateAgent(agent, ComNames.ITEM_STATUS_2, bill.getEnterprise(), bill.getId(), bill.getUniqueId(), null);
            agentId = agent.getId();
        }
        // 更新授权书
        if (null != proxy && null != proxy.getId()) {
            proxy = proxyService.updateProxy(proxy, ComNames.ITEM_STATUS_2, bill.getEnterprise(), bill.getId(), bill.getUniqueId(), null, project);
            proxyId = proxy.getId();
        }
        // 设置第一个admin账号
        AdminExample adminExample = new AdminExample();
        adminExample.setOrderByClause("create_time ASC");
        List<Admin> admins = sqlSession.selectList("com.itrus.portal.db.AdminMapper.selectByExample", adminExample);
        // 更新企业信息
        Enterprise enterprise = enterpriseService.updateEnterprise(bill.getEnterprise(), certification.getId(), businessId, orgCodeId, taxregisterId, identityCardId, agentId);
        // 生成认证记录
        reviewLogService.saveReviewLog(2, admins.get(0).getId(), 1, null, bill.getEnterprise(), bill.getId(), bill.getUniqueId(), businessId, orgCodeId, taxregisterId, identityCardId, agentId, proxyId);
        bill.setCheckTime(new Date());
        sqlSession.update("com.itrus.portal.db.BillMapper.updateByPrimaryKey", bill);
        transactionManager.commit(status);
    } catch (Exception e) {
        e.printStackTrace();
    } finally {
        if (!status.isCompleted())
            transactionManager.rollback(status);
    }
}
Also used : Agent(com.itrus.portal.db.Agent) DefaultTransactionDefinition(org.springframework.transaction.support.DefaultTransactionDefinition) Product(com.itrus.portal.db.Product) TransactionStatus(org.springframework.transaction.TransactionStatus) Admin(com.itrus.portal.db.Admin) Certification(com.itrus.portal.db.Certification) Date(java.util.Date) ParseException(java.text.ParseException) UserInfoServiceException(com.itrus.portal.exception.UserInfoServiceException) DigitalCert(com.itrus.portal.db.DigitalCert) Project(com.itrus.portal.db.Project) OrgCode(com.itrus.portal.db.OrgCode) BusinessLicense(com.itrus.portal.db.BusinessLicense) Proxy(com.itrus.portal.db.Proxy) Enterprise(com.itrus.portal.db.Enterprise) SimpleDateFormat(java.text.SimpleDateFormat) AdminExample(com.itrus.portal.db.AdminExample) TaxRegisterCert(com.itrus.portal.db.TaxRegisterCert) IdentityCard(com.itrus.portal.db.IdentityCard)

Example 88 with Enterprise

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

the class OrgCodeServiceImpl method saveOrgCode1.

public OrgCode saveOrgCode1(Long enterPriseId, String enterpriseSn, Long billId, Long userInfoId, OrgCode orgCode, Integer itemStatus, OrgCode old) throws Exception {
    File imgDir = filePathUtils.getEnterpriseFile(enterpriseSn);
    Enterprise ent = sqlSession.selectOne("com.itrus.portal.db.EnterpriseMapper.selectByPrimaryKey", enterPriseId);
    // 判断组织机构代码图片是否重新上传了,没有重新上传,则会提交组织机构代码的id,重新上传,还是按照下面的方法处理
    if (null != orgCode.getId()) {
        OrgCode newOrgCode = new OrgCode();
        OrgCode oldOrgCode = sqlSession.selectOne("com.itrus.portal.db.OrgCodeMapper.selectByPrimaryKey", orgCode.getId());
        newOrgCode.setEnterpriseName(orgCode.getEnterpriseName());
        newOrgCode.setOrgCode(orgCode.getOrgCode());
        newOrgCode.setCreateTime(new Date());
        newOrgCode.setLastModify(new Date());
        newOrgCode.setEnterprise(enterPriseId);
        newOrgCode.setBill(billId);
        newOrgCode.setUserInfo(userInfoId);
        // 审核状态:1未审核,2已审核,3已拒绝
        newOrgCode.setItemStatus(oldOrgCode.getItemStatus());
        if (null != orgCode.getOrgCodeType())
            newOrgCode.setOrgCodeType(orgCode.getOrgCodeType());
        if (StringUtils.isNotBlank(orgCode.getImgFile())) {
            File liceImg = filePathUtils.saveImg(imgDir, null, orgCode.getImgFile(), IMG_DEFAULT_TYPE, IMG_NAME_ORG);
            if (liceImg != null && liceImg.isFile()) {
                newOrgCode.setImgFile(liceImg.getName());
                newOrgCode.setImgFileHash(HMACSHA1.genSha1HashOfFile(liceImg));
            }
        } else {
            newOrgCode.setImgFile(oldOrgCode.getImgFile());
            newOrgCode.setImgFileHash(oldOrgCode.getImgFileHash());
        }
        sqlSession.insert("com.itrus.portal.db.OrgCodeMapper.insert", newOrgCode);
        sqlSession.flushStatements();
        return newOrgCode;
    }
    if ((null == orgCode || StringUtils.isBlank(orgCode.getEnterpriseName()) || StringUtils.isBlank(orgCode.getOrgCode())) && ent.getEnterpriseNature() != 2) {
        throw new UserInfoServiceException("请提交完整的组织机构代码信息");
    }
    orgCode.setCreateTime(new Date());
    orgCode.setLastModify(new Date());
    orgCode.setEnterprise(enterPriseId);
    orgCode.setBill(billId);
    orgCode.setUserInfo(userInfoId);
    // 审核状态:1未审核,2已审核,3已拒绝
    orgCode.setItemStatus(itemStatus);
    if (StringUtils.isNotBlank(orgCode.getImgFile()) && !ComNames.USE_OLD_IMG.equals(orgCode.getImgFile())) {
        File liceImg = filePathUtils.saveImg(imgDir, null, orgCode.getImgFile(), IMG_DEFAULT_TYPE, IMG_NAME_ORG);
        if (liceImg != null && liceImg.isFile()) {
            orgCode.setImgFile(liceImg.getName());
            orgCode.setImgFileHash(HMACSHA1.genSha1HashOfFile(liceImg));
        }
    }
    if (old == null) {
        sqlSession.insert("com.itrus.portal.db.OrgCodeMapper.insert", orgCode);
    } else {
        orgCode.setId(old.getId());
        sqlSession.update("com.itrus.portal.db.OrgCodeMapper.updateByPrimaryKey", orgCode);
    }
    sqlSession.flushStatements();
    return orgCode;
}
Also used : OrgCode(com.itrus.portal.db.OrgCode) Enterprise(com.itrus.portal.db.Enterprise) File(java.io.File) Date(java.util.Date) UserInfoServiceException(com.itrus.portal.exception.UserInfoServiceException)

Example 89 with Enterprise

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

the class SendReNewInfoTask method sendReNewInfo.

/**
 * 心跳更新。启动时执行一次,之后每隔24小时执行一次
 */
@Scheduled(fixedRate = 1000 * 60 * 60 * 24)
public void sendReNewInfo() {
    // 筛选出所有是待更新的,而且未发送短信的订单
    BillExample billExample = new BillExample();
    BillExample.Criteria criteria = billExample.or();
    // 订单状态是12的时候,表示是待更新的订单
    criteria.andBillStatusEqualTo(ComNames.BILL_STATUS_12);
    // 订单的短信发送时间是Null的时候,表示未发送过通知短信
    criteria.andRenewSendTimeIsNull();
    criteria.andIsDeleteEqualTo(false);
    // billExample.setLimit(100);
    List<Bill> bills = sqlSession.selectList("com.itrus.portal.db.BillMapper.selectByExample", billExample);
    if (null == bills || bills.size() < 1) {
        return;
    }
    String billSn = "";
    String mPhone = "";
    try {
        // 向每个订单发送短信通知
        for (int i = 0; i < bills.size(); i++) {
            billSn = bills.get(i).getBillId();
            UserInfo userInfo = sqlSession.selectOne("com.itrus.portal.db.UserInfoMapper.selectByPrimaryKey", bills.get(i).getUniqueId());
            mPhone = userInfo.getmPhone();
            UserCertExample userCertExample = new UserCertExample();
            UserCertExample.Criteria ucriteria = userCertExample.or();
            ucriteria.andIdEqualTo(bills.get(i).getOldUserCert());
            UserCert userCert = sqlSession.selectOne("com.itrus.portal.db.UserCertMapper.selectByExample", userCertExample);
            Enterprise enterprise = sqlSession.selectOne("com.itrus.portal.db.EnterpriseMapper.selectByPrimaryKey", bills.get(i).getEnterprise());
            Long projectId = bills.get(i).getProject();
            String keySn = "";
            if (null == userCert.getKeySn()) {
                keySn = "该证书未绑定key";
            } else {
                keySn = userCert.getKeySn();
            }
            String enterpriseName = enterprise.getEnterpriseName();
            Date endTime = userCert.getCertEndTime();
            // 获取订单对应的产品信息
            Product product = sqlSession.selectOne("com.itrus.portal.db.ProductMapper.selectByPrimaryKey", bills.get(i).getProduct());
            String productName = product.getName();
            try {
                makeCerServiceImpl.sendReNewInfo(bills.get(i), mPhone, projectId, "ZSGX", keySn, enterpriseName, endTime, productName);
            } catch (UserInfoServiceException e) {
                String type = "发送证书更新通知失败";
                String info = "用户手机号:" + mPhone + ",订单号" + bills.get(i).getBillId() + "错误信息:" + e.getMessage();
                LogUtil.syslog(sqlSession, type, info);
                log.error("ERRORLOG证书更新通知 {}", info);
                return;
            } catch (Exception e) {
                String type = "发送证书更新通知失败";
                String info = "用户手机号:" + mPhone + ",订单号" + bills.get(i).getBillId() + "错误信息:" + e.getMessage();
                LogUtil.syslog(sqlSession, type, info);
                log.error("ERRORLOG证书更新通知 {}", info);
                return;
            }
        }
    } catch (Exception e) {
        String type = "发送证书更新通知失败";
        String info = "用户手机号:" + mPhone + ",订单号" + billSn + "错误信息:" + e.getMessage();
        LogUtil.syslog(sqlSession, type, info);
        log.error("ERRORLOG证书更新通知 {}", info);
        return;
    }
}
Also used : UserCertExample(com.itrus.portal.db.UserCertExample) Product(com.itrus.portal.db.Product) UserInfo(com.itrus.portal.db.UserInfo) Date(java.util.Date) UserInfoServiceException(com.itrus.portal.exception.UserInfoServiceException) UserInfoServiceException(com.itrus.portal.exception.UserInfoServiceException) BillExample(com.itrus.portal.db.BillExample) Bill(com.itrus.portal.db.Bill) Enterprise(com.itrus.portal.db.Enterprise) UserCert(com.itrus.portal.db.UserCert) Scheduled(org.springframework.scheduling.annotation.Scheduled)

Example 90 with Enterprise

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

the class SubmitReviewTask method query.

/**
 * 查询送审
 */
public void query() {
    if (!isRun()) {
        return;
    }
    // 获取第三方鉴证配置信息
    AuditSystemConfig auditSystemConfig = auditSystemConfigService.getAuditSystemConfig(new AuditSystemConfigExample());
    // 未配置第三方鉴证信息、未开启查询送审、未配置查询送审时间间隔,直接返回
    if (null == auditSystemConfig || !auditSystemConfig.getIsQuery() || null == auditSystemConfig.getQueryInterval()) {
        log.debug("未配置第三方鉴证信息、未开启查询送审、未配置查询送审时间间隔--返回");
        return;
    }
    // 上次查询送审时间为空,或者上次查询送审时间大于当前时间,则重新设置上次查询送审时间为当前时间的毫秒数
    if (null == auditSystemConfig.getQueryStartTime() || auditSystemConfig.getQueryStartTime() > System.currentTimeMillis()) {
        auditSystemConfig.setQueryStartTime(System.currentTimeMillis());
        auditSystemConfigService.updateAuditSystemConfig(auditSystemConfig);
    }
    // 判断是否在查询送审的时间间隔内(当前时间小于 上次查询送审时间加上送审时间间隔)
    if (System.currentTimeMillis() < auditSystemConfig.getQueryStartTime() + (auditSystemConfig.getQueryInterval() * 1000)) {
        log.debug("不在查询送审时间内");
        return;
    }
    // 设置本次送审时间
    auditSystemConfig.setQueryStartTime(System.currentTimeMillis());
    auditSystemConfigService.updateAuditSystemConfig(auditSystemConfig);
    // TransactionStatus s = null;
    try {
        // 获取送审中的订单
        Map<Long, List<Bill>> billListMap = submitReviewService.getQueryBill(submitReviewService.getAuditProduct());
        // 根据产品来提交信息
        Product product = null;
        Enterprise ent = null;
        JSONObject jsonMap = null;
        JSONObject data = null;
        BusinessLicense bl = null;
        OrgCode oc = null;
        TaxRegisterCert trc = null;
        IdentityCard ic = null;
        Agent at = null;
        Proxy p = null;
        Product product1 = null;
        Product product2 = null;
        Product product3 = null;
        int count;
        int reject;
        for (Long productId : billListMap.keySet()) {
            List<Bill> billList = billListMap.get(productId);
            product = sqlSession.selectOne("com.itrus.portal.db.ProductMapper.selectByPrimaryKey", productId);
            DigitalCert cert1 = null;
            DigitalCert cert2 = null;
            DigitalCert cert3 = null;
            if (null != product.getIsCombined() && product.getIsCombined() == 1) {
                if (null != product.getCombinedId()) {
                    String[] comb = product.getCombinedId().split(",");
                    product1 = sqlSession.selectOne("com.itrus.portal.db.ProductMapper.selectByPrimaryKey", Long.parseLong(comb[0]));
                    product2 = sqlSession.selectOne("com.itrus.portal.db.ProductMapper.selectByPrimaryKey", Long.parseLong(comb[1]));
                    if (comb.length == 3) {
                        product3 = sqlSession.selectOne("com.itrus.portal.db.ProductMapper.selectByPrimaryKey", Long.parseLong(comb[2]));
                    }
                }
                if (null != product1 && null != product1.getCert()) {
                    // 产品关联的数字证书
                    cert1 = sqlSession.selectOne("com.itrus.portal.db.DigitalCertMapper.selectByPrimaryKey", product1.getCert());
                }
                if (null != product2 && null != product2.getCert()) {
                    // 产品关联的数字证书
                    cert2 = sqlSession.selectOne("com.itrus.portal.db.DigitalCertMapper.selectByPrimaryKey", product2.getCert());
                }
                if (null != product3 && null != product3.getCert()) {
                    // 产品关联的数字证书
                    cert3 = sqlSession.selectOne("com.itrus.portal.db.DigitalCertMapper.selectByPrimaryKey", product3.getCert());
                }
            }
            DigitalCert cert = sqlSession.selectOne("com.itrus.portal.db.DigitalCertMapper.selectByPrimaryKey", product.getCert());
            count = 0;
            reject = 0;
            for (Bill bill : billList) {
                ent = sqlSession.selectOne("com.itrus.portal.db.EnterpriseMapper.selectByPrimaryKey", bill.getEnterprise());
                if (null == jsonMap) {
                    jsonMap = new JSONObject();
                }
                jsonMap.put("appId", product.getAppId());
                jsonMap.put("appsecret", product.getAppsecret());
                // 待查询的记录id
                jsonMap.put("dataid", bill.getDataId());
                String result = RequestUtils.post(auditSystemConfig.getAuditSystemUrl() + queryUrl, jsonMap.toString(), product.getAppsecret());
                // log.info(result);
                data = JSON.parseObject(result);
                if (data.getInteger("status") != 200) {
                    continue;
                }
                data = data.getJSONObject("result");
                // 将返回信息同步至订单状态
                // 0是未通过,1是通过,2是审核中
                int status = data.getInteger("auditstatus");
                // data.getString("auditmessage");
                if (status == 2 || status == 1003) {
                    continue;
                }
                // DefaultTransactionDefinition def = new
                // DefaultTransactionDefinition();
                // def.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);
                // s = transactionManager.getTransaction(def);
                String reason = data.getString("auditresult");
                bill.setBillStatus(ComNames.BILL_STATUS_4);
                bill.setCheckTime(new Date(data.getLong("auditdate")));
                bill.setCancelReason(reason);
                bl = businessService.getBusinessByBillId(bill.getId(), null);
                oc = orgCodeService.getOrgCodeByBillId(bill.getId(), null);
                trc = taxCertService.getTaxRegisterCertByBillId(bill.getId(), null);
                ic = identityCardService.getIdentityCardByBillId(bill.getId(), null);
                at = agentService.getAgentByBillId(bill.getId(), null);
                // 默认未审核
                Integer itemStatus = 1;
                JsonNode respNode = jsonTool.readTree(result);
                if (status == 1) {
                    if (respNode.get("source") != null) {
                        ent.setInfo(respNode.get("source").getTextValue().getBytes());
                    }
                    bill.setBillStatus(ComNames.BILL_STATUS_5);
                    if (bill.getOldUserCert() != null) {
                        bill.setBillStatus(ComNames.BILL_STATUS_12);
                    }
                    // 数字证书操作方式为用户下载(2)的,订单状态设置为待下载
                    if (null != cert && null != cert.getInitBuy() && "2".equals(cert.getInitBuy())) {
                        bill.setBillStatus(ComNames.BILL_STATUS_13);
                    }
                    // 当产品没有配置有数字证书的时候
                    if (null == cert && null == cert1 && null == cert2 && null == cert3) {
                        // 根据订单判断订单是否需要开票:0标识不需要开票,1需要开纸质发票,2需要开电子发票
                        int type = billService.getBillInvoiceType(bill);
                        switch(type) {
                            case 0:
                                bill.setBillStatus(ComNames.BILL_STATUS_8);
                                break;
                            case 1:
                                if (null != bill.getIsInvoiced() && bill.getIsInvoiced().equals(1)) {
                                    bill.setBillStatus(ComNames.BILL_STATUS_7);
                                } else {
                                    bill.setBillStatus(ComNames.BILL_STATUS_6);
                                }
                                break;
                            case 2:
                                if (null != bill.getIsInvoiced() && bill.getIsInvoiced().equals(1)) {
                                    bill.setBillStatus(ComNames.BILL_STATUS_8);
                                } else {
                                    bill.setBillStatus(ComNames.BILL_STATUS_6);
                                }
                                break;
                            default:
                                break;
                        }
                    }
                    ent.setAuthenticationLevel(product.getAuthentication());
                    ent.setReviewTime(new Date());
                    // 设置状态
                    itemStatus = 2;
                    count++;
                } else if (status == 0) {
                    // 审核拒绝
                    itemStatus = 3;
                    // 发送短信
                    if (reviewService.sendSmsBySHJJ(bill.getId())) {
                        bill.setIsSms(true);
                        bill.setSendTime(new Date());
                    }
                    reject++;
                }
                // 更新认证项
                if (null != bl) {
                    bl.setItemStatus(itemStatus);
                    reviewService.saveBl(bl, respNode.get("source"));
                    ent.setHasBl(bl.getId());
                    if (status == 1 && respNode.get("source") == null) {
                        // 通过 无值
                        String pid = systemConfigService.getReviewProjectId();
                        if (null != pid && Long.valueOf(pid) == bill.getProject()) {
                            // 用友
                            bill.setBillStatus(ComNames.BILL_STATUS_10);
                            LogUtil.syslog(this.sqlSession, "查询送审", "错误:" + bill.getBillId() + respNode.toString());
                        }
                    }
                }
                if (null != oc) {
                    oc.setItemStatus(itemStatus);
                    sqlSession.update("com.itrus.portal.db.OrgCodeMapper.updateByPrimaryKeySelective", oc);
                    ent.setHasOrgCode(oc.getId());
                }
                if (null != trc) {
                    trc.setItemStatus(itemStatus);
                    sqlSession.update("com.itrus.portal.db.TaxRegisterCertMapper.updateByPrimaryKeySelective", trc);
                    ent.setHasTaxCert(trc.getId());
                }
                if (null != ic) {
                    ic.setItemStatus(itemStatus);
                    sqlSession.update("com.itrus.portal.db.IdentityCardMapper.updateByPrimaryKeySelective", ic);
                    ent.setHasIdCard(ic.getId());
                }
                if (null != at) {
                    at.setItemStatus(itemStatus);
                    sqlSession.update("com.itrus.portal.db.AgentMapper.updateByPrimaryKeySelective", at);
                    ent.setHasAgent(at.getId());
                }
                // 更新企业
                sqlSession.update("com.itrus.portal.db.EnterpriseMapper.updateByPrimaryKeyWithBLOBs", ent);
                p = proxyService.getProxyByBillId(bill.getId());
                if (p != null) {
                    p.setItemStatus(2);
                    sqlSession.update("com.itrus.portal.db.ProxyMapper.updateByPrimaryKeySelective", p);
                }
                sqlSession.update("com.itrus.portal.db.BillMapper.updateByPrimaryKeySelective", bill);
                reviewLogService.saveReviewLog(1, null, status == 1 ? 1 : 2, reason, ent.getId(), bill.getId(), bill.getUniqueId(), bl == null ? null : bl.getId(), oc == null ? null : oc.getId(), trc == null ? null : trc.getId(), ic == null ? null : ic.getId(), at == null ? null : at.getId(), p == null ? null : p.getId());
            // transactionManager.commit(s);
            }
            LogUtil.syslog(sqlSession, "批量查询送审结果", "产品名称:" + product.getName() + ",订单" + billList.size() + "条,审核通过" + count + "条,审核拒绝" + reject + "条");
        }
        log.debug("查询送审结果结束");
    } catch (Exception e) {
        log.error("ERRORLOG查询送审 {}", e.getMessage());
        e.printStackTrace();
        return;
    }
// finally{
// if (s != null && !s.isCompleted()) {
// transactionManager.rollback(s);
// }
// }
}
Also used : Agent(com.itrus.portal.db.Agent) AuditSystemConfig(com.itrus.portal.db.AuditSystemConfig) AuditSystemConfigExample(com.itrus.portal.db.AuditSystemConfigExample) Product(com.itrus.portal.db.Product) JsonNode(org.codehaus.jackson.JsonNode) Date(java.util.Date) UnknownHostException(java.net.UnknownHostException) OrgCode(com.itrus.portal.db.OrgCode) DigitalCert(com.itrus.portal.db.DigitalCert) BusinessLicense(com.itrus.portal.db.BusinessLicense) Proxy(com.itrus.portal.db.Proxy) JSONObject(com.alibaba.fastjson.JSONObject) Enterprise(com.itrus.portal.db.Enterprise) Bill(com.itrus.portal.db.Bill) List(java.util.List) TaxRegisterCert(com.itrus.portal.db.TaxRegisterCert) IdentityCard(com.itrus.portal.db.IdentityCard)

Aggregations

Enterprise (com.itrus.portal.db.Enterprise)94 UserInfo (com.itrus.portal.db.UserInfo)68 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)58 HashMap (java.util.HashMap)47 UserInfoServiceException (com.itrus.portal.exception.UserInfoServiceException)37 IOException (java.io.IOException)32 Product (com.itrus.portal.db.Product)27 HttpSession (javax.servlet.http.HttpSession)27 Bill (com.itrus.portal.db.Bill)26 BusinessLicense (com.itrus.portal.db.BusinessLicense)26 TaxRegisterCert (com.itrus.portal.db.TaxRegisterCert)25 ExtraProduct (com.itrus.portal.db.ExtraProduct)24 OrgCode (com.itrus.portal.db.OrgCode)23 IdentityCard (com.itrus.portal.db.IdentityCard)22 UserinfoEnterprise (com.itrus.portal.db.UserinfoEnterprise)22 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)22 ExtraBill (com.itrus.portal.db.ExtraBill)21 Project (com.itrus.portal.db.Project)20 UserCert (com.itrus.portal.db.UserCert)19 Agent (com.itrus.portal.db.Agent)18