123
This commit is contained in:
1 parent
5a341e6bb1
commit
a14741aec7
22 files changed
+2462
-1
No files matched your search
@@ -0,0 +1,89 @@
|
||||
package com.ruoyi.system.service;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.DmGroupTaskRelation;
|
||||
import com.ruoyi.system.domain.DmGroupTaskRelationPlus;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
/**
|
||||
* 组任务关联Service接口
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-05-14
|
||||
*/
|
||||
public interface IDmGroupTaskRelationService extends IService<DmGroupTaskRelationPlus>
|
||||
{
|
||||
|
||||
List<SelectItem> select(String keyword);
|
||||
/**
|
||||
* 查询组任务关联
|
||||
*
|
||||
* @param id 组任务关联ID
|
||||
* @return 组任务关联
|
||||
*/
|
||||
public DmGroupTaskRelation selectDmGroupTaskRelationById(Long id);
|
||||
|
||||
/**
|
||||
* 查询组任务关联列表
|
||||
*
|
||||
* @param dmGroupTaskRelation 组任务关联
|
||||
* @return 组任务关联集合
|
||||
*/
|
||||
public List<DmGroupTaskRelation> selectDmGroupTaskRelationList(DmGroupTaskRelation dmGroupTaskRelation);
|
||||
|
||||
/**
|
||||
* 新增组任务关联
|
||||
*
|
||||
* @param dmGroupTaskRelation 组任务关联
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDmGroupTaskRelation(DmGroupTaskRelation dmGroupTaskRelation);
|
||||
|
||||
/**
|
||||
* 修改组任务关联
|
||||
*
|
||||
* @param dmGroupTaskRelation 组任务关联
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDmGroupTaskRelation(DmGroupTaskRelation dmGroupTaskRelation);
|
||||
|
||||
/**
|
||||
* 批量删除组任务关联
|
||||
*
|
||||
* @param ids 需要删除的组任务关联ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDmGroupTaskRelationByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除组任务关联信息
|
||||
*
|
||||
* @param id 组任务关联ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDmGroupTaskRelationById(Long id);
|
||||
|
||||
List<DmGroupTaskRelationPlus> getByIds(List<Long> ids, SFunction<DmGroupTaskRelationPlus, ?>... columns);
|
||||
|
||||
DmGroupTaskRelationPlus getById(Long id, SFunction<DmGroupTaskRelationPlus, ?>... columns);
|
||||
|
||||
Map<Long, DmGroupTaskRelationPlus> getMapByIds(List<Long> ids, SFunction<DmGroupTaskRelationPlus, ?>... columns);
|
||||
|
||||
List<DmGroupTaskRelationPlus> getByIds(List<Long> ids);
|
||||
|
||||
Map<Long, DmGroupTaskRelationPlus> getMapByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* @param field sum 字段
|
||||
* @param where 条件
|
||||
* @param tClass 返回类型
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
<T> T sum(String field, String where, Class<T> tClass);
|
||||
|
||||
Long count(String where);
|
||||
|
||||
<T> List<T> countByGroupBy(String select, String where, String groupby, Class<T> tClass);
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
package com.ruoyi.system.service;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.DmPlayerTaskGroup;
|
||||
import com.ruoyi.system.domain.DmPlayerTaskGroupPlus;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
/**
|
||||
* 大漠任务组Service接口
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-05-14
|
||||
*/
|
||||
public interface IDmPlayerTaskGroupService extends IService<DmPlayerTaskGroupPlus>
|
||||
{
|
||||
|
||||
List<SelectItem> select(String keyword);
|
||||
/**
|
||||
* 查询大漠任务组
|
||||
*
|
||||
* @param id 大漠任务组ID
|
||||
* @return 大漠任务组
|
||||
*/
|
||||
public DmPlayerTaskGroup selectDmPlayerTaskGroupById(Long id);
|
||||
|
||||
/**
|
||||
* 查询大漠任务组列表
|
||||
*
|
||||
* @param dmPlayerTaskGroup 大漠任务组
|
||||
* @return 大漠任务组集合
|
||||
*/
|
||||
public List<DmPlayerTaskGroup> selectDmPlayerTaskGroupList(DmPlayerTaskGroup dmPlayerTaskGroup);
|
||||
|
||||
/**
|
||||
* 新增大漠任务组
|
||||
*
|
||||
* @param dmPlayerTaskGroup 大漠任务组
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDmPlayerTaskGroup(DmPlayerTaskGroup dmPlayerTaskGroup);
|
||||
|
||||
/**
|
||||
* 修改大漠任务组
|
||||
*
|
||||
* @param dmPlayerTaskGroup 大漠任务组
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDmPlayerTaskGroup(DmPlayerTaskGroup dmPlayerTaskGroup);
|
||||
|
||||
/**
|
||||
* 批量删除大漠任务组
|
||||
*
|
||||
* @param ids 需要删除的大漠任务组ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDmPlayerTaskGroupByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除大漠任务组信息
|
||||
*
|
||||
* @param id 大漠任务组ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDmPlayerTaskGroupById(Long id);
|
||||
|
||||
List<DmPlayerTaskGroupPlus> getByIds(List<Long> ids, SFunction<DmPlayerTaskGroupPlus, ?>... columns);
|
||||
|
||||
DmPlayerTaskGroupPlus getById(Long id, SFunction<DmPlayerTaskGroupPlus, ?>... columns);
|
||||
|
||||
Map<Long, DmPlayerTaskGroupPlus> getMapByIds(List<Long> ids, SFunction<DmPlayerTaskGroupPlus, ?>... columns);
|
||||
|
||||
List<DmPlayerTaskGroupPlus> getByIds(List<Long> ids);
|
||||
|
||||
Map<Long, DmPlayerTaskGroupPlus> getMapByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* @param field sum 字段
|
||||
* @param where 条件
|
||||
* @param tClass 返回类型
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
<T> T sum(String field, String where, Class<T> tClass);
|
||||
|
||||
Long count(String where);
|
||||
|
||||
<T> List<T> countByGroupBy(String select, String where, String groupby, Class<T> tClass);
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
package com.ruoyi.system.service;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.DmPlayerVersion;
|
||||
import com.ruoyi.system.domain.DmPlayerVersionPlus;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
/**
|
||||
* 版本信息Service接口
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-05-14
|
||||
*/
|
||||
public interface IDmPlayerVersionService extends IService<DmPlayerVersionPlus>
|
||||
{
|
||||
|
||||
List<SelectItem> select(String keyword);
|
||||
/**
|
||||
* 查询版本信息
|
||||
*
|
||||
* @param id 版本信息ID
|
||||
* @return 版本信息
|
||||
*/
|
||||
public DmPlayerVersion selectDmPlayerVersionById(Long id);
|
||||
|
||||
/**
|
||||
* 查询版本信息列表
|
||||
*
|
||||
* @param dmPlayerVersion 版本信息
|
||||
* @return 版本信息集合
|
||||
*/
|
||||
public List<DmPlayerVersion> selectDmPlayerVersionList(DmPlayerVersion dmPlayerVersion);
|
||||
|
||||
/**
|
||||
* 新增版本信息
|
||||
*
|
||||
* @param dmPlayerVersion 版本信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDmPlayerVersion(DmPlayerVersion dmPlayerVersion);
|
||||
|
||||
/**
|
||||
* 修改版本信息
|
||||
*
|
||||
* @param dmPlayerVersion 版本信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDmPlayerVersion(DmPlayerVersion dmPlayerVersion);
|
||||
|
||||
/**
|
||||
* 批量删除版本信息
|
||||
*
|
||||
* @param ids 需要删除的版本信息ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDmPlayerVersionByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除版本信息信息
|
||||
*
|
||||
* @param id 版本信息ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDmPlayerVersionById(Long id);
|
||||
|
||||
List<DmPlayerVersionPlus> getByIds(List<Long> ids, SFunction<DmPlayerVersionPlus, ?>... columns);
|
||||
|
||||
DmPlayerVersionPlus getById(Long id, SFunction<DmPlayerVersionPlus, ?>... columns);
|
||||
|
||||
Map<Long, DmPlayerVersionPlus> getMapByIds(List<Long> ids, SFunction<DmPlayerVersionPlus, ?>... columns);
|
||||
|
||||
List<DmPlayerVersionPlus> getByIds(List<Long> ids);
|
||||
|
||||
Map<Long, DmPlayerVersionPlus> getMapByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* @param field sum 字段
|
||||
* @param where 条件
|
||||
* @param tClass 返回类型
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
<T> T sum(String field, String where, Class<T> tClass);
|
||||
|
||||
Long count(String where);
|
||||
|
||||
<T> List<T> countByGroupBy(String select, String where, String groupby, Class<T> tClass);
|
||||
}
|
||||
+208
@@ -0,0 +1,208 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.system.mapper.DmGroupTaskRelationMapper;
|
||||
import com.ruoyi.system.domain.DmGroupTaskRelation;
|
||||
import com.ruoyi.system.domain.DmGroupTaskRelationPlus;
|
||||
import com.ruoyi.system.service.IDmGroupTaskRelationService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
/**
|
||||
* 组任务关联Service业务层处理
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-05-14
|
||||
*/
|
||||
@Service
|
||||
public class DmGroupTaskRelationServiceImpl extends ServiceImpl<DmGroupTaskRelationMapper, DmGroupTaskRelationPlus> implements IDmGroupTaskRelationService
|
||||
{
|
||||
@Autowired
|
||||
private DmGroupTaskRelationMapper dmGroupTaskRelationMapper;
|
||||
@Autowired
|
||||
private JdbcTemplate jdbcTemplate;
|
||||
|
||||
@Override
|
||||
public List<DmGroupTaskRelationPlus> getByIds(List<Long> ids, SFunction<DmGroupTaskRelationPlus, ?>... columns) {
|
||||
LambdaQueryWrapper<DmGroupTaskRelationPlus> lambdaQueryWrapper = new LambdaQueryWrapper<DmGroupTaskRelationPlus>()
|
||||
.select(columns).in(DmGroupTaskRelationPlus::getId, ids);
|
||||
return this.list(lambdaQueryWrapper);
|
||||
}
|
||||
@Override
|
||||
public List<SelectItem> select(String keyword) {
|
||||
LambdaQueryWrapper<DmGroupTaskRelationPlus> lambdaQueryWrapper = new LambdaQueryWrapper<DmGroupTaskRelationPlus>()
|
||||
.select(DmGroupTaskRelationPlus::getId, DmGroupTaskRelationPlus::getPlayerName)
|
||||
.like(DmGroupTaskRelationPlus::getPlayerName, keyword);
|
||||
List<DmGroupTaskRelationPlus> list = this.list(lambdaQueryWrapper);
|
||||
List<SelectItem> result =new ArrayList<>();
|
||||
for (DmGroupTaskRelationPlus item : list){
|
||||
SelectItem selectItem = new SelectItem();
|
||||
selectItem.setName(item.getPlayerName());
|
||||
selectItem.setId(item.getId());
|
||||
result.add(selectItem);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@Override
|
||||
public DmGroupTaskRelationPlus getById(Long id, SFunction<DmGroupTaskRelationPlus, ?>... columns) {
|
||||
LambdaQueryWrapper<DmGroupTaskRelationPlus> lambdaQueryWrapper = new LambdaQueryWrapper<DmGroupTaskRelationPlus>()
|
||||
.select(columns).eq(DmGroupTaskRelationPlus::getId, id);
|
||||
return baseMapper.selectOne(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, DmGroupTaskRelationPlus> getMapByIds(List<Long> ids, SFunction<DmGroupTaskRelationPlus, ?>... columns) {
|
||||
List<DmGroupTaskRelationPlus> list = this.getByIds(ids, columns);
|
||||
Map<Long, DmGroupTaskRelationPlus> map = new HashMap<>();
|
||||
for (DmGroupTaskRelationPlus item : list) {
|
||||
map.put(item.getId(), item);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, DmGroupTaskRelationPlus> getMapByIds(List<Long> ids) {
|
||||
List<DmGroupTaskRelationPlus> list = this.getByIds(ids);
|
||||
Map<Long, DmGroupTaskRelationPlus> map = new HashMap<>();
|
||||
for (DmGroupTaskRelationPlus item : list) {
|
||||
map.put(item.getId(), item);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DmGroupTaskRelationPlus> getByIds(List<Long> ids) {
|
||||
LambdaQueryWrapper<DmGroupTaskRelationPlus> lambdaQueryWrapper = new LambdaQueryWrapper<DmGroupTaskRelationPlus>().in(DmGroupTaskRelationPlus::getId, ids);
|
||||
return this.list(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
public <T> T sum(String field, String where, Class<T> tClass) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select ");
|
||||
stringBuffer.append(" sum(" + field + ") as total ");
|
||||
stringBuffer.append(" from dm_group_task_relation ");
|
||||
if (StringUtils.isNotBlank(where)) {
|
||||
stringBuffer.append(" where ");
|
||||
stringBuffer.append(where);
|
||||
}
|
||||
T result = jdbcTemplate.queryForObject(stringBuffer.toString(), tClass);
|
||||
return result;
|
||||
}
|
||||
|
||||
public Long count(String where) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select ");
|
||||
stringBuffer.append(" count(1)");
|
||||
stringBuffer.append(" from ");
|
||||
stringBuffer.append(" dm_group_task_relation ");
|
||||
if (StringUtils.isNotBlank(where)) {
|
||||
stringBuffer.append(" where ");
|
||||
stringBuffer.append(where);
|
||||
}
|
||||
Long result = jdbcTemplate.queryForObject(stringBuffer.toString(), Long.class);
|
||||
return result;
|
||||
}
|
||||
|
||||
public <T> List<T> countByGroupBy(String select, String where, String groupby, Class<T> tClass) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select ");
|
||||
stringBuffer.append(select);
|
||||
stringBuffer.append(" from ");
|
||||
stringBuffer.append(" dm_group_task_relation ");
|
||||
if (StringUtils.isNotBlank(where)) {
|
||||
stringBuffer.append(" where ");
|
||||
stringBuffer.append(where);
|
||||
}
|
||||
stringBuffer.append(" group by ");
|
||||
stringBuffer.append(groupby);
|
||||
List result = jdbcTemplate.queryForList(stringBuffer.toString());
|
||||
List<T> tList = JSONArray.parseArray(JSONArray.toJSONString(result), tClass);
|
||||
return tList;
|
||||
}
|
||||
/**
|
||||
* 查询组任务关联
|
||||
*
|
||||
* @param id 组任务关联ID
|
||||
* @return 组任务关联
|
||||
*/
|
||||
@Override
|
||||
public DmGroupTaskRelation selectDmGroupTaskRelationById(Long id)
|
||||
{
|
||||
return dmGroupTaskRelationMapper.selectDmGroupTaskRelationById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询组任务关联列表
|
||||
*
|
||||
* @param dmGroupTaskRelation 组任务关联
|
||||
* @return 组任务关联
|
||||
*/
|
||||
@Override
|
||||
public List<DmGroupTaskRelation> selectDmGroupTaskRelationList(DmGroupTaskRelation dmGroupTaskRelation)
|
||||
{
|
||||
return dmGroupTaskRelationMapper.selectDmGroupTaskRelationList(dmGroupTaskRelation);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增组任务关联
|
||||
*
|
||||
* @param dmGroupTaskRelation 组任务关联
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertDmGroupTaskRelation(DmGroupTaskRelation dmGroupTaskRelation)
|
||||
{
|
||||
dmGroupTaskRelation.setCreateTime(DateUtils.getNowDate());
|
||||
return dmGroupTaskRelationMapper.insertDmGroupTaskRelation(dmGroupTaskRelation);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改组任务关联
|
||||
*
|
||||
* @param dmGroupTaskRelation 组任务关联
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateDmGroupTaskRelation(DmGroupTaskRelation dmGroupTaskRelation)
|
||||
{
|
||||
dmGroupTaskRelation.setUpdateTime(DateUtils.getNowDate());
|
||||
return dmGroupTaskRelationMapper.updateDmGroupTaskRelation(dmGroupTaskRelation);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除组任务关联
|
||||
*
|
||||
* @param ids 需要删除的组任务关联ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDmGroupTaskRelationByIds(Long[] ids)
|
||||
{
|
||||
return dmGroupTaskRelationMapper.deleteDmGroupTaskRelationByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除组任务关联信息
|
||||
*
|
||||
* @param id 组任务关联ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDmGroupTaskRelationById(Long id)
|
||||
{
|
||||
return dmGroupTaskRelationMapper.deleteDmGroupTaskRelationById(id);
|
||||
}
|
||||
}
|
||||
+208
@@ -0,0 +1,208 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.system.mapper.DmPlayerTaskGroupMapper;
|
||||
import com.ruoyi.system.domain.DmPlayerTaskGroup;
|
||||
import com.ruoyi.system.domain.DmPlayerTaskGroupPlus;
|
||||
import com.ruoyi.system.service.IDmPlayerTaskGroupService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
/**
|
||||
* 大漠任务组Service业务层处理
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-05-14
|
||||
*/
|
||||
@Service
|
||||
public class DmPlayerTaskGroupServiceImpl extends ServiceImpl<DmPlayerTaskGroupMapper, DmPlayerTaskGroupPlus> implements IDmPlayerTaskGroupService
|
||||
{
|
||||
@Autowired
|
||||
private DmPlayerTaskGroupMapper dmPlayerTaskGroupMapper;
|
||||
@Autowired
|
||||
private JdbcTemplate jdbcTemplate;
|
||||
|
||||
@Override
|
||||
public List<DmPlayerTaskGroupPlus> getByIds(List<Long> ids, SFunction<DmPlayerTaskGroupPlus, ?>... columns) {
|
||||
LambdaQueryWrapper<DmPlayerTaskGroupPlus> lambdaQueryWrapper = new LambdaQueryWrapper<DmPlayerTaskGroupPlus>()
|
||||
.select(columns).in(DmPlayerTaskGroupPlus::getId, ids);
|
||||
return this.list(lambdaQueryWrapper);
|
||||
}
|
||||
@Override
|
||||
public List<SelectItem> select(String keyword) {
|
||||
LambdaQueryWrapper<DmPlayerTaskGroupPlus> lambdaQueryWrapper = new LambdaQueryWrapper<DmPlayerTaskGroupPlus>()
|
||||
.select(DmPlayerTaskGroupPlus::getId, DmPlayerTaskGroupPlus::getGroupName)
|
||||
.like(DmPlayerTaskGroupPlus::getGroupName, keyword);
|
||||
List<DmPlayerTaskGroupPlus> list = this.list(lambdaQueryWrapper);
|
||||
List<SelectItem> result =new ArrayList<>();
|
||||
for (DmPlayerTaskGroupPlus item : list){
|
||||
SelectItem selectItem = new SelectItem();
|
||||
selectItem.setName(item.getGroupName());
|
||||
selectItem.setId(item.getId());
|
||||
result.add(selectItem);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@Override
|
||||
public DmPlayerTaskGroupPlus getById(Long id, SFunction<DmPlayerTaskGroupPlus, ?>... columns) {
|
||||
LambdaQueryWrapper<DmPlayerTaskGroupPlus> lambdaQueryWrapper = new LambdaQueryWrapper<DmPlayerTaskGroupPlus>()
|
||||
.select(columns).eq(DmPlayerTaskGroupPlus::getId, id);
|
||||
return baseMapper.selectOne(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, DmPlayerTaskGroupPlus> getMapByIds(List<Long> ids, SFunction<DmPlayerTaskGroupPlus, ?>... columns) {
|
||||
List<DmPlayerTaskGroupPlus> list = this.getByIds(ids, columns);
|
||||
Map<Long, DmPlayerTaskGroupPlus> map = new HashMap<>();
|
||||
for (DmPlayerTaskGroupPlus item : list) {
|
||||
map.put(item.getId(), item);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, DmPlayerTaskGroupPlus> getMapByIds(List<Long> ids) {
|
||||
List<DmPlayerTaskGroupPlus> list = this.getByIds(ids);
|
||||
Map<Long, DmPlayerTaskGroupPlus> map = new HashMap<>();
|
||||
for (DmPlayerTaskGroupPlus item : list) {
|
||||
map.put(item.getId(), item);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DmPlayerTaskGroupPlus> getByIds(List<Long> ids) {
|
||||
LambdaQueryWrapper<DmPlayerTaskGroupPlus> lambdaQueryWrapper = new LambdaQueryWrapper<DmPlayerTaskGroupPlus>().in(DmPlayerTaskGroupPlus::getId, ids);
|
||||
return this.list(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
public <T> T sum(String field, String where, Class<T> tClass) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select ");
|
||||
stringBuffer.append(" sum(" + field + ") as total ");
|
||||
stringBuffer.append(" from dm_player_task_group ");
|
||||
if (StringUtils.isNotBlank(where)) {
|
||||
stringBuffer.append(" where ");
|
||||
stringBuffer.append(where);
|
||||
}
|
||||
T result = jdbcTemplate.queryForObject(stringBuffer.toString(), tClass);
|
||||
return result;
|
||||
}
|
||||
|
||||
public Long count(String where) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select ");
|
||||
stringBuffer.append(" count(1)");
|
||||
stringBuffer.append(" from ");
|
||||
stringBuffer.append(" dm_player_task_group ");
|
||||
if (StringUtils.isNotBlank(where)) {
|
||||
stringBuffer.append(" where ");
|
||||
stringBuffer.append(where);
|
||||
}
|
||||
Long result = jdbcTemplate.queryForObject(stringBuffer.toString(), Long.class);
|
||||
return result;
|
||||
}
|
||||
|
||||
public <T> List<T> countByGroupBy(String select, String where, String groupby, Class<T> tClass) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select ");
|
||||
stringBuffer.append(select);
|
||||
stringBuffer.append(" from ");
|
||||
stringBuffer.append(" dm_player_task_group ");
|
||||
if (StringUtils.isNotBlank(where)) {
|
||||
stringBuffer.append(" where ");
|
||||
stringBuffer.append(where);
|
||||
}
|
||||
stringBuffer.append(" group by ");
|
||||
stringBuffer.append(groupby);
|
||||
List result = jdbcTemplate.queryForList(stringBuffer.toString());
|
||||
List<T> tList = JSONArray.parseArray(JSONArray.toJSONString(result), tClass);
|
||||
return tList;
|
||||
}
|
||||
/**
|
||||
* 查询大漠任务组
|
||||
*
|
||||
* @param id 大漠任务组ID
|
||||
* @return 大漠任务组
|
||||
*/
|
||||
@Override
|
||||
public DmPlayerTaskGroup selectDmPlayerTaskGroupById(Long id)
|
||||
{
|
||||
return dmPlayerTaskGroupMapper.selectDmPlayerTaskGroupById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询大漠任务组列表
|
||||
*
|
||||
* @param dmPlayerTaskGroup 大漠任务组
|
||||
* @return 大漠任务组
|
||||
*/
|
||||
@Override
|
||||
public List<DmPlayerTaskGroup> selectDmPlayerTaskGroupList(DmPlayerTaskGroup dmPlayerTaskGroup)
|
||||
{
|
||||
return dmPlayerTaskGroupMapper.selectDmPlayerTaskGroupList(dmPlayerTaskGroup);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增大漠任务组
|
||||
*
|
||||
* @param dmPlayerTaskGroup 大漠任务组
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertDmPlayerTaskGroup(DmPlayerTaskGroup dmPlayerTaskGroup)
|
||||
{
|
||||
dmPlayerTaskGroup.setCreateTime(DateUtils.getNowDate());
|
||||
return dmPlayerTaskGroupMapper.insertDmPlayerTaskGroup(dmPlayerTaskGroup);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改大漠任务组
|
||||
*
|
||||
* @param dmPlayerTaskGroup 大漠任务组
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateDmPlayerTaskGroup(DmPlayerTaskGroup dmPlayerTaskGroup)
|
||||
{
|
||||
dmPlayerTaskGroup.setUpdateTime(DateUtils.getNowDate());
|
||||
return dmPlayerTaskGroupMapper.updateDmPlayerTaskGroup(dmPlayerTaskGroup);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除大漠任务组
|
||||
*
|
||||
* @param ids 需要删除的大漠任务组ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDmPlayerTaskGroupByIds(Long[] ids)
|
||||
{
|
||||
return dmPlayerTaskGroupMapper.deleteDmPlayerTaskGroupByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除大漠任务组信息
|
||||
*
|
||||
* @param id 大漠任务组ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDmPlayerTaskGroupById(Long id)
|
||||
{
|
||||
return dmPlayerTaskGroupMapper.deleteDmPlayerTaskGroupById(id);
|
||||
}
|
||||
}
|
||||
+208
@@ -0,0 +1,208 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.system.mapper.DmPlayerVersionMapper;
|
||||
import com.ruoyi.system.domain.DmPlayerVersion;
|
||||
import com.ruoyi.system.domain.DmPlayerVersionPlus;
|
||||
import com.ruoyi.system.service.IDmPlayerVersionService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
/**
|
||||
* 版本信息Service业务层处理
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-05-14
|
||||
*/
|
||||
@Service
|
||||
public class DmPlayerVersionServiceImpl extends ServiceImpl<DmPlayerVersionMapper, DmPlayerVersionPlus> implements IDmPlayerVersionService
|
||||
{
|
||||
@Autowired
|
||||
private DmPlayerVersionMapper dmPlayerVersionMapper;
|
||||
@Autowired
|
||||
private JdbcTemplate jdbcTemplate;
|
||||
|
||||
@Override
|
||||
public List<DmPlayerVersionPlus> getByIds(List<Long> ids, SFunction<DmPlayerVersionPlus, ?>... columns) {
|
||||
LambdaQueryWrapper<DmPlayerVersionPlus> lambdaQueryWrapper = new LambdaQueryWrapper<DmPlayerVersionPlus>()
|
||||
.select(columns).in(DmPlayerVersionPlus::getId, ids);
|
||||
return this.list(lambdaQueryWrapper);
|
||||
}
|
||||
@Override
|
||||
public List<SelectItem> select(String keyword) {
|
||||
LambdaQueryWrapper<DmPlayerVersionPlus> lambdaQueryWrapper = new LambdaQueryWrapper<DmPlayerVersionPlus>()
|
||||
.select(DmPlayerVersionPlus::getId, DmPlayerVersionPlus::getTitle)
|
||||
.like(DmPlayerVersionPlus::getTitle, keyword);
|
||||
List<DmPlayerVersionPlus> list = this.list(lambdaQueryWrapper);
|
||||
List<SelectItem> result =new ArrayList<>();
|
||||
for (DmPlayerVersionPlus item : list){
|
||||
SelectItem selectItem = new SelectItem();
|
||||
selectItem.setName(item.getTitle());
|
||||
selectItem.setId(item.getId());
|
||||
result.add(selectItem);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@Override
|
||||
public DmPlayerVersionPlus getById(Long id, SFunction<DmPlayerVersionPlus, ?>... columns) {
|
||||
LambdaQueryWrapper<DmPlayerVersionPlus> lambdaQueryWrapper = new LambdaQueryWrapper<DmPlayerVersionPlus>()
|
||||
.select(columns).eq(DmPlayerVersionPlus::getId, id);
|
||||
return baseMapper.selectOne(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, DmPlayerVersionPlus> getMapByIds(List<Long> ids, SFunction<DmPlayerVersionPlus, ?>... columns) {
|
||||
List<DmPlayerVersionPlus> list = this.getByIds(ids, columns);
|
||||
Map<Long, DmPlayerVersionPlus> map = new HashMap<>();
|
||||
for (DmPlayerVersionPlus item : list) {
|
||||
map.put(item.getId(), item);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, DmPlayerVersionPlus> getMapByIds(List<Long> ids) {
|
||||
List<DmPlayerVersionPlus> list = this.getByIds(ids);
|
||||
Map<Long, DmPlayerVersionPlus> map = new HashMap<>();
|
||||
for (DmPlayerVersionPlus item : list) {
|
||||
map.put(item.getId(), item);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DmPlayerVersionPlus> getByIds(List<Long> ids) {
|
||||
LambdaQueryWrapper<DmPlayerVersionPlus> lambdaQueryWrapper = new LambdaQueryWrapper<DmPlayerVersionPlus>().in(DmPlayerVersionPlus::getId, ids);
|
||||
return this.list(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
public <T> T sum(String field, String where, Class<T> tClass) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select ");
|
||||
stringBuffer.append(" sum(" + field + ") as total ");
|
||||
stringBuffer.append(" from dm_player_version ");
|
||||
if (StringUtils.isNotBlank(where)) {
|
||||
stringBuffer.append(" where ");
|
||||
stringBuffer.append(where);
|
||||
}
|
||||
T result = jdbcTemplate.queryForObject(stringBuffer.toString(), tClass);
|
||||
return result;
|
||||
}
|
||||
|
||||
public Long count(String where) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select ");
|
||||
stringBuffer.append(" count(1)");
|
||||
stringBuffer.append(" from ");
|
||||
stringBuffer.append(" dm_player_version ");
|
||||
if (StringUtils.isNotBlank(where)) {
|
||||
stringBuffer.append(" where ");
|
||||
stringBuffer.append(where);
|
||||
}
|
||||
Long result = jdbcTemplate.queryForObject(stringBuffer.toString(), Long.class);
|
||||
return result;
|
||||
}
|
||||
|
||||
public <T> List<T> countByGroupBy(String select, String where, String groupby, Class<T> tClass) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select ");
|
||||
stringBuffer.append(select);
|
||||
stringBuffer.append(" from ");
|
||||
stringBuffer.append(" dm_player_version ");
|
||||
if (StringUtils.isNotBlank(where)) {
|
||||
stringBuffer.append(" where ");
|
||||
stringBuffer.append(where);
|
||||
}
|
||||
stringBuffer.append(" group by ");
|
||||
stringBuffer.append(groupby);
|
||||
List result = jdbcTemplate.queryForList(stringBuffer.toString());
|
||||
List<T> tList = JSONArray.parseArray(JSONArray.toJSONString(result), tClass);
|
||||
return tList;
|
||||
}
|
||||
/**
|
||||
* 查询版本信息
|
||||
*
|
||||
* @param id 版本信息ID
|
||||
* @return 版本信息
|
||||
*/
|
||||
@Override
|
||||
public DmPlayerVersion selectDmPlayerVersionById(Long id)
|
||||
{
|
||||
return dmPlayerVersionMapper.selectDmPlayerVersionById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询版本信息列表
|
||||
*
|
||||
* @param dmPlayerVersion 版本信息
|
||||
* @return 版本信息
|
||||
*/
|
||||
@Override
|
||||
public List<DmPlayerVersion> selectDmPlayerVersionList(DmPlayerVersion dmPlayerVersion)
|
||||
{
|
||||
return dmPlayerVersionMapper.selectDmPlayerVersionList(dmPlayerVersion);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增版本信息
|
||||
*
|
||||
* @param dmPlayerVersion 版本信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertDmPlayerVersion(DmPlayerVersion dmPlayerVersion)
|
||||
{
|
||||
dmPlayerVersion.setCreateTime(DateUtils.getNowDate());
|
||||
return dmPlayerVersionMapper.insertDmPlayerVersion(dmPlayerVersion);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改版本信息
|
||||
*
|
||||
* @param dmPlayerVersion 版本信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateDmPlayerVersion(DmPlayerVersion dmPlayerVersion)
|
||||
{
|
||||
dmPlayerVersion.setUpdateTime(DateUtils.getNowDate());
|
||||
return dmPlayerVersionMapper.updateDmPlayerVersion(dmPlayerVersion);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除版本信息
|
||||
*
|
||||
* @param ids 需要删除的版本信息ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDmPlayerVersionByIds(Long[] ids)
|
||||
{
|
||||
return dmPlayerVersionMapper.deleteDmPlayerVersionByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除版本信息信息
|
||||
*
|
||||
* @param id 版本信息ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDmPlayerVersionById(Long id)
|
||||
{
|
||||
return dmPlayerVersionMapper.deleteDmPlayerVersionById(id);
|
||||
}
|
||||
}
|
||||
+14
-1
@@ -287,7 +287,7 @@ public class DmPlayerentServiceImpl extends ServiceImpl<DmPlayerentMapper, DmPla
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
} if (vo.getAction() == 9) { //更新版本
|
||||
} else if (vo.getAction() == 9) { //更新版本
|
||||
try {
|
||||
params.put("playerId", vo.getPlayerId());
|
||||
String result = httpHelper.getlHttpResult("http://" + this.serverIp + ":" + serverPort + "?cmd=9¶ms=" + URLEncoder.encode(JSONObject.toJSONString(params), "utf-8")
|
||||
@@ -300,6 +300,19 @@ public class DmPlayerentServiceImpl extends ServiceImpl<DmPlayerentMapper, DmPla
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
} else if (vo.getAction() == 10) { //更新版本
|
||||
try {
|
||||
params.put("playerId", vo.getPlayerId());
|
||||
String result = httpHelper.getlHttpResult("http://" + this.serverIp + ":" + serverPort + "?cmd=10¶ms=" + URLEncoder.encode(JSONObject.toJSONString(params), "utf-8")
|
||||
, "get", new HashMap<>(), new HashMap<>());
|
||||
JSONObject jsonObject = JSONObject.parseObject(result);
|
||||
if (jsonObject.getString("code").equals("1")) {
|
||||
return true;
|
||||
}
|
||||
System.out.println(result);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user