Search in sources :

Example 16 with ExtraProductSpec

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

the class ExtraProductController method updateMorePage.

// 返回修改产品对应的服务信息页面:服务办理接口信息,服务应用方式,服务配置
@RequestMapping(value = "/updateMore/{id}", produces = "text/html")
public String updateMorePage(@PathVariable("id") Long id, Model uiModel) throws Exception {
    ExtraProduct extraProduct = extraProductService.selectByPrimaryKey(id);
    uiModel.addAttribute("extraProduct", extraProduct);
    List<ExtraProductSpec> extraProductSpecs = extraProductSpecService.getSpecByProductId(id);
    uiModel.addAttribute("extraProductSpecs", extraProductSpecs);
    // 服务提供商组成的map
    Map<Long, ServiceProvider> serviceProviderMap = serviceProviderService.selectMapByExample(null);
    uiModel.addAttribute("serviceProviderMap", serviceProviderMap);
    // 在线支付的map:微信和支付宝
    List<OnlinePay> onlinepays = sqlSession.selectList("com.itrus.portal.db.OnlinePayMapper.selectByExample", null);
    uiModel.addAttribute("onlinepays", onlinepays);
    // 银行付款的List
    List<Transfer> bankPays = sqlSession.selectList("com.itrus.portal.db.TransferMapper.selectByExample", null);
    uiModel.addAttribute("bankPays", bankPays);
    // 电子发票的list
    List<Ereceipt> einvoices = sqlSession.selectList("com.itrus.portal.db.EreceiptMapper.selectByExample", null);
    uiModel.addAttribute("einvoices", einvoices);
    // 附加项的list
    List<ExtraMessage> extraMessages = extraMessageService.selectByExample(null);
    uiModel.addAttribute("extraMessages", extraMessages);
    return "extraproduct/update2";
}
Also used : Ereceipt(com.itrus.portal.db.Ereceipt) ExtraProductSpec(com.itrus.portal.db.ExtraProductSpec) ExtraProduct(com.itrus.portal.db.ExtraProduct) ServiceProvider(com.itrus.portal.db.ServiceProvider) Transfer(com.itrus.portal.db.Transfer) ExtraMessage(com.itrus.portal.db.ExtraMessage) OnlinePay(com.itrus.portal.db.OnlinePay) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 17 with ExtraProductSpec

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

the class ExtraProductSpecServiceImpl method selectByPrimaryKey.

public ExtraProductSpec selectByPrimaryKey(Long id) {
    ExtraProductSpecMapper mapper = sqlSession.getMapper(ExtraProductSpecMapper.class);
    ExtraProductSpec extraProductSpec = mapper.selectByPrimaryKey(id);
    return extraProductSpec;
}
Also used : ExtraProductSpec(com.itrus.portal.db.ExtraProductSpec) ExtraProductSpecMapper(com.itrus.portal.db.ExtraProductSpecMapper)

Example 18 with ExtraProductSpec

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

the class ExtraProductSpecServiceImpl method getProductSpec.

/**
 * 获取订单list对应的规格Map
 *
 * @param billList
 * @return
 */
public Map<Long, ExtraProductSpec> getProductSpec(List<ExtraBill> billList) {
    Map<Long, ExtraProductSpec> productSpecMap = new HashMap<Long, ExtraProductSpec>();
    List<Long> productSpecIds = new ArrayList<Long>();
    for (ExtraBill bill : billList) {
        if (null != bill.getExtraProductSpec() && 0 != bill.getExtraProductSpec()) {
            productSpecIds.add(bill.getExtraProductSpec());
        }
    }
    if (productSpecIds.isEmpty())
        return productSpecMap;
    ExtraProductSpecExample example = new ExtraProductSpecExample();
    ExtraProductSpecExample.Criteria criteria = example.or();
    criteria.andIdIn(productSpecIds);
    productSpecMap = sqlSession.selectMap("com.itrus.portal.db.ExtraProductSpecMapper.selectByExample", example, "id");
    return productSpecMap;
}
Also used : HashMap(java.util.HashMap) ExtraBill(com.itrus.portal.db.ExtraBill) ArrayList(java.util.ArrayList) ExtraProductSpec(com.itrus.portal.db.ExtraProductSpec) ExtraProductSpecExample(com.itrus.portal.db.ExtraProductSpecExample)

Example 19 with ExtraProductSpec

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

the class ExtraProductSpecServiceImpl method getSpecByProductId.

/**
 * 根据增值产品,获取增值产品对应的规格
 *
 * @throws Exception
 */
public List<ExtraProductSpec> getSpecByProductId(Long id) throws Exception {
    List<ExtraProductSpec> extraProductSpecs = new ArrayList<>();
    ExtraProductSpecExample example = new ExtraProductSpecExample();
    ExtraProductSpecExample.Criteria criteria = example.or();
    criteria.andExtraProductEqualTo(id);
    example.setOrderByClause("priority ASC");
    extraProductSpecs = selectByExample(example);
    return extraProductSpecs;
}
Also used : ArrayList(java.util.ArrayList) ExtraProductSpec(com.itrus.portal.db.ExtraProductSpec) ExtraProductSpecExample(com.itrus.portal.db.ExtraProductSpecExample)

Example 20 with ExtraProductSpec

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

the class ExtraProductSpecServiceImpl method saveByJsons.

/**
 * 新增或者保存增值产品规格
 *
 * @param extraProductSpecs
 * @param id
 * @throws Exception
 */
public void saveByJsons(String extraProductSpecs, Long id) throws Exception {
    JsonNode jsonNodes = jsonTool.readTree(extraProductSpecs);
    for (JsonNode jsonNode : jsonNodes) {
        ExtraProductSpec extraProductSpec = new ExtraProductSpec();
        extraProductSpec = jsonTool.readValue(jsonNode, ExtraProductSpec.class);
        extraProductSpec.setExtraProduct(id);
        if (null == extraProductSpec.getId()) {
            extraProductSpec.setCreateTime(new Date());
            insert(extraProductSpec);
        } else {
            extraProductSpec.setModifyTime(new Date());
            updateByPrimaryKeySelective(extraProductSpec);
        }
    }
}
Also used : ExtraProductSpec(com.itrus.portal.db.ExtraProductSpec) JsonNode(org.codehaus.jackson.JsonNode) Date(java.util.Date)

Aggregations

ExtraProductSpec (com.itrus.portal.db.ExtraProductSpec)21 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)15 ExtraProduct (com.itrus.portal.db.ExtraProduct)14 Enterprise (com.itrus.portal.db.Enterprise)11 ExtraBill (com.itrus.portal.db.ExtraBill)11 UserInfo (com.itrus.portal.db.UserInfo)11 ServiceProvider (com.itrus.portal.db.ServiceProvider)9 Ereceipt (com.itrus.portal.db.Ereceipt)8 OpenBankInfo (com.itrus.portal.db.OpenBankInfo)8 Agent (com.itrus.portal.db.Agent)7 BusinessLicense (com.itrus.portal.db.BusinessLicense)7 IdentityCard (com.itrus.portal.db.IdentityCard)7 OnlinePay (com.itrus.portal.db.OnlinePay)7 OrgCode (com.itrus.portal.db.OrgCode)7 TaxRegisterCert (com.itrus.portal.db.TaxRegisterCert)7 HttpSession (javax.servlet.http.HttpSession)7 Einvoice (com.itrus.portal.db.Einvoice)6 OnPayInfo (com.itrus.portal.db.OnPayInfo)6 ExtraBillExample (com.itrus.portal.db.ExtraBillExample)5 ExtraMessage (com.itrus.portal.db.ExtraMessage)5