use of com.itrus.portal.db.ServiceHall in project portal by ixinportal.
the class ServiceHallServiceImpl method getServiceHalls.
/**
* 根据服务商ID,获取服务商的网点信息,根据优先级排序
* @param id
* @return
* @throws Exception
*/
public List<ServiceHall> getServiceHalls(Long id) throws Exception {
List<ServiceHall> serviceHalls = new ArrayList<>();
ServiceHallExample example = new ServiceHallExample();
ServiceHallExample.Criteria criteria = example.or();
criteria.andServiceProviderEqualTo(id);
example.setOrderByClause("priority ASC");
serviceHalls = selectByExample(example);
return serviceHalls;
}
use of com.itrus.portal.db.ServiceHall in project portal by ixinportal.
the class ServiceHallServiceImpl method selectByPrimaryKey.
public ServiceHall selectByPrimaryKey(Long id) {
ServiceHallMapper mapper = sqlSession.getMapper(ServiceHallMapper.class);
ServiceHall serviceHall = mapper.selectByPrimaryKey(id);
return serviceHall;
}
use of com.itrus.portal.db.ServiceHall in project portal by ixinportal.
the class ServiceHallServiceImpl method saveByJsons.
public void saveByJsons(String serviceHalls, Long id) throws Exception {
JsonNode jsonNodes = jsonTool.readTree(serviceHalls);
for (JsonNode jsonNode : jsonNodes) {
ServiceHall serviceHall = new ServiceHall();
serviceHall = jsonTool.readValue(jsonNode, ServiceHall.class);
// 当缺少必要参数的时候,跳过这个
if (StringUtils.isBlank(serviceHall.getAddress()) || null == serviceHall.getPriority() || StringUtils.isBlank(serviceHall.getServiceHotLine()) || StringUtils.isBlank(serviceHall.getServiceTime())) {
continue;
}
serviceHall.setServiceProvider(id);
serviceHall.setModifyTime(new Date());
if (null == serviceHall.getId()) {
serviceHall.setCreateTime(new Date());
insert(serviceHall);
} else {
updateByPrimaryKeySelective(serviceHall);
}
}
}
Aggregations