This commit is contained in:
lu7213 committed 2026-04-29 11:11:30 -04:00
1 parent da952a1103
commit d294ec17e0
11 files changed
+1191 -1

No files matched your search

@@ -0,0 +1,129 @@
package com.ruoyi.system.controller;
import com.ruoyi.common.select.Ids;
import com.ruoyi.common.select.SelectItem;
import java.util.List;
import com.ruoyi.system.domain.DmOperateVo;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.DmPlayerent;
import com.ruoyi.system.domain.DmPlayerentPlus;
import com.ruoyi.system.service.IDmPlayerentService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 大漠代理Controller
*
* @author luqj
* @date 2026-04-29
*/
@RestController
@RequestMapping("/system/playerent")
public class DmPlayerentController extends BaseController
{
@Autowired
private IDmPlayerentService dmPlayerentService;
@PreAuthorize("@ss.hasPermi('system:playerent:getByIds')")
@PostMapping("/getByIds")
public AjaxResult getByIds(@RequestBody Ids ids)
{
List<DmPlayerentPlus> list = dmPlayerentService.getByIds(ids.getLongIds(),DmPlayerentPlus::getName,DmPlayerentPlus::getId);
return AjaxResult.success(list);
}
@PreAuthorize("@ss.hasPermi('system:playerent:select')")
@GetMapping("/select")
public AjaxResult select(String keyword)
{
List<SelectItem> list = dmPlayerentService.select(keyword);
return AjaxResult.success(list);
}
/**
* 查询大漠代理列表
*/
@PreAuthorize("@ss.hasPermi('system:playerent:list')")
@GetMapping("/list")
public TableDataInfo list(DmPlayerent dmPlayerent)
{
startPage();
List<DmPlayerent> list = dmPlayerentService.selectDmPlayerentList(dmPlayerent);
return getDataTable(list);
}
/**
* 导出大漠代理列表
*/
@PreAuthorize("@ss.hasPermi('system:playerent:export')")
@Log(title = "大漠代理", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(DmPlayerent dmPlayerent)
{
List<DmPlayerent> list = dmPlayerentService.selectDmPlayerentList(dmPlayerent);
ExcelUtil<DmPlayerent> util = new ExcelUtil<DmPlayerent>(DmPlayerent.class);
return util.exportExcel(list, "playerent");
}
/**
* 获取大漠代理详细信息
*/
@PreAuthorize("@ss.hasPermi('system:playerent:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(dmPlayerentService.selectDmPlayerentById(id));
}
/**
* 新增大漠代理
*/
@PreAuthorize("@ss.hasPermi('system:playerent:add')")
@Log(title = "大漠代理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody DmPlayerent dmPlayerent)
{
return toAjax(dmPlayerentService.insertDmPlayerent(dmPlayerent));
}
/**
* 修改大漠代理
*/
@PreAuthorize("@ss.hasPermi('system:playerent:edit')")
@Log(title = "大漠代理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody DmPlayerent dmPlayerent)
{
return toAjax(dmPlayerentService.updateDmPlayerent(dmPlayerent));
}
/**
* 删除大漠代理
*/
@PreAuthorize("@ss.hasPermi('system:playerent:remove')")
@Log(title = "大漠代理", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(dmPlayerentService.deleteDmPlayerentByIds(ids));
}
@PreAuthorize("@ss.hasPermi('system:playerent:operate')")
@Log(title = "操作", businessType = BusinessType.INSERT)
@PostMapping("/operate")
public AjaxResult operate(@RequestBody DmOperateVo vo)
{
return toAjax(dmPlayerentService.operate(vo));
}
}
@@ -0,0 +1,14 @@
package com.ruoyi.system.domain;
import lombok.Data;
import java.io.Serializable;
@Data
public class DmOperateVo implements Serializable {
private static final long serialVersionUID = 1L;
private int action;
private String playerId;
private String winId;
private Integer operateType;
}
@@ -0,0 +1,235 @@
package com.ruoyi.system.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import java.io.Serializable;
/**
* 大漠代理对象 dm_playerent
*
* @author luqj
* @date 2026-04-29
*/
public class DmPlayerent extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long id;
/** 用户ID */
@Excel(name = "用户ID")
private Long accountid;
/** 名称 */
@Excel(name = "名称")
private String name;
/** 在线状态 */
@Excel(name = "在线状态")
private String onlineStatus;
/** 代理状态 */
@Excel(name = "代理状态")
private String playerStatus;
/** ip地址 */
@Excel(name = "ip地址")
private String ip;
/** http端口 */
@Excel(name = "http端口")
private String httpPort;
/** 窗口句柄 */
@Excel(name = "窗口句柄")
private Long winOneHwnd;
/** 窗口信息 */
@Excel(name = "窗口信息")
private String winOneInfo;
/** 窗口句柄 */
@Excel(name = "窗口句柄")
private Long winTwoHwnd;
/** 窗口信息 */
@Excel(name = "窗口信息")
private String winTwoInfo;
/** 截图地址 */
@Excel(name = "截图地址")
private String winTwoImgPath;
/** 截图地址 */
@Excel(name = "截图地址")
private String winOneImgPath;
/** 当前任务 */
@Excel(name = "当前任务")
private String winOneCurTask;
/** 当前任务 */
@Excel(name = "当前任务")
private String winTwoCurTask;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setAccountid(Long accountid)
{
this.accountid = accountid;
}
public Long getAccountid()
{
return accountid;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
public void setOnlineStatus(String onlineStatus)
{
this.onlineStatus = onlineStatus;
}
public String getOnlineStatus()
{
return onlineStatus;
}
public void setPlayerStatus(String playerStatus)
{
this.playerStatus = playerStatus;
}
public String getPlayerStatus()
{
return playerStatus;
}
public void setIp(String ip)
{
this.ip = ip;
}
public String getIp()
{
return ip;
}
public void setHttpPort(String httpPort)
{
this.httpPort = httpPort;
}
public String getHttpPort()
{
return httpPort;
}
public void setWinOneHwnd(Long winOneHwnd)
{
this.winOneHwnd = winOneHwnd;
}
public Long getWinOneHwnd()
{
return winOneHwnd;
}
public void setWinOneInfo(String winOneInfo)
{
this.winOneInfo = winOneInfo;
}
public String getWinOneInfo()
{
return winOneInfo;
}
public void setWinTwoHwnd(Long winTwoHwnd)
{
this.winTwoHwnd = winTwoHwnd;
}
public Long getWinTwoHwnd()
{
return winTwoHwnd;
}
public void setWinTwoInfo(String winTwoInfo)
{
this.winTwoInfo = winTwoInfo;
}
public String getWinTwoInfo()
{
return winTwoInfo;
}
public void setWinTwoImgPath(String winTwoImgPath)
{
this.winTwoImgPath = winTwoImgPath;
}
public String getWinTwoImgPath()
{
return winTwoImgPath;
}
public void setWinOneImgPath(String winOneImgPath)
{
this.winOneImgPath = winOneImgPath;
}
public String getWinOneImgPath()
{
return winOneImgPath;
}
public void setWinOneCurTask(String winOneCurTask)
{
this.winOneCurTask = winOneCurTask;
}
public String getWinOneCurTask()
{
return winOneCurTask;
}
public void setWinTwoCurTask(String winTwoCurTask)
{
this.winTwoCurTask = winTwoCurTask;
}
public String getWinTwoCurTask()
{
return winTwoCurTask;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("accountid", getAccountid())
.append("name", getName())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.append("onlineStatus", getOnlineStatus())
.append("playerStatus", getPlayerStatus())
.append("ip", getIp())
.append("httpPort", getHttpPort())
.append("winOneHwnd", getWinOneHwnd())
.append("winOneInfo", getWinOneInfo())
.append("winTwoHwnd", getWinTwoHwnd())
.append("winTwoInfo", getWinTwoInfo())
.append("winTwoImgPath", getWinTwoImgPath())
.append("winOneImgPath", getWinOneImgPath())
.append("winOneCurTask", getWinOneCurTask())
.append("winTwoCurTask", getWinTwoCurTask())
.toString();
}
}
@@ -0,0 +1,245 @@
package com.ruoyi.system.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import java.io.Serializable;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableName;
/**
* 大漠代理对象 dm_playerent
*
* @author luqj
* @date 2026-04-29
*/
@TableName(value = "dm_playerent")
public class DmPlayerentPlus implements Serializable
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long id;
/** 用户ID */
@Excel(name = "用户ID")
private Long accountid;
/** 名称 */
@Excel(name = "名称")
private String name;
/** 创建时间 */
private Date createTime;
/** 更新时间 */
private Date updateTime;
/** 在线状态 */
@Excel(name = "在线状态")
private String onlineStatus;
/** 代理状态 */
@Excel(name = "代理状态")
private String playerStatus;
/** ip地址 */
@Excel(name = "ip地址")
private String ip;
/** http端口 */
@Excel(name = "http端口")
private String httpPort;
/** 窗口句柄 */
@Excel(name = "窗口句柄")
private Long winOneHwnd;
/** 窗口信息 */
@Excel(name = "窗口信息")
private String winOneInfo;
/** 窗口句柄 */
@Excel(name = "窗口句柄")
private Long winTwoHwnd;
/** 窗口信息 */
@Excel(name = "窗口信息")
private String winTwoInfo;
/** 截图地址 */
@Excel(name = "截图地址")
private String winTwoImgPath;
/** 截图地址 */
@Excel(name = "截图地址")
private String winOneImgPath;
/** 当前任务 */
@Excel(name = "当前任务")
private String winOneCurTask;
/** 当前任务 */
@Excel(name = "当前任务")
private String winTwoCurTask;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setAccountid(Long accountid)
{
this.accountid = accountid;
}
public Long getAccountid()
{
return accountid;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
public void setCreateTime(Date createTime)
{
this.createTime = createTime;
}
public Date getCreateTime()
{
return createTime;
}
public void setUpdateTime(Date updateTime)
{
this.updateTime = updateTime;
}
public Date getUpdateTime()
{
return updateTime;
}
public void setOnlineStatus(String onlineStatus)
{
this.onlineStatus = onlineStatus;
}
public String getOnlineStatus()
{
return onlineStatus;
}
public void setPlayerStatus(String playerStatus)
{
this.playerStatus = playerStatus;
}
public String getPlayerStatus()
{
return playerStatus;
}
public void setIp(String ip)
{
this.ip = ip;
}
public String getIp()
{
return ip;
}
public void setHttpPort(String httpPort)
{
this.httpPort = httpPort;
}
public String getHttpPort()
{
return httpPort;
}
public void setWinOneHwnd(Long winOneHwnd)
{
this.winOneHwnd = winOneHwnd;
}
public Long getWinOneHwnd()
{
return winOneHwnd;
}
public void setWinOneInfo(String winOneInfo)
{
this.winOneInfo = winOneInfo;
}
public String getWinOneInfo()
{
return winOneInfo;
}
public void setWinTwoHwnd(Long winTwoHwnd)
{
this.winTwoHwnd = winTwoHwnd;
}
public Long getWinTwoHwnd()
{
return winTwoHwnd;
}
public void setWinTwoInfo(String winTwoInfo)
{
this.winTwoInfo = winTwoInfo;
}
public String getWinTwoInfo()
{
return winTwoInfo;
}
public void setWinTwoImgPath(String winTwoImgPath)
{
this.winTwoImgPath = winTwoImgPath;
}
public String getWinTwoImgPath()
{
return winTwoImgPath;
}
public void setWinOneImgPath(String winOneImgPath)
{
this.winOneImgPath = winOneImgPath;
}
public String getWinOneImgPath()
{
return winOneImgPath;
}
public void setWinOneCurTask(String winOneCurTask)
{
this.winOneCurTask = winOneCurTask;
}
public String getWinOneCurTask()
{
return winOneCurTask;
}
public void setWinTwoCurTask(String winTwoCurTask)
{
this.winTwoCurTask = winTwoCurTask;
}
public String getWinTwoCurTask()
{
return winTwoCurTask;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("accountid", getAccountid())
.append("name", getName())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.append("onlineStatus", getOnlineStatus())
.append("playerStatus", getPlayerStatus())
.append("ip", getIp())
.append("httpPort", getHttpPort())
.append("winOneHwnd", getWinOneHwnd())
.append("winOneInfo", getWinOneInfo())
.append("winTwoHwnd", getWinTwoHwnd())
.append("winTwoInfo", getWinTwoInfo())
.append("winTwoImgPath", getWinTwoImgPath())
.append("winOneImgPath", getWinOneImgPath())
.append("winOneCurTask", getWinOneCurTask())
.append("winTwoCurTask", getWinTwoCurTask())
.toString();
}
}
@@ -0,0 +1,65 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import com.ruoyi.system.domain.DmPlayerent;
import com.ruoyi.system.domain.DmPlayerentPlus;
/**
* 大漠代理Mapper接口
*
* @author luqj
* @date 2026-04-29
*/
public interface DmPlayerentMapper extends BaseMapper<DmPlayerentPlus>
{
/**
* 查询大漠代理
*
* @param id 大漠代理ID
* @return 大漠代理
*/
public DmPlayerent selectDmPlayerentById(Long id);
/**
* 查询大漠代理列表
*
* @param dmPlayerent 大漠代理
* @return 大漠代理集合
*/
public List<DmPlayerent> selectDmPlayerentList(DmPlayerent dmPlayerent);
/**
* 新增大漠代理
*
* @param dmPlayerent 大漠代理
* @return 结果
*/
public int insertDmPlayerent(DmPlayerent dmPlayerent);
/**
* 修改大漠代理
*
* @param dmPlayerent 大漠代理
* @return 结果
*/
public int updateDmPlayerent(DmPlayerent dmPlayerent);
/**
* 删除大漠代理
*
* @param id 大漠代理ID
* @return 结果
*/
public int deleteDmPlayerentById(Long id);
/**
* 批量删除大漠代理
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteDmPlayerentByIds(Long[] ids);
}
@@ -0,0 +1,93 @@
package com.ruoyi.system.service;
import java.util.Map;
import java.util.List;
import com.ruoyi.system.domain.DmOperateVo;
import com.ruoyi.system.domain.DmPlayerent;
import com.ruoyi.system.domain.DmPlayerentPlus;
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-04-29
*/
public interface IDmPlayerentService extends IService<DmPlayerentPlus>
{
List<SelectItem> select(String keyword);
/**
* 查询大漠代理
*
* @param id 大漠代理ID
* @return 大漠代理
*/
public DmPlayerent selectDmPlayerentById(Long id);
/**
* 查询大漠代理列表
*
* @param dmPlayerent 大漠代理
* @return 大漠代理集合
*/
public List<DmPlayerent> selectDmPlayerentList(DmPlayerent dmPlayerent);
/**
* 新增大漠代理
*
* @param dmPlayerent 大漠代理
* @return 结果
*/
public int insertDmPlayerent(DmPlayerent dmPlayerent);
public boolean operate(DmOperateVo vo);
/**
* 修改大漠代理
*
* @param dmPlayerent 大漠代理
* @return 结果
*/
public int updateDmPlayerent(DmPlayerent dmPlayerent);
/**
* 批量删除大漠代理
*
* @param ids 需要删除的大漠代理ID
* @return 结果
*/
public int deleteDmPlayerentByIds(Long[] ids);
/**
* 删除大漠代理信息
*
* @param id 大漠代理ID
* @return 结果
*/
public int deleteDmPlayerentById(Long id);
List<DmPlayerentPlus> getByIds(List<Long> ids, SFunction<DmPlayerentPlus, ?>... columns);
DmPlayerentPlus getById(Long id, SFunction<DmPlayerentPlus, ?>... columns);
Map<Long, DmPlayerentPlus> getMapByIds(List<Long> ids, SFunction<DmPlayerentPlus, ?>... columns);
List<DmPlayerentPlus> getByIds(List<Long> ids);
Map<Long, DmPlayerentPlus> 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,249 @@
package com.ruoyi.system.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.luqj.util.HttpHelper;
import com.ruoyi.common.select.SelectItem;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.domain.DmOperateVo;
import com.ruoyi.system.domain.DmPlayerent;
import com.ruoyi.system.domain.DmPlayerentPlus;
import com.ruoyi.system.mapper.DmPlayerentMapper;
import com.ruoyi.system.service.IDmPlayerentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 大漠代理Service业务层处理
*
* @author luqj
* @date 2026-04-29
*/
@Service
public class DmPlayerentServiceImpl extends ServiceImpl<DmPlayerentMapper, DmPlayerentPlus> implements IDmPlayerentService {
private HttpHelper httpHelper = new HttpHelper();
@Autowired
private DmPlayerentMapper dmPlayerentMapper;
@Autowired
private JdbcTemplate jdbcTemplate;
@Value("${dm.server.ip:192.168.3.103}")
private String serverIp;
@Value("${dm.server.port:8080}")
private Integer serverPort;
@Override
public List<DmPlayerentPlus> getByIds(List<Long> ids, SFunction<DmPlayerentPlus, ?>... columns) {
LambdaQueryWrapper<DmPlayerentPlus> lambdaQueryWrapper = new LambdaQueryWrapper<DmPlayerentPlus>()
.select(columns).in(DmPlayerentPlus::getId, ids);
return this.list(lambdaQueryWrapper);
}
@Override
public List<SelectItem> select(String keyword) {
LambdaQueryWrapper<DmPlayerentPlus> lambdaQueryWrapper = new LambdaQueryWrapper<DmPlayerentPlus>()
.select(DmPlayerentPlus::getId, DmPlayerentPlus::getName)
.like(DmPlayerentPlus::getName, keyword);
List<DmPlayerentPlus> list = this.list(lambdaQueryWrapper);
List<SelectItem> result = new ArrayList<>();
for (DmPlayerentPlus item : list) {
SelectItem selectItem = new SelectItem();
selectItem.setName(item.getName());
selectItem.setId(item.getId());
result.add(selectItem);
}
return result;
}
@Override
public DmPlayerentPlus getById(Long id, SFunction<DmPlayerentPlus, ?>... columns) {
LambdaQueryWrapper<DmPlayerentPlus> lambdaQueryWrapper = new LambdaQueryWrapper<DmPlayerentPlus>()
.select(columns).eq(DmPlayerentPlus::getId, id);
return baseMapper.selectOne(lambdaQueryWrapper);
}
@Override
public Map<Long, DmPlayerentPlus> getMapByIds(List<Long> ids, SFunction<DmPlayerentPlus, ?>... columns) {
List<DmPlayerentPlus> list = this.getByIds(ids, columns);
Map<Long, DmPlayerentPlus> map = new HashMap<>();
for (DmPlayerentPlus item : list) {
map.put(item.getId(), item);
}
return map;
}
@Override
public Map<Long, DmPlayerentPlus> getMapByIds(List<Long> ids) {
List<DmPlayerentPlus> list = this.getByIds(ids);
Map<Long, DmPlayerentPlus> map = new HashMap<>();
for (DmPlayerentPlus item : list) {
map.put(item.getId(), item);
}
return map;
}
@Override
public List<DmPlayerentPlus> getByIds(List<Long> ids) {
LambdaQueryWrapper<DmPlayerentPlus> lambdaQueryWrapper = new LambdaQueryWrapper<DmPlayerentPlus>().in(DmPlayerentPlus::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_playerent ");
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_playerent ");
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_playerent ");
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 DmPlayerent selectDmPlayerentById(Long id) {
return dmPlayerentMapper.selectDmPlayerentById(id);
}
/**
* 查询大漠代理列表
*
* @param dmPlayerent 大漠代理
* @return 大漠代理
*/
@Override
public List<DmPlayerent> selectDmPlayerentList(DmPlayerent dmPlayerent) {
return dmPlayerentMapper.selectDmPlayerentList(dmPlayerent);
}
/**
* 新增大漠代理
*
* @param dmPlayerent 大漠代理
* @return 结果
*/
@Override
public int insertDmPlayerent(DmPlayerent dmPlayerent) {
dmPlayerent.setCreateTime(DateUtils.getNowDate());
return dmPlayerentMapper.insertDmPlayerent(dmPlayerent);
}
@Override
public boolean operate(DmOperateVo vo) {
JSONObject params = new JSONObject();
if (vo.getAction() == 5) { //截图
try {
params.put("winId",vo.getWinId());
params.put("playerId",vo.getPlayerId());
String result = httpHelper.getlHttpResult("http://"+ this.serverIp +":"+serverPort+ "?cmd=6&params="+ 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);
}
}else if(vo.getAction() == 6){
try {
params.put("winId",vo.getWinId());
params.put("playerId",vo.getPlayerId());
params.put("operateType",vo.getOperateType());
String result = httpHelper.getlHttpResult("http://"+ this.serverIp +":"+serverPort+ "?cmd=7&params="+ 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 false;
}
/**
* 修改大漠代理
*
* @param dmPlayerent 大漠代理
* @return 结果
*/
@Override
public int updateDmPlayerent(DmPlayerent dmPlayerent) {
dmPlayerent.setUpdateTime(DateUtils.getNowDate());
return dmPlayerentMapper.updateDmPlayerent(dmPlayerent);
}
/**
* 批量删除大漠代理
*
* @param ids 需要删除的大漠代理ID
* @return 结果
*/
@Override
public int deleteDmPlayerentByIds(Long[] ids) {
return dmPlayerentMapper.deleteDmPlayerentByIds(ids);
}
/**
* 删除大漠代理信息
*
* @param id 大漠代理ID
* @return 结果
*/
@Override
public int deleteDmPlayerentById(Long id) {
return dmPlayerentMapper.deleteDmPlayerentById(id);
}
}