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";
}
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;
}
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;
}
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;
}
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);
}
}
}
Aggregations