From 03065cfc7c999e518bd2a159ce029e486cb47f40 Mon Sep 17 00:00:00 2001 From: "kuang.yife" Date: Sun, 5 May 2024 21:30:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E9=A1=B5=E9=9D=A2=E5=AE=8C?= =?UTF-8?q?=E5=96=84=E4=B8=80=E5=A4=A7=E5=A0=86=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PlayletCustomerServiceAppController.java | 2 + .../PlayletCustomerServiceController.java | 11 ++ .../system/PlayletItemController.java | 6 +- .../PlayletRevenueRecordController.java | 3 + .../system/PlayletTaskController.java | 42 +++-- .../system/PlayletUserAccountController.java | 20 +-- .../system/PlayletUserController.java | 7 + .../system/PlayletUserInvoiceController.java | 29 ++-- .../system/PlayletUserLoginController.java | 145 ++++++++++++++++++ ...etUserWithdrawDepositRecordController.java | 28 ++-- .../service/app/PlayletUserAppService.java | 2 + .../app/impl/PlayletUserAppServiceImpl.java | 37 ++++- .../system/playlet/invoice/edit.html | 74 +++++++++ .../system/playlet/invoice/invoice.html | 139 +++++++++++++++++ .../templates/system/playlet/item/add.html | 8 + .../templates/system/playlet/item/edit.html | 8 + .../templates/system/playlet/login/login.html | 94 ++++++++++++ .../system/playlet/record/record.html | 127 +++++++++++++++ .../system/playlet/service/service.html | 30 +++- .../templates/system/playlet/task/add.html | 103 +++++++++++++ .../templates/system/playlet/task/edit.html | 98 ++++++++++++ .../templates/system/playlet/task/task.html | 134 ++++++++++++++++ .../system/playlet/user/placeUser.html | 96 ++++++++++++ .../templates/system/playlet/user/user.html | 13 ++ .../playlet/userAccount/userAccount.html | 140 +++++++++++++++++ .../common/core/domain/BaseEntity.java | 2 + .../system/domain/PlayletRevenueRecord.java | 28 ++-- .../playlet/system/domain/PlayletUser.java | 1 + .../system/domain/PlayletUserInvoice.java | 4 + .../system/domain/PlayletUserLogin.java | 42 +++++ .../PlayletUserWithdrawDepositRecord.java | 4 + .../system/mapper/PlayletUserLoginMapper.java | 62 ++++++++ .../service/IPlayletUserLoginService.java | 62 ++++++++ .../impl/PlayletUserLoginServiceImpl.java | 98 ++++++++++++ .../mapper/system/PlayletUserLoginMapper.xml | 82 ++++++++++ .../mapper/system/PlayletUserMapper.xml | 8 +- 36 files changed, 1732 insertions(+), 57 deletions(-) create mode 100644 playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletUserLoginController.java create mode 100644 playlet-admin/src/main/resources/templates/system/playlet/invoice/edit.html create mode 100644 playlet-admin/src/main/resources/templates/system/playlet/invoice/invoice.html create mode 100644 playlet-admin/src/main/resources/templates/system/playlet/login/login.html create mode 100644 playlet-admin/src/main/resources/templates/system/playlet/record/record.html create mode 100644 playlet-admin/src/main/resources/templates/system/playlet/task/add.html create mode 100644 playlet-admin/src/main/resources/templates/system/playlet/task/edit.html create mode 100644 playlet-admin/src/main/resources/templates/system/playlet/task/task.html create mode 100644 playlet-admin/src/main/resources/templates/system/playlet/user/placeUser.html create mode 100644 playlet-admin/src/main/resources/templates/system/playlet/userAccount/userAccount.html create mode 100644 playlet-system/src/main/java/com/playlet/system/domain/PlayletUserLogin.java create mode 100644 playlet-system/src/main/java/com/playlet/system/mapper/PlayletUserLoginMapper.java create mode 100644 playlet-system/src/main/java/com/playlet/system/service/IPlayletUserLoginService.java create mode 100644 playlet-system/src/main/java/com/playlet/system/service/impl/PlayletUserLoginServiceImpl.java create mode 100644 playlet-system/src/main/resources/mapper/system/PlayletUserLoginMapper.xml diff --git a/playlet-admin/src/main/java/com/playlet/web/controller/app/PlayletCustomerServiceAppController.java b/playlet-admin/src/main/java/com/playlet/web/controller/app/PlayletCustomerServiceAppController.java index 5e78a26..5668cd2 100644 --- a/playlet-admin/src/main/java/com/playlet/web/controller/app/PlayletCustomerServiceAppController.java +++ b/playlet-admin/src/main/java/com/playlet/web/controller/app/PlayletCustomerServiceAppController.java @@ -29,6 +29,8 @@ public class PlayletCustomerServiceAppController { @PostMapping("/getCustomerList") @ApiOperation(value = "查询客服列表") public Result> getCustomerList(@RequestBody PlayletCustomerService customerService) { + // 只查询启用的 + customerService.setStatus("01"); return Result.success(playletCustomerServiceAppService.getCustomerList(customerService)); } diff --git a/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletCustomerServiceController.java b/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletCustomerServiceController.java index de901da..b2a6116 100644 --- a/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletCustomerServiceController.java +++ b/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletCustomerServiceController.java @@ -1,6 +1,9 @@ package com.playlet.web.controller.system; import java.util.List; + +import com.playlet.common.core.domain.Result; +import com.playlet.common.core.domain.entity.SysUser; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -34,6 +37,14 @@ public class PlayletCustomerServiceController extends BaseController @Autowired private IPlayletCustomerServiceService playletCustomerServiceService; + @PostMapping("/changeStatus") + @ResponseBody + public AjaxResult changeStatus(PlayletCustomerService playletCustomerService) + { + playletCustomerServiceService.updateById(playletCustomerService); + return AjaxResult.success(); + } + @RequiresPermissions("playlet:service:view") @GetMapping() public String service() diff --git a/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletItemController.java b/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletItemController.java index 1528bb9..ae45f05 100644 --- a/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletItemController.java +++ b/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletItemController.java @@ -86,8 +86,10 @@ public class PlayletItemController extends BaseController { * 新增短剧基础 */ @GetMapping("/add") - public String add() + public String add(ModelMap modelMap) { + List itemTypes = playletItemTypeService.selectPlayletItemTypeList(new PlayletItemType()); + modelMap.put("itemTypes", itemTypes); return prefix + "/add"; } @@ -111,7 +113,9 @@ public class PlayletItemController extends BaseController { public String edit(@PathVariable("id") Long id, ModelMap mmap) { PlayletItem playletItem = playletItemService.selectPlayletItemById(id); + List itemTypes = playletItemTypeService.selectPlayletItemTypeList(new PlayletItemType()); mmap.put("playletItem", playletItem); + mmap.put("itemTypes", itemTypes); return prefix + "/edit"; } diff --git a/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletRevenueRecordController.java b/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletRevenueRecordController.java index a572b2a..6cbb2b2 100644 --- a/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletRevenueRecordController.java +++ b/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletRevenueRecordController.java @@ -4,6 +4,7 @@ import java.util.List; import com.playlet.common.core.domain.Result; import com.playlet.system.pojo.vo.RevenueRecordStatisticsVO; +import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import org.apache.shiro.authz.annotation.RequiresPermissions; @@ -26,6 +27,7 @@ import com.playlet.common.core.page.TableDataInfo; * @Version: v1.0 * @Description: 短剧任务收益Controller */ +@Api(tags = "外部系统推送收益返回平台") @Controller @RequestMapping("/system/record") @RequiredArgsConstructor(onConstructor = @__(@Autowired)) @@ -81,6 +83,7 @@ public class PlayletRevenueRecordController extends BaseController { @Log(title = "短剧任务收益", businessType = BusinessType.INSERT) @PostMapping("/add") @ResponseBody + @ApiOperation(value = "第三方推送收益返回平台入参") public AjaxResult addSave(PlayletRevenueRecord playletRevenueRecord) { return toAjax(playletRevenueRecordService.insertPlayletRevenueRecord(playletRevenueRecord)); } diff --git a/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletTaskController.java b/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletTaskController.java index c455f83..2eee2aa 100644 --- a/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletTaskController.java +++ b/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletTaskController.java @@ -4,6 +4,7 @@ import java.util.List; import com.github.pagehelper.PageInfo; import com.playlet.common.core.domain.Result; +import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import org.apache.shiro.authz.annotation.RequiresPermissions; @@ -27,14 +28,15 @@ import com.playlet.common.core.page.TableDataInfo; * @Description: 任务Controller */ @Controller -@RequestMapping("/system/task") +@RequestMapping("/system/playlet/task") @RequiredArgsConstructor(onConstructor = @__(@Autowired)) +@Api(tags = "外部系统*任务接口") public class PlayletTaskController extends BaseController { - private String prefix = "system/task"; + private String prefix = "system/playlet/task"; private final IPlayletTaskService playletTaskService; - @RequiresPermissions("system:task:view") + @RequiresPermissions("playlet:task:view") @GetMapping() public String task() { return prefix + "/task"; @@ -43,7 +45,7 @@ public class PlayletTaskController extends BaseController { /** * 查询任务列表 */ - @RequiresPermissions("system:task:list") + @RequiresPermissions("playlet:task:list") @PostMapping("/list") @ResponseBody public TableDataInfo list(PlayletTask playletTask) { @@ -55,7 +57,7 @@ public class PlayletTaskController extends BaseController { /** * 导出任务列表 */ - @RequiresPermissions("system:task:export") + @RequiresPermissions("playlet:task:export") @Log(title = "任务", businessType = BusinessType.EXPORT) @PostMapping("/export") @ResponseBody @@ -76,7 +78,7 @@ public class PlayletTaskController extends BaseController { /** * 新增保存任务 */ - @RequiresPermissions("system:task:add") + @RequiresPermissions("playlet:task:add") @Log(title = "任务", businessType = BusinessType.INSERT) @PostMapping("/add") @ResponseBody @@ -84,10 +86,18 @@ public class PlayletTaskController extends BaseController { return toAjax(playletTaskService.insertPlayletTask(playletTask)); } + @PostMapping("/batchAdd") + @ResponseBody + @ApiOperation("外部系统批量创建任务") + public AjaxResult batchAdd(@RequestBody List playletTasks) { + playletTaskService.saveBatch(playletTasks); + return AjaxResult.success(); + } + /** * 修改任务 */ - @RequiresPermissions("system:task:edit") + @RequiresPermissions("playlet:task:edit") @GetMapping("/edit/{id}") public String edit(@PathVariable("id") Long id, ModelMap mmap) { PlayletTask playletTask = playletTaskService.selectPlayletTaskById(id); @@ -98,7 +108,7 @@ public class PlayletTaskController extends BaseController { /** * 修改保存任务 */ - @RequiresPermissions("system:task:edit") + @RequiresPermissions("playlet:task:edit") @Log(title = "任务", businessType = BusinessType.UPDATE) @PostMapping("/edit") @ResponseBody @@ -106,14 +116,28 @@ public class PlayletTaskController extends BaseController { return toAjax(playletTaskService.updatePlayletTask(playletTask)); } + @PostMapping("/editTask") + @ResponseBody + @ApiOperation("外部系统更新任务状态") + public AjaxResult editTask(@RequestBody PlayletTask playletTask) { + return toAjax(playletTaskService.updatePlayletTask(playletTask)); + } + /** * 删除任务 */ - @RequiresPermissions("system:task:remove") + @RequiresPermissions("playlet:task:remove") @Log(title = "任务", businessType = BusinessType.DELETE) @PostMapping("/remove") @ResponseBody public AjaxResult remove(String ids) { return toAjax(playletTaskService.deletePlayletTaskByIds(ids)); } + + @PostMapping("/removeTask") + @ResponseBody + @ApiOperation("外部系统删除任务") + public AjaxResult removeTask(@RequestParam(value = "ids") String ids) { + return toAjax(playletTaskService.deletePlayletTaskByIds(ids)); + } } diff --git a/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletUserAccountController.java b/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletUserAccountController.java index 676400d..e120ebc 100644 --- a/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletUserAccountController.java +++ b/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletUserAccountController.java @@ -29,23 +29,23 @@ import com.playlet.common.core.page.TableDataInfo; * @Description: 短剧用户提现账户Controller */ @Controller -@RequestMapping("/system/account") +@RequestMapping("/system/playlet/userAccount") @RequiredArgsConstructor(onConstructor = @__(@Autowired)) public class PlayletUserAccountController extends BaseController { - private String prefix = "system/account"; + private String prefix = "system/playlet/userAccount"; private final IPlayletUserAccountService playletUserAccountService; - @RequiresPermissions("system:account:view") + @RequiresPermissions("playlet:userAccount:view") @GetMapping() public String account() { - return prefix + "/account"; + return prefix + "/userAccount"; } /** * 查询短剧用户提现账户列表 */ - @RequiresPermissions("system:account:list") + @RequiresPermissions("playlet:userAccount:list") @PostMapping("/list") @ResponseBody public TableDataInfo list(PlayletUserAccount playletUserAccount) { @@ -57,7 +57,7 @@ public class PlayletUserAccountController extends BaseController { /** * 导出短剧用户提现账户列表 */ - @RequiresPermissions("system:account:export") + @RequiresPermissions("playlet:userAccount:export") @Log(title = "短剧用户提现账户", businessType = BusinessType.EXPORT) @PostMapping("/export") @ResponseBody @@ -78,7 +78,7 @@ public class PlayletUserAccountController extends BaseController { /** * 新增保存短剧用户提现账户 */ - @RequiresPermissions("system:account:add") + @RequiresPermissions("playlet:userAccount:add") @Log(title = "短剧用户提现账户", businessType = BusinessType.INSERT) @PostMapping("/add") @ResponseBody @@ -89,7 +89,7 @@ public class PlayletUserAccountController extends BaseController { /** * 修改短剧用户提现账户 */ - @RequiresPermissions("system:account:edit") + @RequiresPermissions("playlet:userAccount:edit") @GetMapping("/edit/{id}") public String edit(@PathVariable("id") Long id, ModelMap mmap) { PlayletUserAccount playletUserAccount = playletUserAccountService.selectPlayletUserAccountById(id); @@ -100,7 +100,7 @@ public class PlayletUserAccountController extends BaseController { /** * 修改保存短剧用户提现账户 */ - @RequiresPermissions("system:account:edit") + @RequiresPermissions("playlet:userAccount:edit") @Log(title = "短剧用户提现账户", businessType = BusinessType.UPDATE) @PostMapping("/edit") @ResponseBody @@ -111,7 +111,7 @@ public class PlayletUserAccountController extends BaseController { /** * 删除短剧用户提现账户 */ - @RequiresPermissions("system:account:remove") + @RequiresPermissions("playlet:userAccount:remove") @Log(title = "短剧用户提现账户", businessType = BusinessType.DELETE) @PostMapping("/remove") @ResponseBody diff --git a/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletUserController.java b/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletUserController.java index 3613648..5111204 100644 --- a/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletUserController.java +++ b/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletUserController.java @@ -124,4 +124,11 @@ public class PlayletUserController extends BaseController { return toAjax(playletUserService.deletePlayletUserByIds(ids)); } + + @GetMapping("/placeUser/{code}") + public String vipConfig(@PathVariable("code") String code, ModelMap mmap) + { + mmap.put("parentId", code); + return "system/playlet/user/placeUser"; + } } diff --git a/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletUserInvoiceController.java b/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletUserInvoiceController.java index ca6c077..9dd8af8 100644 --- a/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletUserInvoiceController.java +++ b/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletUserInvoiceController.java @@ -2,6 +2,8 @@ package com.playlet.web.controller.system; import java.util.List; +import com.playlet.system.domain.PlayletUser; +import com.playlet.system.service.IPlayletUserService; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -27,14 +29,17 @@ import com.playlet.common.core.page.TableDataInfo; * @Description: 用户开票信息Controller */ @Controller -@RequestMapping("/system/invoice") +@RequestMapping("/system/playlet/invoice") public class PlayletUserInvoiceController extends BaseController { - private String prefix = "system/invoice"; + private String prefix = "system/playlet/invoice"; @Autowired private IPlayletUserInvoiceService playletUserInvoiceService; - @RequiresPermissions("system:invoice:view") + @Autowired + private IPlayletUserService playletUserService; + + @RequiresPermissions("playlet:invoice:view") @GetMapping() public String invoice() { return prefix + "/invoice"; @@ -43,19 +48,25 @@ public class PlayletUserInvoiceController extends BaseController { /** * 查询用户开票信息列表 */ - @RequiresPermissions("system:invoice:list") + @RequiresPermissions("playlet:invoice:list") @PostMapping("/list") @ResponseBody public TableDataInfo list(PlayletUserInvoice playletUserInvoice) { startPage(); List list = playletUserInvoiceService.selectPlayletUserInvoiceList(playletUserInvoice); + list.forEach(model->{ + PlayletUser user = playletUserService.getById(model.getUserId()); + if(user != null){ + model.setUserName(user.getNickName()); + } + }); return getDataTable(list); } /** * 导出用户开票信息列表 */ - @RequiresPermissions("system:invoice:export") + @RequiresPermissions("playlet:invoice:export") @Log(title = "用户开票信息", businessType = BusinessType.EXPORT) @PostMapping("/export") @ResponseBody @@ -76,7 +87,7 @@ public class PlayletUserInvoiceController extends BaseController { /** * 新增保存用户开票信息 */ - @RequiresPermissions("system:invoice:add") + @RequiresPermissions("playlet:invoice:add") @Log(title = "用户开票信息", businessType = BusinessType.INSERT) @PostMapping("/add") @ResponseBody @@ -87,7 +98,7 @@ public class PlayletUserInvoiceController extends BaseController { /** * 修改用户开票信息 */ - @RequiresPermissions("system:invoice:edit") + @RequiresPermissions("playlet:invoice:edit") @GetMapping("/edit/{id}") public String edit(@PathVariable("id") Long id, ModelMap mmap) { PlayletUserInvoice playletUserInvoice = playletUserInvoiceService.selectPlayletUserInvoiceById(id); @@ -98,7 +109,7 @@ public class PlayletUserInvoiceController extends BaseController { /** * 修改保存用户开票信息 */ - @RequiresPermissions("system:invoice:edit") + @RequiresPermissions("playlet:invoice:edit") @Log(title = "用户开票信息", businessType = BusinessType.UPDATE) @PostMapping("/edit") @ResponseBody @@ -109,7 +120,7 @@ public class PlayletUserInvoiceController extends BaseController { /** * 删除用户开票信息 */ - @RequiresPermissions("system:invoice:remove") + @RequiresPermissions("playlet:invoice:remove") @Log(title = "用户开票信息", businessType = BusinessType.DELETE) @PostMapping("/remove") @ResponseBody diff --git a/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletUserLoginController.java b/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletUserLoginController.java new file mode 100644 index 0000000..0125357 --- /dev/null +++ b/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletUserLoginController.java @@ -0,0 +1,145 @@ +package com.playlet.web.controller.system; + +import java.util.List; + +import com.playlet.system.domain.PlayletUser; +import com.playlet.system.service.IPlayletUserService; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import com.playlet.common.annotation.Log; +import com.playlet.common.enums.BusinessType; +import com.playlet.system.domain.PlayletUserLogin; +import com.playlet.system.service.IPlayletUserLoginService; +import com.playlet.common.core.controller.BaseController; +import com.playlet.common.core.domain.AjaxResult; +import com.playlet.common.utils.poi.ExcelUtil; +import com.playlet.common.core.page.TableDataInfo; + +/** + * 用户登录记录Controller + * + * @author ruoyi + * @date 2024-05-05 + */ +@Controller +@RequestMapping("/system/playlet/login") +public class PlayletUserLoginController extends BaseController +{ + private String prefix = "system/playlet/login"; + + @Autowired + private IPlayletUserLoginService playletUserLoginService; + + @Autowired + private IPlayletUserService playletUserService; + + @RequiresPermissions("playlet:login:view") + @GetMapping() + public String login() + { + return prefix + "/login"; + } + + /** + * 查询用户登录记录列表 + */ + @RequiresPermissions("playlet:login:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(PlayletUserLogin playletUserLogin) + { + startPage(); + List list = playletUserLoginService.selectPlayletUserLoginList(playletUserLogin); + list.forEach(model->{ + PlayletUser user = playletUserService.getById(model.getUserId()); + if(user != null){ + model.setUserName(user.getNickName()); + } + }); + return getDataTable(list); + } + + /** + * 导出用户登录记录列表 + */ + @RequiresPermissions("playlet:login:export") + @Log(title = "用户登录记录", businessType = BusinessType.EXPORT) + @PostMapping("/export") + @ResponseBody + public AjaxResult export(PlayletUserLogin playletUserLogin) + { + List list = playletUserLoginService.selectPlayletUserLoginList(playletUserLogin); + list.forEach(model->{ + PlayletUser user = playletUserService.getById(model.getUserId()); + if(user != null){ + model.setUserName(user.getNickName()); + } + }); + ExcelUtil util = new ExcelUtil(PlayletUserLogin.class); + return util.exportExcel(list, "用户登录记录数据"); + } + + /** + * 新增用户登录记录 + */ + @GetMapping("/add") + public String add() + { + return prefix + "/add"; + } + + /** + * 新增保存用户登录记录 + */ + @RequiresPermissions("playlet:login:add") + @Log(title = "用户登录记录", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(PlayletUserLogin playletUserLogin) + { + return toAjax(playletUserLoginService.insertPlayletUserLogin(playletUserLogin)); + } + + /** + * 修改用户登录记录 + */ + @RequiresPermissions("playlet:login:edit") + @GetMapping("/edit/{id}") + public String edit(@PathVariable("id") Long id, ModelMap mmap) + { + PlayletUserLogin playletUserLogin = playletUserLoginService.selectPlayletUserLoginById(id); + mmap.put("playletUserLogin", playletUserLogin); + return prefix + "/edit"; + } + + /** + * 修改保存用户登录记录 + */ + @RequiresPermissions("playlet:login:edit") + @Log(title = "用户登录记录", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(PlayletUserLogin playletUserLogin) + { + return toAjax(playletUserLoginService.updatePlayletUserLogin(playletUserLogin)); + } + + /** + * 删除用户登录记录 + */ + @RequiresPermissions("playlet:login:remove") + @Log(title = "用户登录记录", businessType = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String ids) + { + return toAjax(playletUserLoginService.deletePlayletUserLoginByIds(ids)); + } +} diff --git a/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletUserWithdrawDepositRecordController.java b/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletUserWithdrawDepositRecordController.java index 37c9256..6579ad5 100644 --- a/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletUserWithdrawDepositRecordController.java +++ b/playlet-admin/src/main/java/com/playlet/web/controller/system/PlayletUserWithdrawDepositRecordController.java @@ -3,7 +3,9 @@ package com.playlet.web.controller.system; import java.util.List; import com.playlet.common.core.domain.Result; +import com.playlet.system.domain.PlayletUser; import com.playlet.system.domain.PlayletUserWithdrawalPassword; +import com.playlet.system.service.IPlayletUserService; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import org.apache.shiro.authz.annotation.RequiresPermissions; @@ -27,14 +29,16 @@ import com.playlet.common.core.page.TableDataInfo; * @Description: 用户交易记录Controller */ @Controller -@RequestMapping("/system/userWithdrawRecord") +@RequestMapping("/system/playlet/record") @RequiredArgsConstructor(onConstructor = @__(@Autowired)) public class PlayletUserWithdrawDepositRecordController extends BaseController { - private String prefix = "system/record"; + private String prefix = "system/playlet/record"; private final IPlayletUserWithdrawDepositRecordService playletUserWithdrawDepositRecordService; - @RequiresPermissions("system:record:view") + private final IPlayletUserService playletUserService; + + @RequiresPermissions("playlet:record:view") @GetMapping() public String record() { return prefix + "/record"; @@ -43,19 +47,25 @@ public class PlayletUserWithdrawDepositRecordController extends BaseController { /** * 查询用户交易记录列表 */ - @RequiresPermissions("system:record:list") + @RequiresPermissions("playlet:record:list") @PostMapping("/list") @ResponseBody public TableDataInfo list(PlayletUserWithdrawDepositRecord playletUserWithdrawDepositRecord) { startPage(); List list = playletUserWithdrawDepositRecordService.selectPlayletUserWithdrawDepositRecordList(playletUserWithdrawDepositRecord); + list.forEach(model->{ + PlayletUser user = playletUserService.getById(model.getUserId()); + if(user != null){ + model.setUserName(user.getNickName()); + } + }); return getDataTable(list); } /** * 导出用户交易记录列表 */ - @RequiresPermissions("system:record:export") + @RequiresPermissions("playlet:record:export") @Log(title = "用户交易记录", businessType = BusinessType.EXPORT) @PostMapping("/export") @ResponseBody @@ -76,7 +86,7 @@ public class PlayletUserWithdrawDepositRecordController extends BaseController { /** * 新增保存用户交易记录 */ - @RequiresPermissions("system:record:add") + @RequiresPermissions("playlet:record:add") @Log(title = "用户交易记录", businessType = BusinessType.INSERT) @PostMapping("/add") @ResponseBody @@ -87,7 +97,7 @@ public class PlayletUserWithdrawDepositRecordController extends BaseController { /** * 修改用户交易记录 */ - @RequiresPermissions("system:record:edit") + @RequiresPermissions("playlet:record:edit") @GetMapping("/edit/{id}") public String edit(@PathVariable("id") Long id, ModelMap mmap) { PlayletUserWithdrawDepositRecord playletUserWithdrawDepositRecord = playletUserWithdrawDepositRecordService.selectPlayletUserWithdrawDepositRecordById(id); @@ -98,7 +108,7 @@ public class PlayletUserWithdrawDepositRecordController extends BaseController { /** * 修改保存用户交易记录 */ - @RequiresPermissions("system:record:edit") + @RequiresPermissions("playlet:record:edit") @Log(title = "用户交易记录", businessType = BusinessType.UPDATE) @PostMapping("/edit") @ResponseBody @@ -109,7 +119,7 @@ public class PlayletUserWithdrawDepositRecordController extends BaseController { /** * 删除用户交易记录 */ - @RequiresPermissions("system:record:remove") + @RequiresPermissions("playlet:record:remove") @Log(title = "用户交易记录", businessType = BusinessType.DELETE) @PostMapping("/remove") @ResponseBody diff --git a/playlet-admin/src/main/java/com/playlet/web/service/app/PlayletUserAppService.java b/playlet-admin/src/main/java/com/playlet/web/service/app/PlayletUserAppService.java index 61b2a46..6566730 100644 --- a/playlet-admin/src/main/java/com/playlet/web/service/app/PlayletUserAppService.java +++ b/playlet-admin/src/main/java/com/playlet/web/service/app/PlayletUserAppService.java @@ -48,4 +48,6 @@ public interface PlayletUserAppService { PlayletUser addPlayletUser(PlayletUser playletUser) throws Exception; + void addLoginRecord(Long userId); + } diff --git a/playlet-admin/src/main/java/com/playlet/web/service/app/impl/PlayletUserAppServiceImpl.java b/playlet-admin/src/main/java/com/playlet/web/service/app/impl/PlayletUserAppServiceImpl.java index ac99334..6c66372 100644 --- a/playlet-admin/src/main/java/com/playlet/web/service/app/impl/PlayletUserAppServiceImpl.java +++ b/playlet-admin/src/main/java/com/playlet/web/service/app/impl/PlayletUserAppServiceImpl.java @@ -1,11 +1,15 @@ package com.playlet.web.service.app.impl; +import cn.hutool.core.date.DatePattern; +import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.ObjectUtil; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.playlet.common.constant.PlayletConstants; import com.playlet.common.constant.RedisConstants; import com.playlet.system.domain.PlayletUser; +import com.playlet.system.domain.PlayletUserLogin; +import com.playlet.system.service.IPlayletUserLoginService; import com.playlet.system.service.IPlayletUserService; import com.playlet.web.req.PlayUserReq; import com.playlet.web.service.app.PlayletUserAppService; @@ -16,6 +20,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.stereotype.Service; +import java.time.LocalDate; import java.util.Date; import java.util.List; @@ -28,6 +33,8 @@ public class PlayletUserAppServiceImpl implements PlayletUserAppService { private final StringRedisTemplate stringRedisTemplate; + private final IPlayletUserLoginService iPlayletUserLoginService; + @Override public PlayletUser addPlayletUser(PlayletUser playletUser) throws Exception{ @@ -66,7 +73,11 @@ public class PlayletUserAppServiceImpl implements PlayletUserAppService { @Override public PlayletUser onlyLoginByOpenid(String openid) { - return iPlayletUserService.lambdaQuery().eq(PlayletUser::getOpenId, openid).one(); + PlayletUser user = iPlayletUserService.lambdaQuery().eq(PlayletUser::getOpenId, openid).one(); + if(user != null){ + this.addLoginRecord(user.getId()); + } + return user; } @Override @@ -78,8 +89,10 @@ public class PlayletUserAppServiceImpl implements PlayletUserAppService { if(!alreadyCode.equals(playUserReq.getCode())){ throw new Exception("短信验证码错误!"); } - return iPlayletUserService.lambdaQuery() + PlayletUser user = iPlayletUserService.lambdaQuery() .eq(PlayletUser::getPhone, playUserReq.getPhone()).one(); + this.addLoginRecord(user.getId()); + return user; } @Override @@ -90,6 +103,7 @@ public class PlayletUserAppServiceImpl implements PlayletUserAppService { if(playletUser == null){ throw new Exception("账号或密码错误!"); }else { + this.addLoginRecord(playletUser.getId()); return playletUser; } } @@ -125,4 +139,23 @@ public class PlayletUserAppServiceImpl implements PlayletUserAppService { List list = iPlayletUserService.selectPlayletUserList(playletUser); return PageInfo.of(list); } + + @Override + public void addLoginRecord(Long userId) { + String nowDate = DateUtil.format(new Date(), DatePattern.NORM_DATE_PATTERN); + Date begin = DateUtil.parse(nowDate+" 00:00:00", DatePattern.NORM_DATETIME_PATTERN); + Date end = DateUtil.parse(nowDate+" 23:59:59", DatePattern.NORM_DATETIME_PATTERN); + long count = iPlayletUserLoginService.lambdaQuery() + .eq(PlayletUserLogin::getUserId, userId) + .between(PlayletUserLogin::getLoginTime, begin, end) + .count(); + if(count == 0){ + PlayletUserLogin login = new PlayletUserLogin(); + login.setUserId(userId); + login.setLoginTime(new Date()); + login.setCreateTime(new Date()); + login.setCreateBy("system"); + iPlayletUserLoginService.save(login); + } + } } diff --git a/playlet-admin/src/main/resources/templates/system/playlet/invoice/edit.html b/playlet-admin/src/main/resources/templates/system/playlet/invoice/edit.html new file mode 100644 index 0000000..494fd6c --- /dev/null +++ b/playlet-admin/src/main/resources/templates/system/playlet/invoice/edit.html @@ -0,0 +1,74 @@ + + + + + + +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/playlet-admin/src/main/resources/templates/system/playlet/invoice/invoice.html b/playlet-admin/src/main/resources/templates/system/playlet/invoice/invoice.html new file mode 100644 index 0000000..d11b6cc --- /dev/null +++ b/playlet-admin/src/main/resources/templates/system/playlet/invoice/invoice.html @@ -0,0 +1,139 @@ + + + + + + +
+
+
+
+
+
    +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • +  搜索 +  重置 +
  • +
+
+
+
+ + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/playlet-admin/src/main/resources/templates/system/playlet/item/add.html b/playlet-admin/src/main/resources/templates/system/playlet/item/add.html index 296afb1..a8ac865 100644 --- a/playlet-admin/src/main/resources/templates/system/playlet/item/add.html +++ b/playlet-admin/src/main/resources/templates/system/playlet/item/add.html @@ -21,6 +21,14 @@ +
+ +
+ +
+
diff --git a/playlet-admin/src/main/resources/templates/system/playlet/item/edit.html b/playlet-admin/src/main/resources/templates/system/playlet/item/edit.html index ccfd3de..a65278e 100644 --- a/playlet-admin/src/main/resources/templates/system/playlet/item/edit.html +++ b/playlet-admin/src/main/resources/templates/system/playlet/item/edit.html @@ -20,6 +20,14 @@
+
+ +
+ +
+
diff --git a/playlet-admin/src/main/resources/templates/system/playlet/login/login.html b/playlet-admin/src/main/resources/templates/system/playlet/login/login.html new file mode 100644 index 0000000..1514025 --- /dev/null +++ b/playlet-admin/src/main/resources/templates/system/playlet/login/login.html @@ -0,0 +1,94 @@ + + + + + + +
+
+
+
+
+ +
+
+
+ + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/playlet-admin/src/main/resources/templates/system/playlet/record/record.html b/playlet-admin/src/main/resources/templates/system/playlet/record/record.html new file mode 100644 index 0000000..93b5613 --- /dev/null +++ b/playlet-admin/src/main/resources/templates/system/playlet/record/record.html @@ -0,0 +1,127 @@ + + + + + + +
+
+
+
+
+ +
+
+
+ + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/playlet-admin/src/main/resources/templates/system/playlet/service/service.html b/playlet-admin/src/main/resources/templates/system/playlet/service/service.html index def0736..084f9dd 100644 --- a/playlet-admin/src/main/resources/templates/system/playlet/service/service.html +++ b/playlet-admin/src/main/resources/templates/system/playlet/service/service.html @@ -74,7 +74,11 @@ }, { field: 'status', - title: '启用状态' + title: '启用状态', + align: 'center', + formatter: function (value, row, index) { + return statusTools(row); + } }, { field: 'createBy', @@ -109,6 +113,30 @@ }; $.table.init(options); }); + + /* 用户状态显示 */ + function statusTools(row) { + if (row.status === '02') { + return ' '; + } else { + return ' '; + } + } + + /* 用户管理-停用 */ + function disable(userId) { + $.modal.confirm("确认要停用客服吗?", function() { + $.operate.post(prefix + "/changeStatus", { "id": userId, "status": '02' }); + }) + } + + /* 用户管理启用 */ + function enable(userId) { + $.modal.confirm("确认要启用客服吗?", function() { + $.operate.post(prefix + "/changeStatus", { "id": userId, "status": '01' }); + }) + } + \ No newline at end of file diff --git a/playlet-admin/src/main/resources/templates/system/playlet/task/add.html b/playlet-admin/src/main/resources/templates/system/playlet/task/add.html new file mode 100644 index 0000000..1e2c567 --- /dev/null +++ b/playlet-admin/src/main/resources/templates/system/playlet/task/add.html @@ -0,0 +1,103 @@ + + + + + + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/playlet-admin/src/main/resources/templates/system/playlet/task/edit.html b/playlet-admin/src/main/resources/templates/system/playlet/task/edit.html new file mode 100644 index 0000000..10bc036 --- /dev/null +++ b/playlet-admin/src/main/resources/templates/system/playlet/task/edit.html @@ -0,0 +1,98 @@ + + + + + + +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/playlet-admin/src/main/resources/templates/system/playlet/task/task.html b/playlet-admin/src/main/resources/templates/system/playlet/task/task.html new file mode 100644 index 0000000..0590359 --- /dev/null +++ b/playlet-admin/src/main/resources/templates/system/playlet/task/task.html @@ -0,0 +1,134 @@ + + + + + + +
+
+
+
+
+ +
+
+
+ + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/playlet-admin/src/main/resources/templates/system/playlet/user/placeUser.html b/playlet-admin/src/main/resources/templates/system/playlet/user/placeUser.html new file mode 100644 index 0000000..6e9d38e --- /dev/null +++ b/playlet-admin/src/main/resources/templates/system/playlet/user/placeUser.html @@ -0,0 +1,96 @@ + + + + + + +
+
+
+
+
+
    +
  • + +
  • + + + + +
+
+
+
+ +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/playlet-admin/src/main/resources/templates/system/playlet/user/user.html b/playlet-admin/src/main/resources/templates/system/playlet/user/user.html index 38ea004..30f8a4d 100644 --- a/playlet-admin/src/main/resources/templates/system/playlet/user/user.html +++ b/playlet-admin/src/main/resources/templates/system/playlet/user/user.html @@ -18,6 +18,12 @@ +
  • + + + - + +
  •  搜索  重置 @@ -130,6 +136,7 @@ align: 'center', formatter: function(value, row, index) { var actions = []; + actions.push('邀请列表 '); actions.push('编辑 '); actions.push('删除'); return actions.join(''); @@ -138,6 +145,12 @@ }; $.table.init(options); }); + + function placeUser(code) { + var url = prefix + "/placeUser/" + code; + $.modal.open("邀请列表", url); + } + \ No newline at end of file diff --git a/playlet-admin/src/main/resources/templates/system/playlet/userAccount/userAccount.html b/playlet-admin/src/main/resources/templates/system/playlet/userAccount/userAccount.html new file mode 100644 index 0000000..ff4a62d --- /dev/null +++ b/playlet-admin/src/main/resources/templates/system/playlet/userAccount/userAccount.html @@ -0,0 +1,140 @@ + + + + + + +
    +
    +
    +
    +
    +
      +
    • + + +
    • +
    • + + +
    • +
    • + + +
    • +
    • + + +
    • +
    • + + +
    • +
    • + + +
    • +
    • + + +
    • +
    • +  搜索 +  重置 +
    • +
    +
    +
    +
    + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/playlet-common/src/main/java/com/playlet/common/core/domain/BaseEntity.java b/playlet-common/src/main/java/com/playlet/common/core/domain/BaseEntity.java index e0b75ca..980119a 100644 --- a/playlet-common/src/main/java/com/playlet/common/core/domain/BaseEntity.java +++ b/playlet-common/src/main/java/com/playlet/common/core/domain/BaseEntity.java @@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.annotation.TableField; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; +import com.playlet.common.annotation.Excel; import lombok.Data; /** @@ -32,6 +33,7 @@ public class BaseEntity implements Serializable /** 创建时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd") private Date createTime; /** 更新者 */ diff --git a/playlet-system/src/main/java/com/playlet/system/domain/PlayletRevenueRecord.java b/playlet-system/src/main/java/com/playlet/system/domain/PlayletRevenueRecord.java index 9f83e32..7c2b883 100644 --- a/playlet-system/src/main/java/com/playlet/system/domain/PlayletRevenueRecord.java +++ b/playlet-system/src/main/java/com/playlet/system/domain/PlayletRevenueRecord.java @@ -45,11 +45,11 @@ public class PlayletRevenueRecord extends BaseEntity { * 剧场id */ @Excel(name = "短剧id") - @ApiModelProperty(value = "短剧id") + @ApiModelProperty(value = "短剧id", required = true) private Long playletItemId; @TableField(exist = false) - @ApiModelProperty(value = "短剧名称") + @ApiModelProperty(value = "短剧名称", required = true) private String playletItemName; @TableField(exist = false) @@ -57,49 +57,49 @@ public class PlayletRevenueRecord extends BaseEntity { private String playletItemImgUrl; @TableField(exist = false) - @ApiModelProperty(value = "短场名称") + @ApiModelProperty(value = "短场名称", required = true) private String playletItemTypeName; /** * 任务Id */ @Excel(name = "任务id") - @ApiModelProperty(value = "任务id") + @ApiModelProperty(value = "任务id", required = true) private Long taskId; /** * 用户id */ @Excel(name = "用户id") - @ApiModelProperty(value = "用户id") + @ApiModelProperty(value = "用户id", required = true) private Long userId; /** * 来源平台 1 抖音 2 快手 3 视频号 */ @Excel(name = "来源平台 1 抖音 2 快手 3 视频号") - @ApiModelProperty(value = "来源平台 1 抖音 2 快手 3 视频号") + @ApiModelProperty(value = "来源平台 1 抖音 2 快手 3 视频号", required = true) private Long sourcePlatform; /** * 收益类型 1 充值收益 2 广告收益 */ @Excel(name = "收益类型 1 充值收益 2 广告收益") - @ApiModelProperty(value = "收益类型 1 充值收益 2 广告收益") + @ApiModelProperty(value = "收益类型 1 充值收益 2 广告收益", required = true) private Long earningsType; /** * 点击次数 */ @Excel(name = "点击次数") - @ApiModelProperty(value = "点击次数") + @ApiModelProperty(value = "点击次数", required = true) private Long clicksNumber; /** * 点击人数 */ @Excel(name = "点击人数") - @ApiModelProperty(value = "点击人数") + @ApiModelProperty(value = "点击人数", required = true) private Long clicksNumberPeople; /** @@ -113,29 +113,29 @@ public class PlayletRevenueRecord extends BaseEntity { * 预估收益(后台转换,保留分 直接*100 例如1块钱 在这里应表示100) */ @Excel(name = "预估收益(后台转换,保留分 直接*100 例如1块钱 在这里应表示100)") - @ApiModelProperty(value = "预估收益(后台转换,保留分 直接*100 例如1块钱 在这里应表示100)") + @ApiModelProperty(value = "预估收益(后台转换,保留分 直接*100 例如1块钱 在这里应表示100)", required = true) private Long estimateEarnings; /** * 实际收益(后台转换,保留分 直接*100 例如1块钱 在这里应表示100) */ @Excel(name = "实际收益(后台转换,保留分 直接*100 例如1块钱 在这里应表示100)") - @ApiModelProperty(value = "实际收益(后台转换,保留分 直接*100 例如1块钱 在这里应表示100)") + @ApiModelProperty(value = "实际收益(后台转换,保留分 直接*100 例如1块钱 在这里应表示100)", required = true) private Long practicalEarnings; /** * 推送收益时间(此处为外部平台推入 建议使用时间戳后续数据转换。) */ @Excel(name = "推送收益时间(此处为外部平台推入 建议使用时间戳后续数据转换。)") - @ApiModelProperty(value = "推送收益时间(此处为外部平台推入 建议使用时间戳后续数据转换。) 时间戳") + @ApiModelProperty(value = "推送收益时间(此处为外部平台推入 建议使用时间戳后续数据转换。) 时间戳", required = true) private Date pushTime; - @ApiModelProperty(value = "到账状态, 01.待到账, 02.已到账") + @ApiModelProperty(value = "到账状态, 01.待到账, 02.已到账", required = true) private String drawStatus; /** 剧场类型 */ @Excel(name = "剧场类型") - @ApiModelProperty(value = "剧场类型") + @ApiModelProperty(value = "剧场类型", required = true) private Integer itemType; @TableField(exist = false) diff --git a/playlet-system/src/main/java/com/playlet/system/domain/PlayletUser.java b/playlet-system/src/main/java/com/playlet/system/domain/PlayletUser.java index a42fcfb..dfc813f 100644 --- a/playlet-system/src/main/java/com/playlet/system/domain/PlayletUser.java +++ b/playlet-system/src/main/java/com/playlet/system/domain/PlayletUser.java @@ -65,6 +65,7 @@ public class PlayletUser extends BaseEntity private String parentId; @ApiModelProperty(value = "用户状态 01.待审核, 02.审核通过 03.审核拒绝") + @Excel(name = "用户状态 01.未加入, 02.加入") private String status; } diff --git a/playlet-system/src/main/java/com/playlet/system/domain/PlayletUserInvoice.java b/playlet-system/src/main/java/com/playlet/system/domain/PlayletUserInvoice.java index d8e9b7d..297df01 100644 --- a/playlet-system/src/main/java/com/playlet/system/domain/PlayletUserInvoice.java +++ b/playlet-system/src/main/java/com/playlet/system/domain/PlayletUserInvoice.java @@ -1,6 +1,7 @@ package com.playlet.system.domain; import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.playlet.common.core.domain.BaseEntity; import com.baomidou.mybatisplus.annotation.TableName; @@ -61,4 +62,7 @@ public class PlayletUserInvoice extends BaseEntity @Excel(name = "用户id") private String userId; + @TableField(exist = false) + private String userName; + } diff --git a/playlet-system/src/main/java/com/playlet/system/domain/PlayletUserLogin.java b/playlet-system/src/main/java/com/playlet/system/domain/PlayletUserLogin.java new file mode 100644 index 0000000..4832d4f --- /dev/null +++ b/playlet-system/src/main/java/com/playlet/system/domain/PlayletUserLogin.java @@ -0,0 +1,42 @@ +package com.playlet.system.domain; + +import java.util.Date; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.playlet.common.core.domain.BaseEntity; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; +import com.playlet.common.annotation.Excel; + +/** + * 用户登录记录对象 playlet_user_login + * + * @author ruoyi + * @date 2024-05-05 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName(value = "playlet_user_login") +public class PlayletUserLogin extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键id */ + private Long id; + + /** 用户id */ + @Excel(name = "用户id") + private Long userId; + + @TableField(exist = false) + @Excel(name = "用户昵称") + private String userName; + + /** 登录时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "登录时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date loginTime; + +} diff --git a/playlet-system/src/main/java/com/playlet/system/domain/PlayletUserWithdrawDepositRecord.java b/playlet-system/src/main/java/com/playlet/system/domain/PlayletUserWithdrawDepositRecord.java index 804d994..d401f9a 100644 --- a/playlet-system/src/main/java/com/playlet/system/domain/PlayletUserWithdrawDepositRecord.java +++ b/playlet-system/src/main/java/com/playlet/system/domain/PlayletUserWithdrawDepositRecord.java @@ -1,6 +1,7 @@ package com.playlet.system.domain; import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.playlet.common.core.domain.BaseEntity; import com.baomidou.mybatisplus.annotation.TableName; @@ -36,6 +37,9 @@ public class PlayletUserWithdrawDepositRecord extends BaseEntity { @Excel(name = "用户id") private String userId; + @TableField(exist = false) + private String userName; + /** * 提现订单号,系统自动生成,uuid */ diff --git a/playlet-system/src/main/java/com/playlet/system/mapper/PlayletUserLoginMapper.java b/playlet-system/src/main/java/com/playlet/system/mapper/PlayletUserLoginMapper.java new file mode 100644 index 0000000..1a46eeb --- /dev/null +++ b/playlet-system/src/main/java/com/playlet/system/mapper/PlayletUserLoginMapper.java @@ -0,0 +1,62 @@ +package com.playlet.system.mapper; + +import java.util.List; +import com.playlet.system.domain.PlayletUserLogin; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * 用户登录记录Mapper接口 + * + * @author ruoyi + * @date 2024-05-05 + */ +public interface PlayletUserLoginMapper extends BaseMapper +{ + /** + * 查询用户登录记录 + * + * @param id 用户登录记录主键 + * @return 用户登录记录 + */ + public PlayletUserLogin selectPlayletUserLoginById(Long id); + + /** + * 查询用户登录记录列表 + * + * @param playletUserLogin 用户登录记录 + * @return 用户登录记录集合 + */ + public List selectPlayletUserLoginList(PlayletUserLogin playletUserLogin); + + /** + * 新增用户登录记录 + * + * @param playletUserLogin 用户登录记录 + * @return 结果 + */ + public int insertPlayletUserLogin(PlayletUserLogin playletUserLogin); + + /** + * 修改用户登录记录 + * + * @param playletUserLogin 用户登录记录 + * @return 结果 + */ + public int updatePlayletUserLogin(PlayletUserLogin playletUserLogin); + + /** + * 删除用户登录记录 + * + * @param id 用户登录记录主键 + * @return 结果 + */ + public int deletePlayletUserLoginById(Long id); + + /** + * 批量删除用户登录记录 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deletePlayletUserLoginByIds(String[] ids); +} diff --git a/playlet-system/src/main/java/com/playlet/system/service/IPlayletUserLoginService.java b/playlet-system/src/main/java/com/playlet/system/service/IPlayletUserLoginService.java new file mode 100644 index 0000000..a505c07 --- /dev/null +++ b/playlet-system/src/main/java/com/playlet/system/service/IPlayletUserLoginService.java @@ -0,0 +1,62 @@ +package com.playlet.system.service; + +import java.util.List; +import com.playlet.system.domain.PlayletUserLogin; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * 用户登录记录Service接口 + * + * @author ruoyi + * @date 2024-05-05 + */ +public interface IPlayletUserLoginService extends IService +{ + /** + * 查询用户登录记录 + * + * @param id 用户登录记录主键 + * @return 用户登录记录 + */ + public PlayletUserLogin selectPlayletUserLoginById(Long id); + + /** + * 查询用户登录记录列表 + * + * @param playletUserLogin 用户登录记录 + * @return 用户登录记录集合 + */ + public List selectPlayletUserLoginList(PlayletUserLogin playletUserLogin); + + /** + * 新增用户登录记录 + * + * @param playletUserLogin 用户登录记录 + * @return 结果 + */ + public int insertPlayletUserLogin(PlayletUserLogin playletUserLogin); + + /** + * 修改用户登录记录 + * + * @param playletUserLogin 用户登录记录 + * @return 结果 + */ + public int updatePlayletUserLogin(PlayletUserLogin playletUserLogin); + + /** + * 批量删除用户登录记录 + * + * @param ids 需要删除的用户登录记录主键集合 + * @return 结果 + */ + public int deletePlayletUserLoginByIds(String ids); + + /** + * 删除用户登录记录信息 + * + * @param id 用户登录记录主键 + * @return 结果 + */ + public int deletePlayletUserLoginById(Long id); +} diff --git a/playlet-system/src/main/java/com/playlet/system/service/impl/PlayletUserLoginServiceImpl.java b/playlet-system/src/main/java/com/playlet/system/service/impl/PlayletUserLoginServiceImpl.java new file mode 100644 index 0000000..409f9b6 --- /dev/null +++ b/playlet-system/src/main/java/com/playlet/system/service/impl/PlayletUserLoginServiceImpl.java @@ -0,0 +1,98 @@ +package com.playlet.system.service.impl; + +import java.util.List; +import com.playlet.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.playlet.system.mapper.PlayletUserLoginMapper; +import com.playlet.system.domain.PlayletUserLogin; +import com.playlet.system.service.IPlayletUserLoginService; +import com.playlet.common.core.text.Convert; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * 用户登录记录Service业务层处理 + * + * @author ruoyi + * @date 2024-05-05 + */ +@Service +public class PlayletUserLoginServiceImpl extends ServiceImpl implements IPlayletUserLoginService +{ + @Autowired + private PlayletUserLoginMapper playletUserLoginMapper; + + /** + * 查询用户登录记录 + * + * @param id 用户登录记录主键 + * @return 用户登录记录 + */ + @Override + public PlayletUserLogin selectPlayletUserLoginById(Long id) + { + return playletUserLoginMapper.selectPlayletUserLoginById(id); + } + + /** + * 查询用户登录记录列表 + * + * @param playletUserLogin 用户登录记录 + * @return 用户登录记录 + */ + @Override + public List selectPlayletUserLoginList(PlayletUserLogin playletUserLogin) + { + return playletUserLoginMapper.selectPlayletUserLoginList(playletUserLogin); + } + + /** + * 新增用户登录记录 + * + * @param playletUserLogin 用户登录记录 + * @return 结果 + */ + @Override + public int insertPlayletUserLogin(PlayletUserLogin playletUserLogin) + { + playletUserLogin.setCreateTime(DateUtils.getNowDate()); + return playletUserLoginMapper.insertPlayletUserLogin(playletUserLogin); + } + + /** + * 修改用户登录记录 + * + * @param playletUserLogin 用户登录记录 + * @return 结果 + */ + @Override + public int updatePlayletUserLogin(PlayletUserLogin playletUserLogin) + { + playletUserLogin.setUpdateTime(DateUtils.getNowDate()); + return playletUserLoginMapper.updatePlayletUserLogin(playletUserLogin); + } + + /** + * 批量删除用户登录记录 + * + * @param ids 需要删除的用户登录记录主键 + * @return 结果 + */ + @Override + public int deletePlayletUserLoginByIds(String ids) + { + return playletUserLoginMapper.deletePlayletUserLoginByIds(Convert.toStrArray(ids)); + } + + /** + * 删除用户登录记录信息 + * + * @param id 用户登录记录主键 + * @return 结果 + */ + @Override + public int deletePlayletUserLoginById(Long id) + { + return playletUserLoginMapper.deletePlayletUserLoginById(id); + } +} diff --git a/playlet-system/src/main/resources/mapper/system/PlayletUserLoginMapper.xml b/playlet-system/src/main/resources/mapper/system/PlayletUserLoginMapper.xml new file mode 100644 index 0000000..b2d311c --- /dev/null +++ b/playlet-system/src/main/resources/mapper/system/PlayletUserLoginMapper.xml @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + select id, user_id, login_time, create_by, create_time, update_by, update_time, remark from playlet_user_login + + + + + + + + insert into playlet_user_login + + user_id, + login_time, + create_by, + create_time, + update_by, + update_time, + remark, + + + #{userId}, + #{loginTime}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{remark}, + + + + + update playlet_user_login + + user_id = #{userId}, + login_time = #{loginTime}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + + where id = #{id} + + + + delete from playlet_user_login where id = #{id} + + + + delete from playlet_user_login where id in + + #{id} + + + + \ No newline at end of file diff --git a/playlet-system/src/main/resources/mapper/system/PlayletUserMapper.xml b/playlet-system/src/main/resources/mapper/system/PlayletUserMapper.xml index 8699409..73749a3 100644 --- a/playlet-system/src/main/resources/mapper/system/PlayletUserMapper.xml +++ b/playlet-system/src/main/resources/mapper/system/PlayletUserMapper.xml @@ -35,9 +35,13 @@ and agency_id = #{agencyId} and parent_id = #{parentId} and create_by = #{createBy} - and create_time = #{createTime} + + AND date_format(create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d') + + + AND date_format(create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d') + and update_by = #{updateBy} - and update_time = #{updateTime} and remark = #{remark}