|
@@ -3,6 +3,8 @@ package com.dragon.tj.portal.service.impl;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
+import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.dragon.tj.portal.auth.model.LoginUser;
|
|
import com.dragon.tj.portal.auth.model.LoginUser;
|
|
import com.dragon.tj.portal.common.base.R;
|
|
import com.dragon.tj.portal.common.base.R;
|
|
@@ -11,7 +13,6 @@ import com.dragon.tj.portal.mapper.app.AppInfoMapper;
|
|
import com.dragon.tj.portal.mapper.app.InstallInfoMapper;
|
|
import com.dragon.tj.portal.mapper.app.InstallInfoMapper;
|
|
import com.dragon.tj.portal.service.AppService;
|
|
import com.dragon.tj.portal.service.AppService;
|
|
import com.dragon.tj.portal.service.SysDictItemService;
|
|
import com.dragon.tj.portal.service.SysDictItemService;
|
|
-import com.dragon.tj.portal.service.SysDictService;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -32,14 +33,14 @@ public class AppServiceImpl implements AppService {
|
|
private InstallInfoMapper installInfoMapper;
|
|
private InstallInfoMapper installInfoMapper;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
- private SysDictService sysDictService;
|
|
|
|
|
|
+ private SysDictItemService sysDictItemService;
|
|
|
|
|
|
|
|
|
|
- private static List<SysDict> appTypeDict;
|
|
|
|
|
|
+ private static List<SysDictItem> appTypeDict;
|
|
|
|
|
|
- public List<SysDict> getAppTypeDict(){
|
|
|
|
|
|
+ public List<SysDictItem> getAppTypeDict(){
|
|
if (appTypeDict == null || appTypeDict.size() == 0) {
|
|
if (appTypeDict == null || appTypeDict.size() == 0) {
|
|
- appTypeDict = sysDictService.getDict("app_type");
|
|
|
|
|
|
+ appTypeDict = sysDictItemService.list(Wrappers.<SysDictItem>query().lambda().eq(SysDictItem::getType, "app_type").orderByAsc(SysDictItem::getSort));
|
|
}
|
|
}
|
|
|
|
|
|
return appTypeDict;
|
|
return appTypeDict;
|
|
@@ -79,7 +80,7 @@ public class AppServiceImpl implements AppService {
|
|
* */
|
|
* */
|
|
@Override
|
|
@Override
|
|
public R getType() {
|
|
public R getType() {
|
|
- return R.ok(sysDictService.getDict("app_type"));
|
|
|
|
|
|
+ return R.ok(getAppTypeDict());
|
|
}
|
|
}
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -101,7 +102,7 @@ public class AppServiceImpl implements AppService {
|
|
queryWrapper.eq(appInfo.getAppType() != null,AppInfo::getAppType, appInfo.getAppType());
|
|
queryWrapper.eq(appInfo.getAppType() != null,AppInfo::getAppType, appInfo.getAppType());
|
|
queryWrapper.eq(appInfo.getDelFlag() != null,AppInfo::getDelFlag, appInfo.getDelFlag());
|
|
queryWrapper.eq(appInfo.getDelFlag() != null,AppInfo::getDelFlag, appInfo.getDelFlag());
|
|
|
|
|
|
- queryWrapper.orderByDesc(AppInfo::getStar);
|
|
|
|
|
|
+ rowPage.addOrder(OrderItem.desc(appInfoPage.getOrder()));
|
|
|
|
|
|
return appInfoMapper.selectPage(rowPage, queryWrapper);
|
|
return appInfoMapper.selectPage(rowPage, queryWrapper);
|
|
}
|
|
}
|
|
@@ -161,8 +162,8 @@ public class AppServiceImpl implements AppService {
|
|
map.put("delFlag", params.getDelFlag());
|
|
map.put("delFlag", params.getDelFlag());
|
|
Integer appType = params.getAppType();
|
|
Integer appType = params.getAppType();
|
|
if (appType != null){
|
|
if (appType != null){
|
|
- List<SysDict> appTypeList = getAppTypeDict();
|
|
|
|
- SysDict specialToolDict = appTypeList.stream().filter(item -> "专项工具".equals(item.getDescription())).findFirst().get();
|
|
|
|
|
|
+ List<SysDictItem> appTypeList = getAppTypeDict();
|
|
|
|
+ SysDictItem specialToolDict = appTypeList.stream().filter(item -> "专项工具".equals(item.getLabel())).findFirst().get();
|
|
map.put("std", specialToolDict.getId());//专项工具
|
|
map.put("std", specialToolDict.getId());//专项工具
|
|
|
|
|
|
if (appType == specialToolDict.getId()){
|
|
if (appType == specialToolDict.getId()){
|
|
@@ -193,4 +194,15 @@ public class AppServiceImpl implements AppService {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public int clickIncr(Long id) {
|
|
|
|
+ QueryWrapper<AppInfo> wrapper = new QueryWrapper<>();
|
|
|
|
+ wrapper.eq("id",id);
|
|
|
|
+ AppInfo appInfo = appInfoMapper.selectOne(wrapper);
|
|
|
|
+ appInfo.setId(id);
|
|
|
|
+ appInfo.setHits(appInfo.getHits() + 1);
|
|
|
|
+
|
|
|
|
+ return appInfoMapper.updateById(appInfo);
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|