完成计算作品总数和近7天作品总数接口。
This commit is contained in:
parent
758553cc47
commit
e1bfdca81e
@ -0,0 +1,104 @@
|
||||
package com.ruoyi.system.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
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.DailySys;
|
||||
import com.ruoyi.system.service.IDailySysService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 记录系统每天需要统计的任务Controller
|
||||
*
|
||||
* @author haoitan
|
||||
* @date 2024-11-07
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/sys")
|
||||
public class DailySysController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IDailySysService dailySysService;
|
||||
|
||||
/**
|
||||
* 查询记录系统每天需要统计的任务列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:sys:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(DailySys dailySys)
|
||||
{
|
||||
startPage();
|
||||
List<DailySys> list = dailySysService.selectDailySysList(dailySys);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出记录系统每天需要统计的任务列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:sys:export')")
|
||||
@Log(title = "记录系统每天需要统计的任务", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DailySys dailySys)
|
||||
{
|
||||
List<DailySys> list = dailySysService.selectDailySysList(dailySys);
|
||||
ExcelUtil<DailySys> util = new ExcelUtil<DailySys>(DailySys.class);
|
||||
util.exportExcel(response, list, "记录系统每天需要统计的任务数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取记录系统每天需要统计的任务详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:sys:query')")
|
||||
@GetMapping(value = "/{dailySysId}")
|
||||
public AjaxResult getInfo(@PathVariable("dailySysId") Long dailySysId)
|
||||
{
|
||||
return success(dailySysService.selectDailySysByDailySysId(dailySysId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增记录系统每天需要统计的任务
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:sys:add')")
|
||||
@Log(title = "记录系统每天需要统计的任务", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody DailySys dailySys)
|
||||
{
|
||||
return toAjax(dailySysService.insertDailySys(dailySys));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改记录系统每天需要统计的任务
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:sys:edit')")
|
||||
@Log(title = "记录系统每天需要统计的任务", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody DailySys dailySys)
|
||||
{
|
||||
return toAjax(dailySysService.updateDailySys(dailySys));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除记录系统每天需要统计的任务
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:sys:remove')")
|
||||
@Log(title = "记录系统每天需要统计的任务", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{dailySysIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] dailySysIds)
|
||||
{
|
||||
return toAjax(dailySysService.deleteDailySysByDailySysIds(dailySysIds));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,104 @@
|
||||
package com.ruoyi.system.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
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.DailyWork;
|
||||
import com.ruoyi.system.service.IDailyWorkService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 作品每日统计Controller
|
||||
*
|
||||
* @author haotian
|
||||
* @date 2024-11-08
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/dailyWork")
|
||||
public class DailyWorkController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IDailyWorkService dailyWorkService;
|
||||
|
||||
/**
|
||||
* 查询作品每日统计列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dailyWork:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(DailyWork dailyWork)
|
||||
{
|
||||
startPage();
|
||||
List<DailyWork> list = dailyWorkService.selectDailyWorkList(dailyWork);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出作品每日统计列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dailyWork:export')")
|
||||
@Log(title = "作品每日统计", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DailyWork dailyWork)
|
||||
{
|
||||
List<DailyWork> list = dailyWorkService.selectDailyWorkList(dailyWork);
|
||||
ExcelUtil<DailyWork> util = new ExcelUtil<DailyWork>(DailyWork.class);
|
||||
util.exportExcel(response, list, "作品每日统计数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取作品每日统计详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dailyWork:query')")
|
||||
@GetMapping(value = "/{dailyWorkId}")
|
||||
public AjaxResult getInfo(@PathVariable("dailyWorkId") Long dailyWorkId)
|
||||
{
|
||||
return success(dailyWorkService.selectDailyWorkByDailyWorkId(dailyWorkId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增作品每日统计
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dailyWork:add')")
|
||||
@Log(title = "作品每日统计", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody DailyWork dailyWork)
|
||||
{
|
||||
return toAjax(dailyWorkService.insertDailyWork(dailyWork));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改作品每日统计
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dailyWork:edit')")
|
||||
@Log(title = "作品每日统计", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody DailyWork dailyWork)
|
||||
{
|
||||
return toAjax(dailyWorkService.updateDailyWork(dailyWork));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除作品每日统计
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:dailyWork:remove')")
|
||||
@Log(title = "作品每日统计", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{dailyWorkIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] dailyWorkIds)
|
||||
{
|
||||
return toAjax(dailyWorkService.deleteDailyWorkByDailyWorkIds(dailyWorkIds));
|
||||
}
|
||||
}
|
||||
209
ruoyi-system/src/main/java/com/ruoyi/system/domain/DailySys.java
Normal file
209
ruoyi-system/src/main/java/com/ruoyi/system/domain/DailySys.java
Normal file
@ -0,0 +1,209 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 记录系统每天需要统计的任务对象 daily_sys
|
||||
*
|
||||
* @author haoitan
|
||||
* @date 2024-11-07
|
||||
*/
|
||||
public class DailySys extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键自增ID */
|
||||
private Long dailySysId;
|
||||
|
||||
/** 用户总数 */
|
||||
@Excel(name = "用户总数")
|
||||
private Long tUser;
|
||||
|
||||
/** 用户总的在线时长 */
|
||||
@Excel(name = "用户总的在线时长")
|
||||
private Long tOnlineTime;
|
||||
|
||||
/** 用户总的MR在线时长 */
|
||||
@Excel(name = "用户总的MR在线时长")
|
||||
private Long tMrTime;
|
||||
|
||||
/** 资源位总的被购买数 */
|
||||
@Excel(name = "资源位总的被购买数")
|
||||
private Long tBought;
|
||||
|
||||
/** 资源位总的互动次数 */
|
||||
@Excel(name = "资源位总的互动次数")
|
||||
private Long tInteractions;
|
||||
|
||||
/** 资源位总的分享次数 */
|
||||
@Excel(name = "资源位总的分享次数")
|
||||
private Long tShares;
|
||||
|
||||
/** 上传内容总数 */
|
||||
@Excel(name = "上传内容总数")
|
||||
private Long tWork;
|
||||
|
||||
/** 过审内容数 */
|
||||
@Excel(name = "过审内容数")
|
||||
private Long tPassWork;
|
||||
|
||||
/** 退回内容数 */
|
||||
@Excel(name = "退回内容数")
|
||||
private Long tBackWork;
|
||||
|
||||
/** 收入 */
|
||||
@Excel(name = "收入")
|
||||
private Long tIncome;
|
||||
|
||||
/** 退款 */
|
||||
@Excel(name = "退款")
|
||||
private Long tRefund;
|
||||
|
||||
/** 每天时间,记录到天 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "每天时间,记录到天", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private LocalDate date;
|
||||
|
||||
public void setDailySysId(Long dailySysId)
|
||||
{
|
||||
this.dailySysId = dailySysId;
|
||||
}
|
||||
|
||||
public Long getDailySysId()
|
||||
{
|
||||
return dailySysId;
|
||||
}
|
||||
public void settUser(Long tUser)
|
||||
{
|
||||
this.tUser = tUser;
|
||||
}
|
||||
|
||||
public Long gettUser()
|
||||
{
|
||||
return tUser;
|
||||
}
|
||||
public void settOnlineTime(Long tOnlineTime)
|
||||
{
|
||||
this.tOnlineTime = tOnlineTime;
|
||||
}
|
||||
|
||||
public Long gettOnlineTime()
|
||||
{
|
||||
return tOnlineTime;
|
||||
}
|
||||
public void settMrTime(Long tMrTime)
|
||||
{
|
||||
this.tMrTime = tMrTime;
|
||||
}
|
||||
|
||||
public Long gettMrTime()
|
||||
{
|
||||
return tMrTime;
|
||||
}
|
||||
public void settBought(Long tBought)
|
||||
{
|
||||
this.tBought = tBought;
|
||||
}
|
||||
|
||||
public Long gettBought()
|
||||
{
|
||||
return tBought;
|
||||
}
|
||||
public void settInteractions(Long tInteractions)
|
||||
{
|
||||
this.tInteractions = tInteractions;
|
||||
}
|
||||
|
||||
public Long gettInteractions()
|
||||
{
|
||||
return tInteractions;
|
||||
}
|
||||
public void settShares(Long tShares)
|
||||
{
|
||||
this.tShares = tShares;
|
||||
}
|
||||
|
||||
public Long gettShares()
|
||||
{
|
||||
return tShares;
|
||||
}
|
||||
public void settWork(Long tWork)
|
||||
{
|
||||
this.tWork = tWork;
|
||||
}
|
||||
|
||||
public Long gettWork()
|
||||
{
|
||||
return tWork;
|
||||
}
|
||||
public void settPassWork(Long tPassWork)
|
||||
{
|
||||
this.tPassWork = tPassWork;
|
||||
}
|
||||
|
||||
public Long gettPassWork()
|
||||
{
|
||||
return tPassWork;
|
||||
}
|
||||
public void settBackWork(Long tBackWork)
|
||||
{
|
||||
this.tBackWork = tBackWork;
|
||||
}
|
||||
|
||||
public Long gettBackWork()
|
||||
{
|
||||
return tBackWork;
|
||||
}
|
||||
public void settIncome(Long tIncome)
|
||||
{
|
||||
this.tIncome = tIncome;
|
||||
}
|
||||
|
||||
public Long gettIncome()
|
||||
{
|
||||
return tIncome;
|
||||
}
|
||||
public void settRefund(Long tRefund)
|
||||
{
|
||||
this.tRefund = tRefund;
|
||||
}
|
||||
|
||||
public Long gettRefund()
|
||||
{
|
||||
return tRefund;
|
||||
}
|
||||
public void setDate(LocalDate date)
|
||||
{
|
||||
this.date = date;
|
||||
}
|
||||
|
||||
public LocalDate getDate()
|
||||
{
|
||||
return date;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("dailySysId", getDailySysId())
|
||||
.append("tUser", gettUser())
|
||||
.append("tOnlineTime", gettOnlineTime())
|
||||
.append("tMrTime", gettMrTime())
|
||||
.append("tBought", gettBought())
|
||||
.append("tInteractions", gettInteractions())
|
||||
.append("tShares", gettShares())
|
||||
.append("tWork", gettWork())
|
||||
.append("tPassWork", gettPassWork())
|
||||
.append("tBackWork", gettBackWork())
|
||||
.append("tIncome", gettIncome())
|
||||
.append("tRefund", gettRefund())
|
||||
.append("data", getDate())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,97 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 作品每日统计对象 daily_work
|
||||
*
|
||||
* @author haotian
|
||||
* @date 2024-11-08
|
||||
*/
|
||||
public class DailyWork extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键自增 */
|
||||
private Long dailyWorkId;
|
||||
|
||||
/** 关联 */
|
||||
@Excel(name = "关联")
|
||||
private Long workId;
|
||||
|
||||
/** 收到赞数 */
|
||||
@Excel(name = "收到赞数")
|
||||
private Long rock;
|
||||
|
||||
/** 每天时间(记录到天) */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "每天时间(记录到天)", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date date;
|
||||
|
||||
/** 删除标志 */
|
||||
private String delFlag;
|
||||
|
||||
public void setDailyWorkId(Long dailyWorkId)
|
||||
{
|
||||
this.dailyWorkId = dailyWorkId;
|
||||
}
|
||||
|
||||
public Long getDailyWorkId()
|
||||
{
|
||||
return dailyWorkId;
|
||||
}
|
||||
public void setWorkId(Long workId)
|
||||
{
|
||||
this.workId = workId;
|
||||
}
|
||||
|
||||
public Long getWorkId()
|
||||
{
|
||||
return workId;
|
||||
}
|
||||
public void setRock(Long rock)
|
||||
{
|
||||
this.rock = rock;
|
||||
}
|
||||
|
||||
public Long getRock()
|
||||
{
|
||||
return rock;
|
||||
}
|
||||
public void setDate(Date date)
|
||||
{
|
||||
this.date = date;
|
||||
}
|
||||
|
||||
public Date getDate()
|
||||
{
|
||||
return date;
|
||||
}
|
||||
public void setDelFlag(String delFlag)
|
||||
{
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public String getDelFlag()
|
||||
{
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("dailyWorkId", getDailyWorkId())
|
||||
.append("workId", getWorkId())
|
||||
.append("rock", getRock())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("date", getDate())
|
||||
.append("delFlag", getDelFlag())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,76 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.DailySys;
|
||||
import com.ruoyi.system.domain.dto.SeUserCountDto;
|
||||
import com.ruoyi.system.domain.dto.SeUserWorkCountDto;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 记录系统每天需要统计的任务Mapper接口
|
||||
*
|
||||
* @author haoitan
|
||||
* @date 2024-11-07
|
||||
*/
|
||||
public interface DailySysMapper
|
||||
{
|
||||
/**
|
||||
* 查询记录系统每天需要统计的任务
|
||||
*
|
||||
* @param dailySysId 记录系统每天需要统计的任务主键
|
||||
* @return 记录系统每天需要统计的任务
|
||||
*/
|
||||
public DailySys selectDailySysByDailySysId(Long dailySysId);
|
||||
|
||||
public DailySys selectDailySysByDate(LocalDate date);
|
||||
|
||||
/**
|
||||
* 查询记录系统每天需要统计的任务列表
|
||||
*
|
||||
* @param dailySys 记录系统每天需要统计的任务
|
||||
* @return 记录系统每天需要统计的任务集合
|
||||
*/
|
||||
public List<DailySys> selectDailySysList(DailySys dailySys);
|
||||
|
||||
public List<SeUserCountDto> selectDailySysListBetweenDate(@Param("startDate") LocalDate startDate, @Param("endDate") LocalDate endDate);
|
||||
|
||||
public List<SeUserWorkCountDto> selectDailySysWorkListBetweenDate(@Param("startDate")LocalDate startDate, @Param("endDate") LocalDate endDate);
|
||||
|
||||
/**
|
||||
* 新增记录系统每天需要统计的任务
|
||||
*
|
||||
* @param dailySys 记录系统每天需要统计的任务
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDailySys(DailySys dailySys);
|
||||
|
||||
/**
|
||||
* 修改记录系统每天需要统计的任务
|
||||
*
|
||||
* @param dailySys 记录系统每天需要统计的任务
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDailySys(DailySys dailySys);
|
||||
|
||||
/**
|
||||
* 删除记录系统每天需要统计的任务
|
||||
*
|
||||
* @param dailySysId 记录系统每天需要统计的任务主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDailySysByDailySysId(Long dailySysId);
|
||||
|
||||
/**
|
||||
* 批量删除记录系统每天需要统计的任务
|
||||
*
|
||||
* @param dailySysIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDailySysByDailySysIds(Long[] dailySysIds);
|
||||
|
||||
/*
|
||||
* 计数系统中用户的总数
|
||||
* */
|
||||
// public Long getUserCount();
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.DailyWork;
|
||||
|
||||
/**
|
||||
* 作品每日统计Mapper接口
|
||||
*
|
||||
* @author haotian
|
||||
* @date 2024-11-08
|
||||
*/
|
||||
public interface DailyWorkMapper
|
||||
{
|
||||
/**
|
||||
* 查询作品每日统计
|
||||
*
|
||||
* @param dailyWorkId 作品每日统计主键
|
||||
* @return 作品每日统计
|
||||
*/
|
||||
public DailyWork selectDailyWorkByDailyWorkId(Long dailyWorkId);
|
||||
|
||||
/**
|
||||
* 查询作品每日统计列表
|
||||
*
|
||||
* @param dailyWork 作品每日统计
|
||||
* @return 作品每日统计集合
|
||||
*/
|
||||
public List<DailyWork> selectDailyWorkList(DailyWork dailyWork);
|
||||
|
||||
/**
|
||||
* 新增作品每日统计
|
||||
*
|
||||
* @param dailyWork 作品每日统计
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDailyWork(DailyWork dailyWork);
|
||||
|
||||
/**
|
||||
* 修改作品每日统计
|
||||
*
|
||||
* @param dailyWork 作品每日统计
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDailyWork(DailyWork dailyWork);
|
||||
|
||||
/**
|
||||
* 删除作品每日统计
|
||||
*
|
||||
* @param dailyWorkId 作品每日统计主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDailyWorkByDailyWorkId(Long dailyWorkId);
|
||||
|
||||
/**
|
||||
* 批量删除作品每日统计
|
||||
*
|
||||
* @param dailyWorkIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDailyWorkByDailyWorkIds(Long[] dailyWorkIds);
|
||||
}
|
||||
@ -0,0 +1,84 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.DailySys;
|
||||
import com.ruoyi.system.domain.dto.SeUserCountDto;
|
||||
import com.ruoyi.system.domain.dto.SeUserWorkCountDto;
|
||||
|
||||
/**
|
||||
* 记录系统每天需要统计的任务Service接口
|
||||
*
|
||||
* @author haoitan
|
||||
* @date 2024-11-07
|
||||
*/
|
||||
public interface IDailySysService
|
||||
{
|
||||
/**
|
||||
* 查询记录系统每天需要统计的任务
|
||||
*
|
||||
* @param dailySysId 记录系统每天需要统计的任务主键
|
||||
* @return 记录系统每天需要统计的任务
|
||||
*/
|
||||
public DailySys selectDailySysByDailySysId(Long dailySysId);
|
||||
|
||||
/**
|
||||
* 根据日期查询记录系统数据
|
||||
* @param date
|
||||
* @return
|
||||
*/
|
||||
public DailySys selectDailySysByDate(LocalDate date);
|
||||
|
||||
/**
|
||||
* 查询记录系统每天需要统计的任务列表
|
||||
*
|
||||
* @param dailySys 记录系统每天需要统计的任务
|
||||
* @return 记录系统每天需要统计的任务集合
|
||||
*/
|
||||
public List<DailySys> selectDailySysList(DailySys dailySys);
|
||||
|
||||
// 获取近7天的每天用户总数
|
||||
public List<SeUserCountDto> getSeUserCount(LocalDate startDate, LocalDate endDate);
|
||||
|
||||
//获取近7天的每天作品总数
|
||||
public List<SeUserWorkCountDto> getSeUserWorkCount(LocalDate startDate, LocalDate endDate);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 新增记录系统每天需要统计的任务
|
||||
*
|
||||
* @param dailySys 记录系统每天需要统计的任务
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDailySys(DailySys dailySys);
|
||||
|
||||
/**
|
||||
* 修改记录系统每天需要统计的任务
|
||||
*
|
||||
* @param dailySys 记录系统每天需要统计的任务
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDailySys(DailySys dailySys);
|
||||
|
||||
/**
|
||||
* 批量删除记录系统每天需要统计的任务
|
||||
*
|
||||
* @param dailySysIds 需要删除的记录系统每天需要统计的任务主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDailySysByDailySysIds(Long[] dailySysIds);
|
||||
|
||||
/**
|
||||
* 删除记录系统每天需要统计的任务信息
|
||||
*
|
||||
* @param dailySysId 记录系统每天需要统计的任务主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDailySysByDailySysId(Long dailySysId);
|
||||
|
||||
/*
|
||||
* 返回系统中的用户总数
|
||||
* */
|
||||
// public Long getUserCount();
|
||||
}
|
||||
@ -0,0 +1,124 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.system.domain.dto.SeUserCountDto;
|
||||
import com.ruoyi.system.domain.dto.SeUserWorkCountDto;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.system.mapper.DailySysMapper;
|
||||
import com.ruoyi.system.domain.DailySys;
|
||||
import com.ruoyi.system.service.IDailySysService;
|
||||
|
||||
/**
|
||||
* 记录系统每天需要统计的任务Service业务层处理
|
||||
*
|
||||
* @author haoitan
|
||||
* @date 2024-11-07
|
||||
*/
|
||||
@Service
|
||||
public class DailySysServiceImpl implements IDailySysService
|
||||
{
|
||||
@Autowired
|
||||
private DailySysMapper dailySysMapper;
|
||||
|
||||
/**
|
||||
* 查询记录系统每天需要统计的任务
|
||||
*
|
||||
* @param dailySysId 记录系统每天需要统计的任务主键
|
||||
* @return 记录系统每天需要统计的任务
|
||||
*/
|
||||
@Override
|
||||
public DailySys selectDailySysByDailySysId(Long dailySysId)
|
||||
{
|
||||
return dailySysMapper.selectDailySysByDailySysId(dailySysId);
|
||||
}
|
||||
|
||||
|
||||
//根据日期返回 系统数据
|
||||
@Override
|
||||
public DailySys selectDailySysByDate(LocalDate date)
|
||||
{
|
||||
return dailySysMapper.selectDailySysByDate(date);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询记录系统每天需要统计的任务列表
|
||||
*
|
||||
* @param dailySys 记录系统每天需要统计的任务
|
||||
* @return 记录系统每天需要统计的任务
|
||||
*/
|
||||
@Override
|
||||
public List<DailySys> selectDailySysList(DailySys dailySys)
|
||||
{
|
||||
return dailySysMapper.selectDailySysList(dailySys);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SeUserCountDto> getSeUserCount(LocalDate startDate, LocalDate endDate){
|
||||
|
||||
return dailySysMapper.selectDailySysListBetweenDate(startDate, endDate);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SeUserWorkCountDto> getSeUserWorkCount(LocalDate startDate, LocalDate endDate){
|
||||
return dailySysMapper.selectDailySysWorkListBetweenDate(startDate, endDate);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增记录系统每天需要统计的任务
|
||||
*
|
||||
* @param dailySys 记录系统每天需要统计的任务
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertDailySys(DailySys dailySys)
|
||||
{
|
||||
return dailySysMapper.insertDailySys(dailySys);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改记录系统每天需要统计的任务
|
||||
*
|
||||
* @param dailySys 记录系统每天需要统计的任务
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateDailySys(DailySys dailySys)
|
||||
{
|
||||
return dailySysMapper.updateDailySys(dailySys);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除记录系统每天需要统计的任务
|
||||
*
|
||||
* @param dailySysIds 需要删除的记录系统每天需要统计的任务主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDailySysByDailySysIds(Long[] dailySysIds)
|
||||
{
|
||||
return dailySysMapper.deleteDailySysByDailySysIds(dailySysIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除记录系统每天需要统计的任务信息
|
||||
*
|
||||
* @param dailySysId 记录系统每天需要统计的任务主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDailySysByDailySysId(Long dailySysId)
|
||||
{
|
||||
return dailySysMapper.deleteDailySysByDailySysId(dailySysId);
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public Long getUserCount()
|
||||
// {
|
||||
// return dailySysMapper.getUserCount();
|
||||
// }
|
||||
|
||||
}
|
||||
137
ruoyi-system/src/main/resources/mapper/system/DailySysMapper.xml
Normal file
137
ruoyi-system/src/main/resources/mapper/system/DailySysMapper.xml
Normal file
@ -0,0 +1,137 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.system.mapper.DailySysMapper">
|
||||
|
||||
<resultMap type="DailySys" id="DailySysResult">
|
||||
<result property="dailySysId" column="daily_sys_id" />
|
||||
<result property="tUser" column="t_user" />
|
||||
<result property="tOnlineTime" column="t_online_time" />
|
||||
<result property="tMrTime" column="t_mr_time" />
|
||||
<result property="tBought" column="t_bought" />
|
||||
<result property="tInteractions" column="t_interactions" />
|
||||
<result property="tShares" column="t_shares" />
|
||||
<result property="tWork" column="t_work" />
|
||||
<result property="tPassWork" column="t_pass_work" />
|
||||
<result property="tBackWork" column="t_back_work" />
|
||||
<result property="tIncome" column="t_income" />
|
||||
<result property="tRefund" column="t_refund" />
|
||||
<result property="date" column="data" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="SeUserCountResult" type="seUserCountDto">
|
||||
<result property="date" column="data"/>
|
||||
<result property="tUser" column="t_user"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="SeUserWorkCountResult" type="seUserWorkCountDto">
|
||||
<result property="date" column="data"/>
|
||||
<result property="tWork" column="t_work"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDailySysVo">
|
||||
select daily_sys_id, t_user, t_online_time, t_mr_time, t_bought, t_interactions, t_shares, t_work, t_pass_work, t_back_work, t_income, t_refund, data from daily_sys
|
||||
</sql>
|
||||
|
||||
<select id="selectDailySysList" parameterType="DailySys" resultMap="DailySysResult">
|
||||
<include refid="selectDailySysVo"/>
|
||||
<where>
|
||||
<if test="tUser != null "> and t_user = #{tUser}</if>
|
||||
<if test="tOnlineTime != null "> and t_online_time = #{tOnlineTime}</if>
|
||||
<if test="tMrTime != null "> and t_mr_time = #{tMrTime}</if>
|
||||
<if test="tBought != null "> and t_bought = #{tBought}</if>
|
||||
<if test="tInteractions != null "> and t_interactions = #{tInteractions}</if>
|
||||
<if test="tShares != null "> and t_shares = #{tShares}</if>
|
||||
<if test="tWork != null "> and t_work = #{tWork}</if>
|
||||
<if test="tPassWork != null "> and t_pass_work = #{tPassWork}</if>
|
||||
<if test="tBackWork != null "> and t_back_work = #{tBackWork}</if>
|
||||
<if test="tIncome != null "> and t_income = #{tIncome}</if>
|
||||
<if test="tRefund != null "> and t_refund = #{tRefund}</if>
|
||||
<if test="date != null "> and data = #{date}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectDailySysByDailySysId" parameterType="Long" resultMap="DailySysResult">
|
||||
<include refid="selectDailySysVo"/>
|
||||
where daily_sys_id = #{dailySysId}
|
||||
</select>
|
||||
|
||||
<select id="selectDailySysByDate" parameterType="java.time.LocalDate" resultMap="DailySysResult">
|
||||
<include refid="selectDailySysVo"/>
|
||||
where data = #{date}
|
||||
</select>
|
||||
|
||||
<select id="selectDailySysListBetweenDate" parameterType="java.time.LocalDate" resultMap="SeUserCountResult">
|
||||
select t_user, data from daily_sys where data between #{startDate} and #{endDate}
|
||||
</select>
|
||||
|
||||
<select id="selectDailySysWorkListBetweenDate" parameterType="java.time.LocalDate" resultMap="SeUserWorkCountResult">
|
||||
select t_work, data from daily_sys where data between #{startDate} and #{endDate}
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<insert id="insertDailySys" parameterType="DailySys" useGeneratedKeys="true" keyProperty="dailySysId">
|
||||
insert into daily_sys
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="tUser != null">t_user,</if>
|
||||
<if test="tOnlineTime != null">t_online_time,</if>
|
||||
<if test="tMrTime != null">t_mr_time,</if>
|
||||
<if test="tBought != null">t_bought,</if>
|
||||
<if test="tInteractions != null">t_interactions,</if>
|
||||
<if test="tShares != null">t_shares,</if>
|
||||
<if test="tWork != null">t_work,</if>
|
||||
<if test="tPassWork != null">t_pass_work,</if>
|
||||
<if test="tBackWork != null">t_back_work,</if>
|
||||
<if test="tIncome != null">t_income,</if>
|
||||
<if test="tRefund != null">t_refund,</if>
|
||||
<if test="date != null">data,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="tUser != null">#{tUser},</if>
|
||||
<if test="tOnlineTime != null">#{tOnlineTime},</if>
|
||||
<if test="tMrTime != null">#{tMrTime},</if>
|
||||
<if test="tBought != null">#{tBought},</if>
|
||||
<if test="tInteractions != null">#{tInteractions},</if>
|
||||
<if test="tShares != null">#{tShares},</if>
|
||||
<if test="tWork != null">#{tWork},</if>
|
||||
<if test="tPassWork != null">#{tPassWork},</if>
|
||||
<if test="tBackWork != null">#{tBackWork},</if>
|
||||
<if test="tIncome != null">#{tIncome},</if>
|
||||
<if test="tRefund != null">#{tRefund},</if>
|
||||
<if test="date != null">#{date},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateDailySys" parameterType="DailySys">
|
||||
update daily_sys
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="tUser != null">t_user = #{tUser},</if>
|
||||
<if test="tOnlineTime != null">t_online_time = #{tOnlineTime},</if>
|
||||
<if test="tMrTime != null">t_mr_time = #{tMrTime},</if>
|
||||
<if test="tBought != null">t_bought = #{tBought},</if>
|
||||
<if test="tInteractions != null">t_interactions = #{tInteractions},</if>
|
||||
<if test="tShares != null">t_shares = #{tShares},</if>
|
||||
<if test="tWork != null">t_work = #{tWork},</if>
|
||||
<if test="tPassWork != null">t_pass_work = #{tPassWork},</if>
|
||||
<if test="tBackWork != null">t_back_work = #{tBackWork},</if>
|
||||
<if test="tIncome != null">t_income = #{tIncome},</if>
|
||||
<if test="tRefund != null">t_refund = #{tRefund},</if>
|
||||
<if test="date != null">data = #{date},</if>
|
||||
</trim>
|
||||
where daily_sys_id = #{dailySysId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteDailySysByDailySysId" parameterType="Long">
|
||||
delete from daily_sys where daily_sys_id = #{dailySysId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteDailySysByDailySysIds" parameterType="String">
|
||||
delete from daily_sys where daily_sys_id in
|
||||
<foreach item="dailySysId" collection="array" open="(" separator="," close=")">
|
||||
#{dailySysId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,78 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.system.mapper.DailyWorkMapper">
|
||||
|
||||
<resultMap type="DailyWork" id="DailyWorkResult">
|
||||
<result property="dailyWorkId" column="daily_work_id" />
|
||||
<result property="workId" column="work_id" />
|
||||
<result property="rock" column="rock" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="date" column="date" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDailyWorkVo">
|
||||
select daily_work_id, work_id, rock, create_time, update_time, date, del_flag from daily_work
|
||||
</sql>
|
||||
|
||||
<select id="selectDailyWorkList" parameterType="DailyWork" resultMap="DailyWorkResult">
|
||||
<include refid="selectDailyWorkVo"/>
|
||||
<where>
|
||||
<if test="workId != null "> and work_id = #{workId}</if>
|
||||
<if test="rock != null "> and rock = #{rock}</if>
|
||||
<if test="date != null "> and date = #{date}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectDailyWorkByDailyWorkId" parameterType="Long" resultMap="DailyWorkResult">
|
||||
<include refid="selectDailyWorkVo"/>
|
||||
where daily_work_id = #{dailyWorkId}
|
||||
</select>
|
||||
|
||||
<insert id="insertDailyWork" parameterType="DailyWork" useGeneratedKeys="true" keyProperty="dailyWorkId">
|
||||
insert into daily_work
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="workId != null">work_id,</if>
|
||||
<if test="rock != null">rock,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="date != null">date,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="workId != null">#{workId},</if>
|
||||
<if test="rock != null">#{rock},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="date != null">#{date},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateDailyWork" parameterType="DailyWork">
|
||||
update daily_work
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="workId != null">work_id = #{workId},</if>
|
||||
<if test="rock != null">rock = #{rock},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="date != null">date = #{date},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
</trim>
|
||||
where daily_work_id = #{dailyWorkId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteDailyWorkByDailyWorkId" parameterType="Long">
|
||||
delete from daily_work where daily_work_id = #{dailyWorkId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteDailyWorkByDailyWorkIds" parameterType="String">
|
||||
delete from daily_work where daily_work_id in
|
||||
<foreach item="dailyWorkId" collection="array" open="(" separator="," close=")">
|
||||
#{dailyWorkId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue
Block a user