@ -10,6 +10,7 @@ import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode ;
import com.epmet.commons.tools.exception.EpmetException ;
import com.epmet.commons.tools.page.PageData ;
import com.epmet.commons.tools.security.dto.TokenDto ;
import com.epmet.commons.tools.security.user.LoginUserUtil ;
import com.epmet.commons.tools.utils.ConvertUtils ;
import com.epmet.plugin.power.dto.axis.PowerAxisTagDTO ;
@ -41,12 +42,16 @@ public class PowerAxisTagServiceImpl extends BaseServiceImpl<PowerAxisTagDao, Po
@Override
public PageData < PowerAxisTagDTO > page ( Map < String , Object > params ) {
IPage < PowerAxisTagEntity > page = baseDao . selectPage (
getPage ( params , FieldConstant . CREATED_TIME , true ) ,
getWrapper ( params )
) ;
return getPageData ( page , PowerAxisTagDTO . class ) ;
public PageData < PowerAxisTagDTO > page ( TokenDto tokenDto , Map < String , Object > params ) {
// IPage<PowerAxisTagEntity> page = baseDao.selectPage(
// getPage(params, FieldConstant.CREATED_TIME, true),
// getWrapper(params)
// );
// return getPageData(page, PowerAxisTagDTO.class);
params . put ( "customerId" , tokenDto . getCustomerId ( ) ) ;
IPage < PowerAxisTagDTO > page = getPage ( params ) ;
List < PowerAxisTagDTO > list = baseDao . getPageList ( params ) ;
return new PageData < > ( list , page . getTotal ( ) ) ;
}
@Override
@ -102,18 +107,22 @@ public class PowerAxisTagServiceImpl extends BaseServiceImpl<PowerAxisTagDao, Po
throw new EpmetException ( EpmetErrorCode . EPMET_COMMON_OPERATION_FAIL . getCode ( ) , "缺少参数" ) ;
}
QueryWrapper < PowerAxisTagEntity > wrapper = new QueryWrapper < > ( ) ;
wrapper . eq ( "TAG_CATEGORY" , tagCategory )
. eq ( "FORBIDDEN_FLAG" , EpmetDelFlagEnum . NORMAL . value ( ) )
. eq ( FieldConstant . CUSTOMER_ID , customerId )
. orderByAsc ( "STRUCT_LEVEL" , FieldConstant . CREATED_TIME ) ;
List < PowerAxisTagCategoryResultDTO > res = baseDao . selectByTagCategory ( tagCategory , customerId ) ;
return res ;
return ConvertUtils . sourceToTarget ( baseDao . selectList ( wrapper ) , PowerAxisTagCategoryResultDTO . class ) ;
// QueryWrapper<PowerAxisTagEntity> wrapper = new QueryWrapper<>();
// wrapper.eq("TAG_CATEGORY", tagCategory)
// .eq("FORBIDDEN_FLAG", EpmetDelFlagEnum.NORMAL.value())
// .eq(FieldConstant.CUSTOMER_ID, customerId)
// .orderByAsc("STRUCT_LEVEL", FieldConstant.CREATED_TIME);
//
// return ConvertUtils.sourceToTarget(baseDao.selectList(wrapper), PowerAxisTagCategoryResultDTO.class);
}
@Override
public List < PowerAxisAllTagCategoryResultDTO > listSimpleAll ( ) {
return baseDao . listSimpleAll ( ) ;
public List < PowerAxisAllTagCategoryResultDTO > listSimpleAll ( TokenDto tokenDto ) {
return baseDao . listSimpleAll ( tokenDto . getCustomerId ( ) ) ;
}
@Override
@ -135,4 +144,4 @@ public class PowerAxisTagServiceImpl extends BaseServiceImpl<PowerAxisTagDao, Po
public Integer selectStructLevelById ( String customerId , String tagCategory , String axisStructId ) {
return baseDao . selectStructLevelById ( customerId , tagCategory , axisStructId ) ;
}
}
}