Search in sources :

Example 16 with Project

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

the class ExtraProductReleaseController method updatePage.

// 修改页面
@RequestMapping(value = "/update/{id}", produces = "text/html")
public String updatePage(@PathVariable("id") Long id, Model uiModel) throws Exception {
    Project project = projectService.selectByPrimaryKey(id);
    List<ExtraProductRelease> extraProductReleases = extraProductReleaseService.getByprojectId(id);
    // 所有的增值产品信息,以id为主键.以便页面显示信息
    Map<Long, ExtraProduct> extraProductMap = new HashMap<Long, ExtraProduct>();
    extraProductMap = extraProductService.selectMapByExample(null);
    List<ExtraProduct> allProducts = extraProductService.selectByExample(null);
    // 所有产品list
    uiModel.addAttribute("allProducts", allProducts);
    // 项目信息
    uiModel.addAttribute("project", project);
    // 产品与项目之间的关系
    uiModel.addAttribute("extraProductReleases", extraProductReleases);
    // 所有的产品
    uiModel.addAttribute("extraProductMap", extraProductMap);
    // 显示新建的增值产品,还未与项目产生关联
    ExtraProductExample epe = new ExtraProductExample();
    ExtraProductExample.Criteria epec = epe.createCriteria();
    List<Long> havedProductIds = new ArrayList<>();
    for (ExtraProductRelease epr : extraProductReleases) {
        havedProductIds.add(epr.getExtraProduct());
    }
    if (havedProductIds != null && havedProductIds.size() > 0) {
        epec.andIdNotIn(havedProductIds);
    }
    epe.setOrderByClause("id asc");
    // 没有与该项目产生关联关系的增值产品
    List<ExtraProduct> remainingProducts = extraProductService.selectByExample(epe);
    uiModel.addAttribute("remainingProducts", remainingProducts);
    return "extraproductrelease/update";
}
Also used : Project(com.itrus.portal.db.Project) ExtraProduct(com.itrus.portal.db.ExtraProduct) ExtraProductRelease(com.itrus.portal.db.ExtraProductRelease) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) ExtraProductExample(com.itrus.portal.db.ExtraProductExample) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 17 with Project

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

the class ExtraProductReleaseController method createForm.

// 新增页面
@RequestMapping(params = "form", produces = "text/html")
public String createForm(Model uimModel) throws Exception {
    List<Project> projects = new ArrayList<>();
    projects = projectService.getProjectByExample(null);
    // 移除已经有了关联关系的项目
    Iterator<Project> iterator = projects.iterator();
    while (iterator.hasNext()) {
        Project project = iterator.next();
        List<ExtraProductRelease> extraProductReleases = new ArrayList<>();
        extraProductReleases = extraProductReleaseService.getByprojectId(project.getId());
        if (null != extraProductReleases && !extraProductReleases.isEmpty()) {
            iterator.remove();
        }
    }
    uimModel.addAttribute("projects", projects);
    // 所有的增值产品信息,以id为主键.以便页面显示信息
    Map<Long, ExtraProduct> extraProductMap = new HashMap<Long, ExtraProduct>();
    extraProductMap = extraProductService.selectMapByExample(null);
    // 所有的产品
    uimModel.addAttribute("extraProductMap", extraProductMap);
    return "extraproductrelease/create";
}
Also used : Project(com.itrus.portal.db.Project) ExtraProduct(com.itrus.portal.db.ExtraProduct) ExtraProductRelease(com.itrus.portal.db.ExtraProductRelease) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 18 with Project

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

the class ExtraQueryBillController 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());
    if (StringUtils.isNotBlank(enterprise.getProvince())) {
        String province = sysRegionService.getProvince(enterprise.getProvince());
        enterprise.setProvince(province);
    }
    if (StringUtils.isNotBlank(enterprise.getCity())) {
        String city = sysRegionService.getCity(enterprise.getCity());
        enterprise.setCity(city);
    }
    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);
    if (onPayInfo != null) {
        // 在线支付信息
        OnlinePay onlinePay = sqlSession.selectOne("com.itrus.portal.db.OnlinePayMapper.selectByPrimaryKey", onPayInfo.getOnlinePay());
        uiModel.addAttribute("onlinePay", onlinePay);
    }
    // 电子发票
    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("bl", businessLicense);
    // 税务登记
    TaxRegisterCert taxRegisterCert = taxCertService.getTaxRegisterCertByExtraBillId(id, null);
    uiModel.addAttribute("trc", taxRegisterCert);
    // 组织机构代码
    OrgCode orgCode = orgCodeService.getOrgCodeByExtraBillId(id, null);
    uiModel.addAttribute("oc", orgCode);
    // 代理人
    Agent agent = agentService.getAgentByExtraBillId(id, null);
    uiModel.addAttribute("agent", agent);
    // 开户行信息
    OpenBankInfo openBankInfo = openBankInfoService.getOpenBankInfoByExtraBillId(id, null);
    uiModel.addAttribute("obi", openBankInfo);
    // 法人信息
    IdentityCard identityCard = identityCardService.getIdentityCardByExtraBillId(id, null);
    uiModel.addAttribute("ic", identityCard);
    // TODO 还需要补充订单对应的附加信息和第三方回调信息
    return "extrabill/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) OnlinePay(com.itrus.portal.db.OnlinePay) IdentityCard(com.itrus.portal.db.IdentityCard) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 19 with Project

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

the class CheckInvoiceController method list.

// 进入查询页面
@RequestMapping(produces = "text/html")
public String list(@RequestParam(value = "project", required = false) Long project, @RequestParam(value = "appName", required = false) String appName, @RequestParam(value = "userName", required = false) String userName, @RequestParam(value = "enterpriseName", required = false) String enterpriseName, @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) throws Exception {
    if (queryDate1 == null && queryDate2 == null) {
        Calendar calendar = Calendar.getInstance();
        calendar.add(Calendar.DATE, 1);
        calendar.set(Calendar.HOUR_OF_DAY, 0);
        calendar.set(Calendar.MINUTE, 0);
        calendar.set(Calendar.SECOND, 0);
        calendar.set(Calendar.MILLISECOND, 0);
        calendar.add(Calendar.MILLISECOND, -1);
        queryDate2 = calendar.getTime();
        calendar.add(Calendar.MILLISECOND, 1);
        calendar.add(Calendar.MONTH, -1);
        queryDate1 = calendar.getTime();
    }
    Map<String, Object> param = new HashMap<>();
    // page,size
    if (page == null || page < 1)
        page = 1;
    if (size == null || size < 1)
        size = 10;
    Integer offset = size * (page - 1);
    param.put("offset", offset);
    param.put("limit", size);
    param.put("queryDate1", queryDate1);
    param.put("queryDate2", queryDate2);
    if (project != null && project != 0) {
        param.put("project", project);
    }
    if (StringUtils.isNotEmpty(appName)) {
        param.put("appName", "%" + appName + "%");
    }
    if (StringUtils.isNotEmpty(userName)) {
        param.put("userName", "%" + userName + "%");
    }
    if (StringUtils.isNotEmpty(enterpriseName)) {
        param.put("enterpriseName", "%" + enterpriseName + "%");
    }
    List srexall = sqlSession.selectList("com.itrus.portal.db.CheckInvoiceLogMapper.selectByCondition", param);
    uiModel.addAttribute("list", srexall);
    Integer count = sqlSession.selectOne("com.itrus.portal.db.CheckInvoiceLogMapper.countByConditon", param);
    uiModel.addAttribute("count", count);
    uiModel.addAttribute("pages", (count + size - 1) / size);
    // page, size
    if (page > 1 && size * (page - 1) >= count) {
        page = (count + size - 1) / size;
    }
    uiModel.addAttribute("page", page);
    uiModel.addAttribute("size", size);
    Map<Long, Project> projectMap = sqlSession.selectMap("com.itrus.portal.db.ProjectMapper.selectByExample", "id");
    uiModel.addAttribute("projectMap", projectMap);
    uiModel.addAttribute("queryDate1", queryDate1);
    uiModel.addAttribute("queryDate2", queryDate2);
    uiModel.addAttribute("projects", getProjectMapOfAdmin());
    uiModel.addAttribute("project", project);
    uiModel.addAttribute("appName", appName);
    uiModel.addAttribute("userName", userName);
    uiModel.addAttribute("enterpriseName", enterpriseName);
    return "checkinvoice/list";
}
Also used : Project(com.itrus.portal.db.Project) HashMap(java.util.HashMap) Calendar(java.util.Calendar) List(java.util.List) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 20 with Project

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

the class DownloadConfigController method create.

// 新建处理
@RequestMapping(method = RequestMethod.POST, produces = "text/html")
public String create(@Valid FileConfig fileConfig, @RequestParam(value = "upFile", required = false) MultipartFile upFile, @RequestParam(value = "status", required = false) Integer status, @RequestParam(value = "projectId", required = false) Long projectId, @RequestParam(value = "fileIdArr", required = false) String fileIdArr, BindingResult bindingResult, Model uiModel, HttpServletRequest httpServletRequest) {
    if (bindingResult.hasErrors()) {
        return createForm(status, uiModel);
    }
    if (status == 2) {
        String nameAll = null;
        Long fid = 0L;
        Project project = null;
        String[] arr = fileIdArr.split(",");
        for (String s : arr) {
            FileIssue fileIssue = new FileIssue();
            fileIssue.setId(null);
            fileIssue.setProject(projectId);
            fileIssue.setFileConfig(Long.parseLong(s));
            fileIssue.setCreateTime(new Date());
            fileIssue.setCreator(getAdmin().getId());
            configServiceImpl.insertFileIssue(fileIssue, projectId, null);
            project = projectServiceImpl.selectByPrimaryKey(projectId);
            FileConfig config = configServiceImpl.getFileConfigById(Long.parseLong(s));
            if (nameAll == null) {
                nameAll = config.getName();
            } else {
                nameAll = nameAll + "," + config.getName();
            }
            fid = fileIssue.getId();
        }
        LogUtil.adminlog(sqlSession, "创建文件发布信息", project.getName() + "项目发布文件有:" + nameAll);
        return "redirect:/downloadconfig/" + fid + "/" + status;
    } else {
        Map<String, Object> retMap = null;
        if (upFile != null) {
            // 上传文件
            retMap = saveFile(upFile);
            if (retMap == null || (int) retMap.get("retCode") != 1) {
                return "redirect:/downloadconfig?form&status=3";
            }
            fileConfig.setFileSize(retMap.get("fileSize").toString());
            fileConfig.setFile(retMap.get("name").toString());
            fileConfig.setHash(retMap.get("hash").toString());
        }
        fileConfig.setId(null);
        fileConfig.setCreateTime(new Date());
        fileConfig.setCreator(getAdmin().getId());
        configServiceImpl.insertFileConfig(fileConfig);
        LogUtil.adminlog(sqlSession, "创建文件管理信息", "文件名称:" + fileConfig.getName());
        return "redirect:/downloadconfig/" + fileConfig.getId() + "/" + status;
    }
}
Also used : Project(com.itrus.portal.db.Project) FileConfig(com.itrus.portal.db.FileConfig) FileIssue(com.itrus.portal.db.FileIssue) Date(java.util.Date) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

Project (com.itrus.portal.db.Project)77 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)59 HashMap (java.util.HashMap)32 UserInfo (com.itrus.portal.db.UserInfo)24 Enterprise (com.itrus.portal.db.Enterprise)20 ExtraProduct (com.itrus.portal.db.ExtraProduct)17 ProjectExample (com.itrus.portal.db.ProjectExample)16 ArrayList (java.util.ArrayList)15 ProjectKeyInfo (com.itrus.portal.db.ProjectKeyInfo)12 UserInfoServiceException (com.itrus.portal.exception.UserInfoServiceException)12 Product (com.itrus.portal.db.Product)10 Date (java.util.Date)10 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)9 BusinessLicense (com.itrus.portal.db.BusinessLicense)8 IdentityCard (com.itrus.portal.db.IdentityCard)8 OrgCode (com.itrus.portal.db.OrgCode)8 TaxRegisterCert (com.itrus.portal.db.TaxRegisterCert)8 UserinfoEnterprise (com.itrus.portal.db.UserinfoEnterprise)8 List (java.util.List)8 Map (java.util.Map)8