Exemplo n.º 1
0
 @Override
 public void update(SysParamItem sysParamItem) {
   dao.update(sysParamItem);
   // 更新缓存
   //        noticeBroker(sysParamItem.getType());
   ParameterContainer.getInstance().reloadSystem(sysParamItem.getType());
 }
Exemplo n.º 2
0
 @Override
 public String save(SysParamItem sysParamItem) {
   String id = dao.save(sysParamItem);
   // 更新缓存
   //        noticeBroker(sysParamItem.getType());
   ParameterContainer.getInstance().reloadSystem(sysParamItem.getType());
   return id;
 }
Exemplo n.º 3
0
 public SysParamItemVo wrap(SysParamItem sysParamItem) {
   if (sysParamItem == null) return null;
   SysParamItemVo vo = new SysParamItemVo();
   BeanUtils.copyProperties(sysParamItem, vo);
   ParameterContainer container = ParameterContainer.getInstance();
   vo.setTypeName(container.getSystemTypeName(vo.getType()));
   vo.setStatusName(container.getSystemName(ParameterConstant.COMMON_STATE, vo.getStatus()));
   String cascadeType = sysParamItem.getCascadeTypeCode();
   if (org.apache.commons.lang3.StringUtils.isNotEmpty(cascadeType)) {
     vo.setCascadeTypeName(container.getSystemTypeName(cascadeType));
     String cascadeValue = sysParamItem.getCascadeItemValue();
     if (org.apache.commons.lang3.StringUtils.isNotEmpty(cascadeValue)) {
       String name = container.getSystemNameWithNoQuery(cascadeType, cascadeValue);
       if (name == null) {
         name = dao.queryName(cascadeType, cascadeValue);
       }
       vo.setCascadeItemName(name);
     }
   }
   return vo;
 }
Exemplo n.º 4
0
  @Override
  public void deleteByIds(String... ids) {
    if (ids == null || ids.length == 0) return;
    for (String id : ids) {
      SysParamItem item = dao.findById(id);
      if (item == null) {
        throw new EntityNotFoundException(id);
      }

      // 删除或更改状态
      String status = item.getStatus();
      if (CommonStatus.ACTIVE.getValue().equals(status)) {
        item.setStatus(CommonStatus.CANCELED.getValue());
      } else if (CommonStatus.INACTIVE.getValue().equals(status)) {
        dao.delete(item);
      }

      // 更新缓存
      //            noticeBroker(item.getType());
      ParameterContainer.getInstance().reloadSystem(item.getType());
    }
  }