Search in sources :

Example 76 with Enterprise

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

the class ExtraBillReceiptController method show.

// 显示详情
@RequestMapping(value = "/{id}", produces = "text/html")
public String show(@PathVariable("id") Long id, Model uiModel) {
    // 管理员项目权限
    Long[] projectsOfAdmin = getProjectLongIdsOfAdmin();
    List<Long> projectsOfAdminList = Arrays.asList(projectsOfAdmin);
    ExtraBillExample billExample = new ExtraBillExample();
    ExtraBillExample.Criteria criteria = billExample.or();
    criteria.andIdEqualTo(id);
    criteria.andProjectIn(projectsOfAdminList);
    ExtraBill bill = sqlSession.selectOne("com.itrus.portal.db.ExtraBillMapper.selectByExample", billExample);
    if (null == bill) {
        uiModel.addAttribute("errorMsg", "未找到该订单");
        return "status403";
    }
    uiModel.addAttribute("bill", bill);
    // 项目
    Project project = sqlSession.selectOne("com.itrus.portal.db.ProjectMapper.selectByPrimaryKey", bill.getProject());
    uiModel.addAttribute("project", project);
    // 企业
    Enterprise enterprise = sqlSession.selectOne("com.itrus.portal.db.EnterpriseMapper.selectByPrimaryKey", bill.getEnterprise());
    uiModel.addAttribute("enterprise", enterprise);
    // 产品
    ExtraProduct product = sqlSession.selectOne("com.itrus.portal.db.ExtraProductMapper.selectByPrimaryKey", bill.getExtraProduct());
    uiModel.addAttribute("product", product);
    // 规格
    ExtraProductSpec productSpec = sqlSession.selectOne("com.itrus.portal.db.ExtraProductSpecMapper.selectByPrimaryKey", bill.getExtraProductSpec());
    uiModel.addAttribute("productSpec", productSpec);
    // 服务商
    ServiceProvider serviceProvider = serviceProviderService.selectByPrimaryKey(product.getServiceProvider());
    uiModel.addAttribute("serviceProvider", serviceProvider);
    // 用户
    UserInfo userInfo = sqlSession.selectOne("com.itrus.portal.db.UserInfoMapper.selectByPrimaryKey", bill.getUniqueId());
    uiModel.addAttribute("userInfo", userInfo);
    // 第三方支付信息
    OnPayInfo onPayInfo = sqlSession.selectOne("com.itrus.portal.db.OnPayInfoMapper.selectByPrimaryKey", bill.getOnPayInfo());
    uiModel.addAttribute("onPayInfo", onPayInfo);
    // 电子发票
    Einvoice einvoice = sqlSession.selectOne("com.itrus.portal.db.EinvoiceMapper.selectByPrimaryKey", bill.geteInvoice());
    uiModel.addAttribute("einvoice", einvoice);
    if (einvoice != null && einvoice.geteReiceipt() != null) {
        // 电子发票类型
        Ereceipt ereceipt = sqlSession.selectOne("com.itrus.portal.db.EreceiptMapper.selectByPrimaryKey", einvoice.geteReiceipt());
        uiModel.addAttribute("ereceipt", ereceipt);
    }
    // 其他附加信息
    // 营业执照
    BusinessLicense businessLicense = businessService.getBusinessByExtraBillId(id, null);
    uiModel.addAttribute("businessLicense", businessLicense);
    // 税务登记
    TaxRegisterCert taxRegisterCert = taxCertService.getTaxRegisterCertByExtraBillId(id, null);
    uiModel.addAttribute("taxRegisterCert", taxRegisterCert);
    // 组织机构代码
    OrgCode orgCode = orgCodeService.getOrgCodeByExtraBillId(id, null);
    uiModel.addAttribute("orgCode", orgCode);
    // 代理人
    Agent agent = agentService.getAgentByExtraBillId(id, null);
    uiModel.addAttribute("agent", agent);
    // 开户行信息
    OpenBankInfo openBankInfo = openBankInfoService.getOpenBankInfoByExtraBillId(id, null);
    uiModel.addAttribute("openBankInfo", openBankInfo);
    // 法人信息
    IdentityCard identityCard = identityCardService.getIdentityCardByExtraBillId(id, null);
    uiModel.addAttribute("identityCard", identityCard);
    // TODO 还需要补充订单对应的附加信息和第三方回调信息
    return "extrabillreceipt/show";
}
Also used : Ereceipt(com.itrus.portal.db.Ereceipt) Agent(com.itrus.portal.db.Agent) ExtraBill(com.itrus.portal.db.ExtraBill) ExtraProductSpec(com.itrus.portal.db.ExtraProductSpec) UserInfo(com.itrus.portal.db.UserInfo) Einvoice(com.itrus.portal.db.Einvoice) ExtraBillExample(com.itrus.portal.db.ExtraBillExample) Project(com.itrus.portal.db.Project) ExtraProduct(com.itrus.portal.db.ExtraProduct) OrgCode(com.itrus.portal.db.OrgCode) BusinessLicense(com.itrus.portal.db.BusinessLicense) OnPayInfo(com.itrus.portal.db.OnPayInfo) OpenBankInfo(com.itrus.portal.db.OpenBankInfo) ServiceProvider(com.itrus.portal.db.ServiceProvider) Enterprise(com.itrus.portal.db.Enterprise) TaxRegisterCert(com.itrus.portal.db.TaxRegisterCert) IdentityCard(com.itrus.portal.db.IdentityCard) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 77 with Enterprise

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

the class ExtraBillReviewController method show.

// 显示详情
@RequestMapping(value = "/{id}", produces = "text/html")
public String show(@PathVariable("id") Long id, Model uiModel) {
    // 管理员项目权限
    Long[] projectsOfAdmin = getProjectLongIdsOfAdmin();
    List<Long> projectsOfAdminList = Arrays.asList(projectsOfAdmin);
    ExtraBillExample billExample = new ExtraBillExample();
    ExtraBillExample.Criteria criteria = billExample.or();
    criteria.andIdEqualTo(id);
    criteria.andProjectIn(projectsOfAdminList);
    ExtraBill bill = sqlSession.selectOne("com.itrus.portal.db.ExtraBillMapper.selectByExample", billExample);
    if (null == bill) {
        uiModel.addAttribute("errorMsg", "未找到该订单");
        return "status403";
    }
    uiModel.addAttribute("bill", bill);
    // 项目
    Project project = sqlSession.selectOne("com.itrus.portal.db.ProjectMapper.selectByPrimaryKey", bill.getProject());
    uiModel.addAttribute("project", project);
    // 企业
    Enterprise enterprise = sqlSession.selectOne("com.itrus.portal.db.EnterpriseMapper.selectByPrimaryKey", bill.getEnterprise());
    uiModel.addAttribute("enterprise", enterprise);
    // 产品
    ExtraProduct product = sqlSession.selectOne("com.itrus.portal.db.ExtraProductMapper.selectByPrimaryKey", bill.getExtraProduct());
    uiModel.addAttribute("product", product);
    // 规格
    ExtraProductSpec productSpec = sqlSession.selectOne("com.itrus.portal.db.ExtraProductSpecMapper.selectByPrimaryKey", bill.getExtraProductSpec());
    uiModel.addAttribute("productSpec", productSpec);
    // 服务商
    ServiceProvider serviceProvider = serviceProviderService.selectByPrimaryKey(product.getServiceProvider());
    uiModel.addAttribute("serviceProvider", serviceProvider);
    // 用户
    UserInfo userInfo = sqlSession.selectOne("com.itrus.portal.db.UserInfoMapper.selectByPrimaryKey", bill.getUniqueId());
    uiModel.addAttribute("userInfo", userInfo);
    // 第三方支付信息
    OnPayInfo onPayInfo = sqlSession.selectOne("com.itrus.portal.db.OnPayInfoMapper.selectByPrimaryKey", bill.getOnPayInfo());
    uiModel.addAttribute("onPayInfo", onPayInfo);
    // 电子发票
    Einvoice einvoice = sqlSession.selectOne("com.itrus.portal.db.EinvoiceMapper.selectByPrimaryKey", bill.geteInvoice());
    uiModel.addAttribute("einvoice", einvoice);
    // 其他附加信息
    // 营业执照
    BusinessLicense businessLicense = businessService.getBusinessByExtraBillId(id, null);
    uiModel.addAttribute("businessLicense", businessLicense);
    // 税务登记
    TaxRegisterCert taxRegisterCert = taxCertService.getTaxRegisterCertByExtraBillId(id, null);
    uiModel.addAttribute("taxRegisterCert", taxRegisterCert);
    // 组织机构代码
    OrgCode orgCode = orgCodeService.getOrgCodeByExtraBillId(id, null);
    uiModel.addAttribute("orgCode", orgCode);
    // 代理人
    Agent agent = agentService.getAgentByExtraBillId(id, null);
    uiModel.addAttribute("agent", agent);
    // 开户行信息
    OpenBankInfo openBankInfo = openBankInfoService.getOpenBankInfoByExtraBillId(id, null);
    uiModel.addAttribute("openBankInfo", openBankInfo);
    // 法人信息
    IdentityCard identityCard = identityCardService.getIdentityCardByExtraBillId(id, null);
    uiModel.addAttribute("identityCard", identityCard);
    // TODO 还需要补充订单对应的附加信息和第三方回调信息
    return "extrabillreview/show";
}
Also used : Agent(com.itrus.portal.db.Agent) ExtraBill(com.itrus.portal.db.ExtraBill) ExtraProductSpec(com.itrus.portal.db.ExtraProductSpec) UserInfo(com.itrus.portal.db.UserInfo) Einvoice(com.itrus.portal.db.Einvoice) ExtraBillExample(com.itrus.portal.db.ExtraBillExample) Project(com.itrus.portal.db.Project) ExtraProduct(com.itrus.portal.db.ExtraProduct) OrgCode(com.itrus.portal.db.OrgCode) BusinessLicense(com.itrus.portal.db.BusinessLicense) OnPayInfo(com.itrus.portal.db.OnPayInfo) OpenBankInfo(com.itrus.portal.db.OpenBankInfo) ServiceProvider(com.itrus.portal.db.ServiceProvider) Enterprise(com.itrus.portal.db.Enterprise) TaxRegisterCert(com.itrus.portal.db.TaxRegisterCert) IdentityCard(com.itrus.portal.db.IdentityCard) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 78 with Enterprise

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

the class ExtraBillReviewController method sendSmsBySHJJ.

/**
 * 手动发送审核拒绝短信通知
 *
 * @param billId
 * @return
 */
@RequestMapping("/sendSmsBySHJJ")
@ResponseBody
public synchronized Map<String, Object> sendSmsBySHJJ(@RequestParam(value = "billId", required = true) Long billId) {
    Map<String, Object> retMap = new HashMap<String, Object>();
    retMap.put("retCode", 0);
    // 修改订单
    ExtraBill bill = extraBillService.selectByPrimaryKey(billId);
    if (null == bill) {
        retMap.put("retMsg", "订单不存在");
        return retMap;
    }
    // 查询短信模版
    // 查找对应项目的消息模版:SHJJ
    MessageTemplate messageTemplate = messageTemplateService.getMsgTemp(bill.getProject(), "SHJJ");
    if (null == messageTemplate) {
        retMap.put("retMsg", "审核拒绝短信模版不存在,请联系系统管理员配置");
        return retMap;
    }
    Enterprise enterprise = sqlSession.selectOne("com.itrus.portal.db.EnterpriseMapper.selectByPrimaryKey", bill.getEnterprise());
    ExtraProduct product = extraProductService.selectByPrimaryKey(bill.getExtraProduct());
    Project project = sqlSession.selectOne("com.itrus.portal.db.ProjectMapper.selectByPrimaryKey", bill.getProject());
    UserInfo userInfo = sqlSession.selectOne("com.itrus.portal.db.UserInfoMapper.selectByPrimaryKey", bill.getUniqueId());
    String content = messageTemplate.getMessageContent();
    // 替换特定内容:企业名称:enterpriseName,产品名称:productName,项目名称:projectName,拒绝原因:reason
    if (content.contains("enterpriseName")) {
        content = content.replaceAll("enterpriseName", enterprise.getEnterpriseName());
    }
    if (content.contains("productName")) {
        content = content.replaceAll("productName", product.getAppName());
    }
    if (content.contains("projectName")) {
        content = content.replaceAll("projectName", project.getName());
    }
    if (content.contains("reason")) {
        content = content.replaceAll("reason", bill.getRefuseReason());
    }
    // 发送短信
    try {
        smsSendService.sendRefuseReview(userInfo.getmPhone(), content, "SHJJ", project.getId(), userInfo.getUniqueId(), bill.getBillId());
    } catch (Exception e) {
        e.printStackTrace();
    }
    bill.setIsRefuseSms(true);
    bill.setSendTime(new Date());
    try {
        extraBillService.updateByPrimaryKey(bill);
        retMap.put("retCode", 1);
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    return retMap;
}
Also used : MessageTemplate(com.itrus.portal.db.MessageTemplate) ExtraProduct(com.itrus.portal.db.ExtraProduct) Project(com.itrus.portal.db.Project) HashMap(java.util.HashMap) ExtraBill(com.itrus.portal.db.ExtraBill) Enterprise(com.itrus.portal.db.Enterprise) UserInfo(com.itrus.portal.db.UserInfo) Date(java.util.Date) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 79 with Enterprise

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

the class ExtraQueryBillController method updateExtraBillStatus.

/**
 * 执行修改订单状态的方法
 * @param id
 * @param bill_status
 * @param uiModel
 * @return
 */
@RequestMapping(value = "/update_extrabill_status", produces = "text/html")
public String updateExtraBillStatus(@RequestParam(value = "id", required = true) Long id, @RequestParam(value = "bill_status", required = true) Integer bill_status, Model uiModel) {
    ExtraBill bill = extraBillService.selectByPrimaryKey(id);
    if (null == bill) {
        return "status403";
    }
    Integer oldStatus = bill.getBillStatus();
    bill.setBillStatus(bill_status);
    try {
        extraBillService.updateByPrimaryKey(bill);
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    uiModel.addAttribute("bill", bill);
    Enterprise enterprise = sqlSession.selectOne("com.itrus.portal.db.EnterpriseMapper.selectByPrimaryKey", bill.getEnterprise());
    uiModel.addAttribute("enterprise", enterprise);
    // 记录管理员修改日志
    LogUtil.adminlog(sqlSession, "修改订单状态", enterprise.getEnterpriseName() + "[" + bill.getBillId() + "],订单状态由" + oldStatus + "改为了" + bill.getBillStatus());
    return "redirect:/extraquerybill/update_extrabill_status_page/" + bill.getId();
}
Also used : ExtraBill(com.itrus.portal.db.ExtraBill) Enterprise(com.itrus.portal.db.Enterprise) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 80 with Enterprise

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

the class EnterpriseController method list.

/**
 * 列表
 *
 * @param enterpriseName
 *            企业名称
 * @param enterpriseSn
 *            企业标识
 * @param authenticationLevel
 *            认证等级
 * @param enterpriseNature
 *            企业性质
 * @param page
 * @param size
 * @param queryDate1
 * @param queryDate2
 * @param uiModel
 * @return
 */
@RequestMapping(produces = "text/html")
public String list(@RequestParam(value = "enterpriseName", required = false) String enterpriseName, @RequestParam(value = "enterpriseSn", required = false) String enterpriseSn, @RequestParam(value = "authenticationLevel", required = false) Long authenticationLevel, @RequestParam(value = "enterpriseNature", required = false) Integer enterpriseNature, @RequestParam(value = "orgIndustry", required = false) Integer orgIndustry, @RequestParam(value = "page", required = false) Integer page, @RequestParam(value = "size", required = false) Integer size, @RequestParam(value = "queryDate1", required = false) Date queryDate1, @RequestParam(value = "queryDate2", required = false) Date queryDate2, Model uiModel) {
    if (queryDate1 == null && queryDate2 == null) {
        Calendar calendar = Calendar.getInstance();
        calendar.add(Calendar.DATE, 1);
        calendar.set(Calendar.HOUR_OF_DAY, 0);
        calendar.set(Calendar.MINUTE, 0);
        calendar.set(Calendar.SECOND, 0);
        calendar.set(Calendar.MILLISECOND, 0);
        calendar.add(Calendar.MILLISECOND, -1);
        queryDate2 = calendar.getTime();
        calendar.add(Calendar.MILLISECOND, 1);
        calendar.add(Calendar.MONTH, -1);
        queryDate1 = calendar.getTime();
    }
    // 查询认证等级map
    Map<Long, Certification> certificationMap = sqlSession.selectMap("com.itrus.portal.db.CertificationMapper.selectByExample", "id");
    uiModel.addAttribute("certificationMap", certificationMap);
    uiModel.addAttribute("enterpriseName", enterpriseName);
    uiModel.addAttribute("enterpriseSn", enterpriseSn);
    uiModel.addAttribute("authenticationLevel", authenticationLevel);
    uiModel.addAttribute("enterpriseNature", enterpriseNature);
    uiModel.addAttribute("orgIndustry", orgIndustry);
    uiModel.addAttribute("queryDate1", queryDate1);
    uiModel.addAttribute("queryDate2", queryDate2);
    if (page == null || page < 1) {
        page = 1;
    }
    if (size == null || size < 1) {
        size = 10;
    }
    // 管理员可查看所有企业信息
    EnterpriseExample enterpriseExample = new EnterpriseExample();
    EnterpriseExample.Criteria criteria = enterpriseExample.or();
    // enterpriseName
    if (StringUtils.isNotBlank(enterpriseName)) {
        criteria.andEnterpriseNameLike("%" + enterpriseName + "%");
    }
    // enterpriseSn
    if (StringUtils.isNotBlank(enterpriseSn)) {
        criteria.andEnterpriseSnLike("%" + enterpriseSn + "%");
    }
    // authenticationLevel
    if (null != authenticationLevel && 0 != authenticationLevel) {
        criteria.andAuthenticationLevelEqualTo(authenticationLevel);
    }
    // enterpriseNature
    if (null != enterpriseNature && 0 != enterpriseNature) {
        criteria.andEnterpriseNatureEqualTo(enterpriseNature);
    }
    // orgIndustry
    if (null != orgIndustry && 0 != orgIndustry) {
        criteria.andOrgIndustryEqualTo(orgIndustry);
    }
    // queryDate1
    if (null != queryDate1) {
        criteria.andCreateTimeGreaterThanOrEqualTo(queryDate1);
    }
    if (null != queryDate2) {
        criteria.andCreateTimeLessThanOrEqualTo(queryDate2);
    }
    Integer count = sqlSession.selectOne("com.itrus.portal.db.EnterpriseMapper.countByExample", enterpriseExample);
    if (page > 1 && size * (page - 1) >= count) {
        page = (count + size - 1) / size;
    }
    uiModel.addAttribute("count", count);
    uiModel.addAttribute("pages", (count + size - 1) / size);
    uiModel.addAttribute("page", page);
    uiModel.addAttribute("size", size);
    Integer offset = size * (page - 1);
    enterpriseExample.setOffset(offset);
    enterpriseExample.setLimit(size);
    enterpriseExample.setOrderByClause("create_time desc");
    List<Enterprise> enterPriseList = sqlSession.selectList("com.itrus.portal.db.EnterpriseMapper.selectByExample", enterpriseExample);
    uiModel.addAttribute("enterPriseList", enterPriseList);
    uiModel.addAttribute("itemcount", enterPriseList.size());
    return "enterprise/list";
}
Also used : EnterpriseExample(com.itrus.portal.db.EnterpriseExample) Calendar(java.util.Calendar) Enterprise(com.itrus.portal.db.Enterprise) Certification(com.itrus.portal.db.Certification) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

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