From 0130d1715dcfc2313efb72b1317ab2943c2ca207 Mon Sep 17 00:00:00 2001 From: wu Date: Fri, 24 Nov 2023 13:20:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A5=E5=8F=A3,=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-admin/pom.xml | 30 +- .../main/java/com/ruoyi/RuoYiApplication.java | 11 +- .../com/ruoyi/RuoYiServletInitializer.java | 8 +- .../system/controller/BNetController.java | 69 ++-- .../controller/BNetHistoryController.java | 54 ++-- .../system/controller/BPosterController.java | 70 ++-- .../controller/BPosterHistoryController.java | 54 ++-- .../system/controller/BShanghuController.java | 54 ++-- .../java/com/ruoyi/system/domain/BNet.java | 102 +++--- .../com/ruoyi/system/domain/BNetHistory.java | 123 +++---- .../ruoyi/system/domain/BPosterHistory.java | 140 ++++---- .../com/ruoyi/system/domain/BShanghu.java | 131 ++++---- .../domain/dto/request/PosterRequest.java | 46 +++ .../com/ruoyi/system/mapper/BNetMapper.java | 49 ++- .../ruoyi/system/mapper/BShanghuMapper.java | 50 ++- .../ruoyi/system/service/IBNetService.java | 47 ++- .../ruoyi/system/service/IBPosterService.java | 40 ++- .../system/service/IBShanghuService.java | 51 ++- .../system/service/impl/BNetServiceImpl.java | 77 +++-- .../service/impl/BPosterServiceImpl.java | 79 +++-- .../service/impl/BShanghuServiceImpl.java | 104 ++++-- .../controller/common/CommonController.java | 88 ++---- .../controller/system/SysUserController.java | 131 ++++---- .../resources/mapper/netEwm/BNetMapper.xml | 16 +- .../mapper/netEwm/BShanghuMapper.xml | 19 ++ .../common/core/domain/entity/SysUser.java | 299 +++++++++--------- 26 files changed, 1119 insertions(+), 823 deletions(-) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/system/domain/dto/request/PosterRequest.java diff --git a/ruoyi-admin/pom.xml b/ruoyi-admin/pom.xml index 1436d6d..9216d98 100644 --- a/ruoyi-admin/pom.xml +++ b/ruoyi-admin/pom.xml @@ -17,6 +17,22 @@ + + + org.projectlombok + lombok + 1.18.30 + provided + + + + + + cn.hutool + hutool-all + 5.8.23 + + org.springframework.boot @@ -37,7 +53,7 @@ 1.6.2 - + mysql mysql-connector-java @@ -80,15 +96,15 @@ - - org.apache.maven.plugins - maven-war-plugin - 3.1.0 + + org.apache.maven.plugins + maven-war-plugin + 3.1.0 false ${project.artifactId} - - + + ${project.artifactId} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java b/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java index 32eb6f1..9ef589c 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java @@ -6,15 +6,12 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; /** * 启动程序 - * + * * @author ruoyi */ -@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class }) -public class RuoYiApplication -{ - public static void main(String[] args) - { - // System.setProperty("spring.devtools.restart.enabled", "false"); +@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}) +public class RuoYiApplication { + public static void main(String[] args) { SpringApplication.run(RuoYiApplication.class, args); System.out.println("(♥◠‿◠)ノ゙ 若依启动成功 ლ(´ڡ`ლ)゙ \n" + " .-------. ____ __ \n" + diff --git a/ruoyi-admin/src/main/java/com/ruoyi/RuoYiServletInitializer.java b/ruoyi-admin/src/main/java/com/ruoyi/RuoYiServletInitializer.java index 6de67dc..70cb1b3 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/RuoYiServletInitializer.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/RuoYiServletInitializer.java @@ -5,14 +5,12 @@ import org.springframework.boot.web.servlet.support.SpringBootServletInitializer /** * web容器中进行部署 - * + * * @author ruoyi */ -public class RuoYiServletInitializer extends SpringBootServletInitializer -{ +public class RuoYiServletInitializer extends SpringBootServletInitializer { @Override - protected SpringApplicationBuilder configure(SpringApplicationBuilder application) - { + protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { return application.sources(RuoYiApplication.class); } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BNetController.java b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BNetController.java index 616051e..70e6cbc 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BNetController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BNetController.java @@ -1,37 +1,38 @@ package com.ruoyi.system.controller; -import java.util.List; -import javax.servlet.http.HttpServletResponse; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.system.domain.BNet; +import com.ruoyi.system.service.IBNetService; +import io.swagger.annotations.ApiOperation; import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.DeleteMapping; 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.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.BNet; -import com.ruoyi.system.service.IBNetService; -import com.ruoyi.common.utils.poi.ExcelUtil; -import com.ruoyi.common.core.page.TableDataInfo; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import java.util.List; /** * 网络Controller - * + * * @author ruoyi * @date 2023-11-21 */ @RestController @RequestMapping("/netEwm/net") -public class BNetController extends BaseController -{ - @Autowired +public class BNetController extends BaseController { + @Resource private IBNetService bNetService; /** @@ -39,21 +40,33 @@ public class BNetController extends BaseController */ @PreAuthorize("@ss.hasPermi('netEwm:net:list')") @GetMapping("/list") - public TableDataInfo list(BNet bNet) - { + public TableDataInfo list(BNet bNet) { startPage(); List list = bNetService.selectBNetList(bNet); return getDataTable(list); } + /** + * 根据商户id查询wifi(提供二维码接口) + * + * @param id 商户id + * @return 响应类 + */ + @ApiOperation(value = "根据商户id查询wifi(提供二维码接口)", response = BNet.class) + @GetMapping("/findById/{id}") + public AjaxResult findById(@PathVariable Long id) { + + return success(bNetService.findById(id)); + } + + /** * 导出网络列表 */ @PreAuthorize("@ss.hasPermi('netEwm:net:export')") @Log(title = "网络", businessType = BusinessType.EXPORT) @PostMapping("/export") - public void export(HttpServletResponse response, BNet bNet) - { + public void export(HttpServletResponse response, BNet bNet) { List list = bNetService.selectBNetList(bNet); ExcelUtil util = new ExcelUtil(BNet.class); util.exportExcel(response, list, "网络数据"); @@ -64,8 +77,7 @@ public class BNetController extends BaseController */ @PreAuthorize("@ss.hasPermi('netEwm:net:query')") @GetMapping(value = "/{id}") - public AjaxResult getInfo(@PathVariable("id") Long id) - { + public AjaxResult getInfo(@PathVariable("id") Long id) { return success(bNetService.selectBNetById(id)); } @@ -75,8 +87,7 @@ public class BNetController extends BaseController @PreAuthorize("@ss.hasPermi('netEwm:net:add')") @Log(title = "网络", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@RequestBody BNet bNet) - { + public AjaxResult add(@RequestBody BNet bNet) { return toAjax(bNetService.insertBNet(bNet)); } @@ -86,8 +97,7 @@ public class BNetController extends BaseController @PreAuthorize("@ss.hasPermi('netEwm:net:edit')") @Log(title = "网络", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@RequestBody BNet bNet) - { + public AjaxResult edit(@RequestBody BNet bNet) { return toAjax(bNetService.updateBNet(bNet)); } @@ -96,9 +106,8 @@ public class BNetController extends BaseController */ @PreAuthorize("@ss.hasPermi('netEwm:net:remove')") @Log(title = "网络", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public AjaxResult remove(@PathVariable Long[] ids) - { + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(bNetService.deleteBNetByIds(ids)); } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BNetHistoryController.java b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BNetHistoryController.java index f92a8ff..506c932 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BNetHistoryController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BNetHistoryController.java @@ -1,37 +1,37 @@ package com.ruoyi.system.controller; -import java.util.List; -import javax.servlet.http.HttpServletResponse; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.system.domain.BNetHistory; +import com.ruoyi.system.service.IBNetHistoryService; import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.DeleteMapping; 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.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.BNetHistory; -import com.ruoyi.system.service.IBNetHistoryService; -import com.ruoyi.common.utils.poi.ExcelUtil; -import com.ruoyi.common.core.page.TableDataInfo; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import java.util.List; /** * 连网历史Controller - * + * * @author ruoyi * @date 2023-11-21 */ @RestController @RequestMapping("/netEwm/netHistory") -public class BNetHistoryController extends BaseController -{ - @Autowired +public class BNetHistoryController extends BaseController { + @Resource private IBNetHistoryService bNetHistoryService; /** @@ -39,8 +39,7 @@ public class BNetHistoryController extends BaseController */ @PreAuthorize("@ss.hasPermi('netEwm:netHistory:list')") @GetMapping("/list") - public TableDataInfo list(BNetHistory bNetHistory) - { + public TableDataInfo list(BNetHistory bNetHistory) { startPage(); List list = bNetHistoryService.selectBNetHistoryList(bNetHistory); return getDataTable(list); @@ -52,8 +51,7 @@ public class BNetHistoryController extends BaseController @PreAuthorize("@ss.hasPermi('netEwm:netHistory:export')") @Log(title = "连网历史", businessType = BusinessType.EXPORT) @PostMapping("/export") - public void export(HttpServletResponse response, BNetHistory bNetHistory) - { + public void export(HttpServletResponse response, BNetHistory bNetHistory) { List list = bNetHistoryService.selectBNetHistoryList(bNetHistory); ExcelUtil util = new ExcelUtil(BNetHistory.class); util.exportExcel(response, list, "连网历史数据"); @@ -64,8 +62,7 @@ public class BNetHistoryController extends BaseController */ @PreAuthorize("@ss.hasPermi('netEwm:netHistory:query')") @GetMapping(value = "/{id}") - public AjaxResult getInfo(@PathVariable("id") Long id) - { + public AjaxResult getInfo(@PathVariable("id") Long id) { return success(bNetHistoryService.selectBNetHistoryById(id)); } @@ -75,8 +72,7 @@ public class BNetHistoryController extends BaseController @PreAuthorize("@ss.hasPermi('netEwm:netHistory:add')") @Log(title = "连网历史", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@RequestBody BNetHistory bNetHistory) - { + public AjaxResult add(@RequestBody BNetHistory bNetHistory) { return toAjax(bNetHistoryService.insertBNetHistory(bNetHistory)); } @@ -86,8 +82,7 @@ public class BNetHistoryController extends BaseController @PreAuthorize("@ss.hasPermi('netEwm:netHistory:edit')") @Log(title = "连网历史", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@RequestBody BNetHistory bNetHistory) - { + public AjaxResult edit(@RequestBody BNetHistory bNetHistory) { return toAjax(bNetHistoryService.updateBNetHistory(bNetHistory)); } @@ -96,9 +91,8 @@ public class BNetHistoryController extends BaseController */ @PreAuthorize("@ss.hasPermi('netEwm:netHistory:remove')") @Log(title = "连网历史", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public AjaxResult remove(@PathVariable Long[] ids) - { + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(bNetHistoryService.deleteBNetHistoryByIds(ids)); } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BPosterController.java b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BPosterController.java index 5d1575d..0f07c62 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BPosterController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BPosterController.java @@ -1,37 +1,40 @@ package com.ruoyi.system.controller; -import java.util.List; -import javax.servlet.http.HttpServletResponse; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.system.domain.BPoster; +import com.ruoyi.system.domain.dto.request.PosterRequest; +import com.ruoyi.system.service.IBPosterService; +import io.swagger.annotations.ApiOperation; import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.DeleteMapping; 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.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.BPoster; -import com.ruoyi.system.service.IBPosterService; -import com.ruoyi.common.utils.poi.ExcelUtil; -import com.ruoyi.common.core.page.TableDataInfo; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; +import java.util.List; /** * 广告Controller - * + * * @author ruoyi * @date 2023-11-21 */ @RestController @RequestMapping("/netEwm/poster") -public class BPosterController extends BaseController -{ - @Autowired +public class BPosterController extends BaseController { + @Resource private IBPosterService bPosterService; /** @@ -39,8 +42,7 @@ public class BPosterController extends BaseController */ @PreAuthorize("@ss.hasPermi('netEwm:poster:list')") @GetMapping("/list") - public TableDataInfo list(BPoster bPoster) - { + public TableDataInfo list(BPoster bPoster) { startPage(); List list = bPosterService.selectBPosterList(bPoster); return getDataTable(list); @@ -52,8 +54,7 @@ public class BPosterController extends BaseController @PreAuthorize("@ss.hasPermi('netEwm:poster:export')") @Log(title = "广告", businessType = BusinessType.EXPORT) @PostMapping("/export") - public void export(HttpServletResponse response, BPoster bPoster) - { + public void export(HttpServletResponse response, BPoster bPoster) { List list = bPosterService.selectBPosterList(bPoster); ExcelUtil util = new ExcelUtil(BPoster.class); util.exportExcel(response, list, "广告数据"); @@ -64,8 +65,7 @@ public class BPosterController extends BaseController */ @PreAuthorize("@ss.hasPermi('netEwm:poster:query')") @GetMapping(value = "/{id}") - public AjaxResult getInfo(@PathVariable("id") Long id) - { + public AjaxResult getInfo(@PathVariable("id") Long id) { return success(bPosterService.selectBPosterById(id)); } @@ -75,19 +75,30 @@ public class BPosterController extends BaseController @PreAuthorize("@ss.hasPermi('netEwm:poster:add')") @Log(title = "广告", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@RequestBody BPoster bPoster) - { + public AjaxResult add(@RequestBody BPoster bPoster) { return toAjax(bPosterService.insertBPoster(bPoster)); } + /** + * 广告批量分配商户 + * + * @param req 请求类 + * @return 响应类 + */ + @PostMapping("batchAllocation") + @ApiOperation("广告批量分配商户") + public AjaxResult batchAllocation(@Valid @RequestBody PosterRequest req) { + bPosterService.batchAllocation(req); + return success(); + } + /** * 修改广告 */ @PreAuthorize("@ss.hasPermi('netEwm:poster:edit')") @Log(title = "广告", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@RequestBody BPoster bPoster) - { + public AjaxResult edit(@RequestBody BPoster bPoster) { return toAjax(bPosterService.updateBPoster(bPoster)); } @@ -96,9 +107,8 @@ public class BPosterController extends BaseController */ @PreAuthorize("@ss.hasPermi('netEwm:poster:remove')") @Log(title = "广告", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public AjaxResult remove(@PathVariable Long[] ids) - { + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(bPosterService.deleteBPosterByIds(ids)); } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BPosterHistoryController.java b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BPosterHistoryController.java index ad8c22a..b1e0a6d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BPosterHistoryController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BPosterHistoryController.java @@ -1,37 +1,37 @@ package com.ruoyi.system.controller; -import java.util.List; -import javax.servlet.http.HttpServletResponse; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.system.domain.BPosterHistory; +import com.ruoyi.system.service.IBPosterHistoryService; import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.DeleteMapping; 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.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.BPosterHistory; -import com.ruoyi.system.service.IBPosterHistoryService; -import com.ruoyi.common.utils.poi.ExcelUtil; -import com.ruoyi.common.core.page.TableDataInfo; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import java.util.List; /** * 广告历史Controller - * + * * @author ruoyi * @date 2023-11-21 */ @RestController @RequestMapping("/netEwm/posterHistory") -public class BPosterHistoryController extends BaseController -{ - @Autowired +public class BPosterHistoryController extends BaseController { + @Resource private IBPosterHistoryService bPosterHistoryService; /** @@ -39,8 +39,7 @@ public class BPosterHistoryController extends BaseController */ @PreAuthorize("@ss.hasPermi('netEwm:posterHistory:list')") @GetMapping("/list") - public TableDataInfo list(BPosterHistory bPosterHistory) - { + public TableDataInfo list(BPosterHistory bPosterHistory) { startPage(); List list = bPosterHistoryService.selectBPosterHistoryList(bPosterHistory); return getDataTable(list); @@ -52,8 +51,7 @@ public class BPosterHistoryController extends BaseController @PreAuthorize("@ss.hasPermi('netEwm:posterHistory:export')") @Log(title = "广告历史", businessType = BusinessType.EXPORT) @PostMapping("/export") - public void export(HttpServletResponse response, BPosterHistory bPosterHistory) - { + public void export(HttpServletResponse response, BPosterHistory bPosterHistory) { List list = bPosterHistoryService.selectBPosterHistoryList(bPosterHistory); ExcelUtil util = new ExcelUtil(BPosterHistory.class); util.exportExcel(response, list, "广告历史数据"); @@ -64,8 +62,7 @@ public class BPosterHistoryController extends BaseController */ @PreAuthorize("@ss.hasPermi('netEwm:posterHistory:query')") @GetMapping(value = "/{id}") - public AjaxResult getInfo(@PathVariable("id") Long id) - { + public AjaxResult getInfo(@PathVariable("id") Long id) { return success(bPosterHistoryService.selectBPosterHistoryById(id)); } @@ -75,8 +72,7 @@ public class BPosterHistoryController extends BaseController @PreAuthorize("@ss.hasPermi('netEwm:posterHistory:add')") @Log(title = "广告历史", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@RequestBody BPosterHistory bPosterHistory) - { + public AjaxResult add(@RequestBody BPosterHistory bPosterHistory) { return toAjax(bPosterHistoryService.insertBPosterHistory(bPosterHistory)); } @@ -86,8 +82,7 @@ public class BPosterHistoryController extends BaseController @PreAuthorize("@ss.hasPermi('netEwm:posterHistory:edit')") @Log(title = "广告历史", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@RequestBody BPosterHistory bPosterHistory) - { + public AjaxResult edit(@RequestBody BPosterHistory bPosterHistory) { return toAjax(bPosterHistoryService.updateBPosterHistory(bPosterHistory)); } @@ -96,9 +91,8 @@ public class BPosterHistoryController extends BaseController */ @PreAuthorize("@ss.hasPermi('netEwm:posterHistory:remove')") @Log(title = "广告历史", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public AjaxResult remove(@PathVariable Long[] ids) - { + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(bPosterHistoryService.deleteBPosterHistoryByIds(ids)); } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BShanghuController.java b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BShanghuController.java index 8c6bee6..e6c7593 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BShanghuController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BShanghuController.java @@ -1,37 +1,37 @@ package com.ruoyi.system.controller; -import java.util.List; -import javax.servlet.http.HttpServletResponse; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.system.domain.BShanghu; +import com.ruoyi.system.service.IBShanghuService; import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.DeleteMapping; 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.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.BShanghu; -import com.ruoyi.system.service.IBShanghuService; -import com.ruoyi.common.utils.poi.ExcelUtil; -import com.ruoyi.common.core.page.TableDataInfo; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import java.util.List; /** * 商户Controller - * + * * @author ruoyi * @date 2023-11-21 */ @RestController @RequestMapping("/netEwm/shanghu") -public class BShanghuController extends BaseController -{ - @Autowired +public class BShanghuController extends BaseController { + @Resource private IBShanghuService bShanghuService; /** @@ -39,8 +39,7 @@ public class BShanghuController extends BaseController */ @PreAuthorize("@ss.hasPermi('netEwm:shanghu:list')") @GetMapping("/list") - public TableDataInfo list(BShanghu bShanghu) - { + public TableDataInfo list(BShanghu bShanghu) { startPage(); List list = bShanghuService.selectBShanghuList(bShanghu); return getDataTable(list); @@ -52,8 +51,7 @@ public class BShanghuController extends BaseController @PreAuthorize("@ss.hasPermi('netEwm:shanghu:export')") @Log(title = "商户", businessType = BusinessType.EXPORT) @PostMapping("/export") - public void export(HttpServletResponse response, BShanghu bShanghu) - { + public void export(HttpServletResponse response, BShanghu bShanghu) { List list = bShanghuService.selectBShanghuList(bShanghu); ExcelUtil util = new ExcelUtil(BShanghu.class); util.exportExcel(response, list, "商户数据"); @@ -64,8 +62,7 @@ public class BShanghuController extends BaseController */ @PreAuthorize("@ss.hasPermi('netEwm:shanghu:query')") @GetMapping(value = "/{id}") - public AjaxResult getInfo(@PathVariable("id") Long id) - { + public AjaxResult getInfo(@PathVariable("id") Long id) { return success(bShanghuService.selectBShanghuById(id)); } @@ -75,8 +72,7 @@ public class BShanghuController extends BaseController @PreAuthorize("@ss.hasPermi('netEwm:shanghu:add')") @Log(title = "商户", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@RequestBody BShanghu bShanghu) - { + public AjaxResult add(@RequestBody BShanghu bShanghu) { return toAjax(bShanghuService.insertBShanghu(bShanghu)); } @@ -86,8 +82,7 @@ public class BShanghuController extends BaseController @PreAuthorize("@ss.hasPermi('netEwm:shanghu:edit')") @Log(title = "商户", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@RequestBody BShanghu bShanghu) - { + public AjaxResult edit(@RequestBody BShanghu bShanghu) { return toAjax(bShanghuService.updateBShanghu(bShanghu)); } @@ -96,9 +91,8 @@ public class BShanghuController extends BaseController */ @PreAuthorize("@ss.hasPermi('netEwm:shanghu:remove')") @Log(title = "商户", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public AjaxResult remove(@PathVariable Long[] ids) - { + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(bShanghuService.deleteBShanghuByIds(ids)); } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/BNet.java b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/BNet.java index 28dda82..e6ec464 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/BNet.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/BNet.java @@ -1,84 +1,104 @@ 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; /** * 网络对象 b_net - * + * * @author ruoyi * @date 2023-11-21 */ -public class BNet extends BaseEntity -{ +public class BNet extends BaseEntity { private static final long serialVersionUID = 1L; - /** $column.columnComment */ + /** + * $column.columnComment + */ private Long id; - /** 网络名称 */ + /** + * 商户id + */ + private Long shanghuId; + + /** + * 网络名称 + */ @Excel(name = "网络名称") private String netName; - /** wifi名称 */ + /** + * wifi名称 + */ @Excel(name = "wifi名称") private String wifiName; - /** wifi密码 */ + /** + * wifi密码 + */ @Excel(name = "wifi密码") private String wifiPass; - public void setId(Long id) - { + public BNet() { + } + + public BNet(Long id, Long shanghuId, String netName, String wifiName, String wifiPass) { this.id = id; + this.shanghuId = shanghuId; + this.netName = netName; + this.wifiName = wifiName; + this.wifiPass = wifiPass; } - public Long getId() - { + @Override + public String toString() { + return "BNet{" + + "id=" + id + + ", shanghuId=" + shanghuId + + ", netName='" + netName + '\'' + + ", wifiName='" + wifiName + '\'' + + ", wifiPass='" + wifiPass + '\'' + + '}'; + } + + public Long getId() { return id; } - public void setNetName(String netName) - { - this.netName = netName; + + public void setId(Long id) { + this.id = id; } - public String getNetName() - { + public Long getShanghuId() { + return shanghuId; + } + + public void setShanghuId(Long shanghuId) { + this.shanghuId = shanghuId; + } + + public String getNetName() { return netName; } - public void setWifiName(String wifiName) - { - this.wifiName = wifiName; + + public void setNetName(String netName) { + this.netName = netName; } - public String getWifiName() - { + public String getWifiName() { return wifiName; } - public void setWifiPass(String wifiPass) - { - this.wifiPass = wifiPass; + + public void setWifiName(String wifiName) { + this.wifiName = wifiName; } - public String getWifiPass() - { + public String getWifiPass() { return wifiPass; } - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("id", getId()) - .append("netName", getNetName()) - .append("wifiName", getWifiName()) - .append("wifiPass", getWifiPass()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("remark", getRemark()) - .toString(); + public void setWifiPass(String wifiPass) { + this.wifiPass = wifiPass; } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/BNetHistory.java b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/BNetHistory.java index db28680..ae0384c 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/BNetHistory.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/BNetHistory.java @@ -1,112 +1,129 @@ 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; /** * 连网历史对象 b_net_history - * + * * @author ruoyi * @date 2023-11-21 */ -public class BNetHistory extends BaseEntity -{ +public class BNetHistory extends BaseEntity { private static final long serialVersionUID = 1L; - /** $column.columnComment */ + /** + * $column.columnComment + */ private Long id; - /** 是否连接成功 */ + /** + * 商户id + */ + private Long shanghuId; + + /** + * 是否连接成功 + */ @Excel(name = "是否连接成功") private Long isTrue; - /** 网络id */ + /** + * 网络id + */ @Excel(name = "网络id") private Long netId; - /** 网络名称 */ + /** + * 网络名称 + */ @Excel(name = "网络名称") private String netName; - /** wifi名称 */ + /** + * wifi名称 + */ @Excel(name = "wifi名称") private String wifiName; - /** wifi密码 */ + /** + * wifi密码 + */ @Excel(name = "wifi密码") private String wifiPass; - public void setId(Long id) - { + + public BNetHistory() { + } + + public BNetHistory(Long id, Long shanghuId, Long isTrue, Long netId, String netName, String wifiName, String wifiPass) { this.id = id; + this.shanghuId = shanghuId; + this.isTrue = isTrue; + this.netId = netId; + this.netName = netName; + this.wifiName = wifiName; + this.wifiPass = wifiPass; } - public Long getId() - { + public Long getId() { return id; } - public void setIsTrue(Long isTrue) - { - this.isTrue = isTrue; + + public void setId(Long id) { + this.id = id; } - public Long getIsTrue() - { + public Long getIsTrue() { return isTrue; } - public void setNetId(Long netId) - { - this.netId = netId; + + public void setIsTrue(Long isTrue) { + this.isTrue = isTrue; } - public Long getNetId() - { + public Long getNetId() { return netId; } - public void setNetName(String netName) - { - this.netName = netName; + + public void setNetId(Long netId) { + this.netId = netId; } - public String getNetName() - { + public String getNetName() { return netName; } - public void setWifiName(String wifiName) - { - this.wifiName = wifiName; + + public void setNetName(String netName) { + this.netName = netName; } - public String getWifiName() - { + public String getWifiName() { return wifiName; } - public void setWifiPass(String wifiPass) - { - this.wifiPass = wifiPass; + + public void setWifiName(String wifiName) { + this.wifiName = wifiName; } - public String getWifiPass() - { + public String getWifiPass() { return wifiPass; } + public void setWifiPass(String wifiPass) { + this.wifiPass = wifiPass; + } + @Override public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("id", getId()) - .append("isTrue", getIsTrue()) - .append("netId", getNetId()) - .append("netName", getNetName()) - .append("wifiName", getWifiName()) - .append("wifiPass", getWifiPass()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("remark", getRemark()) - .toString(); + return "BNetHistory{" + "id=" + id + ", shanghuId=" + shanghuId + ", isTrue=" + isTrue + ", netId=" + netId + ", netName='" + netName + '\'' + ", wifiName='" + wifiName + '\'' + ", wifiPass='" + wifiPass + '\'' + '}'; + } + + public Long getShanghuId() { + return shanghuId; + } + + public void setShanghuId(Long shanghuId) { + this.shanghuId = shanghuId; } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/BPosterHistory.java b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/BPosterHistory.java index eb1b18d..ec40648 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/BPosterHistory.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/BPosterHistory.java @@ -1,130 +1,148 @@ 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; +import java.util.Date; + /** * 广告历史对象 b_poster_history - * + * * @author ruoyi * @date 2023-11-21 */ -public class BPosterHistory extends BaseEntity -{ +public class BPosterHistory extends BaseEntity { private static final long serialVersionUID = 1L; - /** $column.columnComment */ + /** + * $column.columnComment + */ private Long id; - /** 广告id */ + /** + * 商户id + */ + private Long shanghuId; + + /** + * 广告id + */ @Excel(name = "广告id") private Long posterId; - /** 广告名称 */ + /** + * 广告名称 + */ @Excel(name = "广告名称") private String posterName; - /** 有效起始时间 */ + /** + * 有效起始时间 + */ @JsonFormat(pattern = "yyyy-MM-dd") @Excel(name = "有效起始时间", width = 30, dateFormat = "yyyy-MM-dd") private Date startTime; - /** 有效结束时间 */ + /** + * 有效结束时间 + */ @JsonFormat(pattern = "yyyy-MM-dd") @Excel(name = "有效结束时间", width = 30, dateFormat = "yyyy-MM-dd") private Date endTime; - /** 视频路径 */ + /** + * 视频路径 + */ @Excel(name = "视频路径") private String videoPath; - /** 视频封面 */ + /** + * 视频封面 + */ @Excel(name = "视频封面") private String videoLogo; - public void setId(Long id) - { + public BPosterHistory() { + } + + public BPosterHistory(Long id, Long shanghuId, Long posterId, String posterName, Date startTime, Date endTime, String videoPath, String videoLogo) { this.id = id; + this.shanghuId = shanghuId; + this.posterId = posterId; + this.posterName = posterName; + this.startTime = startTime; + this.endTime = endTime; + this.videoPath = videoPath; + this.videoLogo = videoLogo; } - public Long getId() - { + public Long getId() { return id; } - public void setPosterId(Long posterId) - { - this.posterId = posterId; + + public void setId(Long id) { + this.id = id; } - public Long getPosterId() - { + public Long getPosterId() { return posterId; } - public void setPosterName(String posterName) - { - this.posterName = posterName; + + public void setPosterId(Long posterId) { + this.posterId = posterId; } - public String getPosterName() - { + public String getPosterName() { return posterName; } - public void setStartTime(Date startTime) - { - this.startTime = startTime; + + public void setPosterName(String posterName) { + this.posterName = posterName; } - public Date getStartTime() - { + public Date getStartTime() { return startTime; } - public void setEndTime(Date endTime) - { - this.endTime = endTime; + + public void setStartTime(Date startTime) { + this.startTime = startTime; } - public Date getEndTime() - { + public Date getEndTime() { return endTime; } - public void setVideoPath(String videoPath) - { - this.videoPath = videoPath; + + public void setEndTime(Date endTime) { + this.endTime = endTime; } - public String getVideoPath() - { + public String getVideoPath() { return videoPath; } - public void setVideoLogo(String videoLogo) - { - this.videoLogo = videoLogo; + + public void setVideoPath(String videoPath) { + this.videoPath = videoPath; } - public String getVideoLogo() - { + public String getVideoLogo() { return videoLogo; } + public void setVideoLogo(String videoLogo) { + this.videoLogo = videoLogo; + } + @Override public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("id", getId()) - .append("posterId", getPosterId()) - .append("posterName", getPosterName()) - .append("startTime", getStartTime()) - .append("endTime", getEndTime()) - .append("videoPath", getVideoPath()) - .append("videoLogo", getVideoLogo()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("remark", getRemark()) - .toString(); + return "BPosterHistory{" + "id=" + id + ", shanghuId=" + shanghuId + ", posterId=" + posterId + ", posterName='" + posterName + '\'' + ", startTime=" + startTime + ", endTime=" + endTime + ", videoPath='" + videoPath + '\'' + ", videoLogo='" + videoLogo + '\'' + '}'; + } + + public Long getShanghuId() { + return shanghuId; + } + + public void setShanghuId(Long shanghuId) { + this.shanghuId = shanghuId; } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/BShanghu.java b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/BShanghu.java index adbc5b7..b4c536a 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/BShanghu.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/BShanghu.java @@ -1,126 +1,131 @@ 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 org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; /** * 商户对象 b_shanghu - * + * * @author ruoyi * @date 2023-11-21 */ -public class BShanghu extends BaseEntity -{ +public class BShanghu extends BaseEntity { private static final long serialVersionUID = 1L; - /** $column.columnComment */ + /** + * $column.columnComment + */ private Long id; - /** 商户名称 */ + /** + * 商户名称 + */ @Excel(name = "商户名称") private String posName; - /** 手机号 */ + /** + * 手机号 + */ @Excel(name = "手机号") private String phoneNumber; - /** 联系人 */ + /** + * 联系人 + */ @Excel(name = "联系人") private String linkMan; - /** 城市 */ + /** + * 城市 + */ @Excel(name = "城市") private String city; - /** 地址信息 */ + /** + * 地址信息 + */ @Excel(name = "地址信息") private String address; - /** 广告标识 */ + /** + * 广告标识 + */ @Excel(name = "广告标识") private Long posterId; - public void setId(Long id) - { - this.id = id; - } - - public Long getId() - { + public Long getId() { return id; } - public void setPosName(String posName) - { - this.posName = posName; + + public void setId(Long id) { + this.id = id; } - public String getPosName() - { + public String getPosName() { return posName; } - public void setPhoneNumber(String phoneNumber) - { - this.phoneNumber = phoneNumber; + + public void setPosName(String posName) { + this.posName = posName; } - public String getPhoneNumber() - { + public String getPhoneNumber() { return phoneNumber; } - public void setLinkMan(String linkMan) - { - this.linkMan = linkMan; + + public void setPhoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; } - public String getLinkMan() - { + public String getLinkMan() { return linkMan; } - public void setCity(String city) - { - this.city = city; + + public void setLinkMan(String linkMan) { + this.linkMan = linkMan; } - public String getCity() - { + public String getCity() { return city; } - public void setAddress(String address) - { - this.address = address; + + public void setCity(String city) { + this.city = city; } - public String getAddress() - { + public String getAddress() { return address; } - public void setPosterId(Long posterId) - { - this.posterId = posterId; + + public void setAddress(String address) { + this.address = address; } - public Long getPosterId() - { + public Long getPosterId() { return posterId; } + public void setPosterId(Long posterId) { + this.posterId = posterId; + } + @Override public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("id", getId()) - .append("posName", getPosName()) - .append("phoneNumber", getPhoneNumber()) - .append("linkMan", getLinkMan()) - .append("city", getCity()) - .append("address", getAddress()) - .append("posterId", getPosterId()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("remark", getRemark()) - .toString(); + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("posName", getPosName()) + .append("phoneNumber", getPhoneNumber()) + .append("linkMan", getLinkMan()) + .append("city", getCity()) + .append("address", getAddress()) + .append("posterId", getPosterId()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/dto/request/PosterRequest.java b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/dto/request/PosterRequest.java new file mode 100644 index 0000000..22dabd0 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/dto/request/PosterRequest.java @@ -0,0 +1,46 @@ +package com.ruoyi.system.domain.dto.request; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.List; + +/** + * 广告批量分配商户请求类 + * + * @author wu + * @since 2023/11/24 9:36 + */ +@Data +@ApiModel("广告批量分配商户请求类") +public class PosterRequest implements Serializable { + private static final long serialVersionUID = -2550281756138991362L; + + /** + * 广告id + */ + @ApiModelProperty(value = "广告id") + @NotNull(message = "广告不能为空") + private Long posterId; + + /** + * 商户id集合 + */ + @ApiModelProperty(value = "商户id集合") + private List shanghuIds; + + /** + * 商户城市 + */ + @ApiModelProperty(value = "商户城市") + private String shanghuCity; + + /** + * 商户名称 + */ + @ApiModelProperty(value = "商户名称") + private String shanghuName; +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BNetMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BNetMapper.java index 3061a2d..53f4369 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BNetMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BNetMapper.java @@ -1,61 +1,78 @@ package com.ruoyi.system.mapper; -import java.util.List; import com.ruoyi.system.domain.BNet; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 网络Mapper接口 - * + * * @author ruoyi * @date 2023-11-21 */ -public interface BNetMapper -{ +public interface BNetMapper { /** * 查询网络 - * + * * @param id 网络主键 * @return 网络 */ - public BNet selectBNetById(Long id); + BNet selectBNetById(Long id); /** * 查询网络列表 - * + * * @param bNet 网络 * @return 网络集合 */ - public List selectBNetList(BNet bNet); + List selectBNetList(BNet bNet); /** * 新增网络 - * + * * @param bNet 网络 * @return 结果 */ - public int insertBNet(BNet bNet); + int insertBNet(BNet bNet); /** * 修改网络 - * + * * @param bNet 网络 * @return 结果 */ - public int updateBNet(BNet bNet); + int updateBNet(BNet bNet); /** * 删除网络 - * + * * @param id 网络主键 * @return 结果 */ - public int deleteBNetById(Long id); + int deleteBNetById(Long id); /** * 批量删除网络 - * + * * @param ids 需要删除的数据主键集合 * @return 结果 */ - public int deleteBNetByIds(Long[] ids); + int deleteBNetByIds(Long[] ids); + + /** + * 根据商户id删除wifi + * + * @param id 商户id + */ + void deleteBNetByShangHuId(Long id); + + /** + * 根据商户id删除wifi + * + * @param shanghuId 商户id + * @return wifi信息 + */ + BNet findByShanghuId(@Param("shanghuId") Long shanghuId); + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BShanghuMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BShanghuMapper.java index 12569bf..b64779a 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BShanghuMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BShanghuMapper.java @@ -1,61 +1,79 @@ package com.ruoyi.system.mapper; -import java.util.List; import com.ruoyi.system.domain.BShanghu; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 商户Mapper接口 - * + * * @author ruoyi * @date 2023-11-21 */ -public interface BShanghuMapper -{ +public interface BShanghuMapper { /** * 查询商户 - * + * * @param id 商户主键 * @return 商户 */ - public BShanghu selectBShanghuById(Long id); + BShanghu selectBShanghuById(Long id); /** * 查询商户列表 - * + * * @param bShanghu 商户 * @return 商户集合 */ - public List selectBShanghuList(BShanghu bShanghu); + List selectBShanghuList(BShanghu bShanghu); /** * 新增商户 - * + * * @param bShanghu 商户 * @return 结果 */ - public int insertBShanghu(BShanghu bShanghu); + int insertBShanghu(BShanghu bShanghu); /** * 修改商户 - * + * * @param bShanghu 商户 * @return 结果 */ - public int updateBShanghu(BShanghu bShanghu); + int updateBShanghu(BShanghu bShanghu); /** * 删除商户 - * + * * @param id 商户主键 * @return 结果 */ - public int deleteBShanghuById(Long id); + int deleteBShanghuById(Long id); /** * 批量删除商户 - * + * * @param ids 需要删除的数据主键集合 * @return 结果 */ - public int deleteBShanghuByIds(Long[] ids); + int deleteBShanghuByIds(Long[] ids); + + /** + * 为商户批量填充广告 + * + * @param posterId 广告id + * @param list 商户id集合 + */ + void editPostIdByIds(@Param("posterId") Long posterId, @Param("list") List list); + + /** + * 为商户批量填充广告 + * + * @param posterId 广告id + * @param shanghuCity 商户城市 + * @param shanghuName 商户名称 + */ + void editPostIdByReq(@Param("posterId") Long posterId, @Param("shanghuCity") String shanghuCity, @Param("shanghuName") String shanghuName); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/IBNetService.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/IBNetService.java index ffe6037..60e8567 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/IBNetService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/IBNetService.java @@ -1,61 +1,76 @@ package com.ruoyi.system.service; -import java.util.List; import com.ruoyi.system.domain.BNet; +import java.util.List; + /** * 网络Service接口 - * + * * @author ruoyi * @date 2023-11-21 */ -public interface IBNetService -{ +public interface IBNetService { /** * 查询网络 - * + * * @param id 网络主键 * @return 网络 */ - public BNet selectBNetById(Long id); + BNet selectBNetById(Long id); /** * 查询网络列表 - * + * * @param bNet 网络 * @return 网络集合 */ - public List selectBNetList(BNet bNet); + List selectBNetList(BNet bNet); /** * 新增网络 - * + * * @param bNet 网络 * @return 结果 */ - public int insertBNet(BNet bNet); + int insertBNet(BNet bNet); /** * 修改网络 - * + * * @param bNet 网络 * @return 结果 */ - public int updateBNet(BNet bNet); + int updateBNet(BNet bNet); /** * 批量删除网络 - * + * * @param ids 需要删除的网络主键集合 * @return 结果 */ - public int deleteBNetByIds(Long[] ids); + int deleteBNetByIds(Long[] ids); /** * 删除网络信息 - * + * * @param id 网络主键 * @return 结果 */ - public int deleteBNetById(Long id); + int deleteBNetById(Long id); + + /** + * 根据商户id删除wifi + * + * @param id 商户id + */ + void deleteBNetByShangHuId(Long id); + + /** + * 根据商户id查询wifi(提供二维码接口) + * + * @param id 商户id + * @return wifi信息 + */ + BNet findById(Long id); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/IBPosterService.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/IBPosterService.java index ad9665d..311fe2a 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/IBPosterService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/IBPosterService.java @@ -1,61 +1,69 @@ package com.ruoyi.system.service; -import java.util.List; import com.ruoyi.system.domain.BPoster; +import com.ruoyi.system.domain.dto.request.PosterRequest; + +import java.util.List; /** * 广告Service接口 - * + * * @author ruoyi * @date 2023-11-21 */ -public interface IBPosterService -{ +public interface IBPosterService { /** * 查询广告 - * + * * @param id 广告主键 * @return 广告 */ - public BPoster selectBPosterById(Long id); + BPoster selectBPosterById(Long id); /** * 查询广告列表 - * + * * @param bPoster 广告 * @return 广告集合 */ - public List selectBPosterList(BPoster bPoster); + List selectBPosterList(BPoster bPoster); /** * 新增广告 - * + * * @param bPoster 广告 * @return 结果 */ - public int insertBPoster(BPoster bPoster); + int insertBPoster(BPoster bPoster); /** * 修改广告 - * + * * @param bPoster 广告 * @return 结果 */ - public int updateBPoster(BPoster bPoster); + int updateBPoster(BPoster bPoster); /** * 批量删除广告 - * + * * @param ids 需要删除的广告主键集合 * @return 结果 */ - public int deleteBPosterByIds(Long[] ids); + int deleteBPosterByIds(Long[] ids); /** * 删除广告信息 - * + * * @param id 广告主键 * @return 结果 */ - public int deleteBPosterById(Long id); + int deleteBPosterById(Long id); + + /** + * 广告批量分配商户 + * + * @param req 请求类 + */ + void batchAllocation(PosterRequest req); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/IBShanghuService.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/IBShanghuService.java index f38eeb9..d9fd3b7 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/IBShanghuService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/IBShanghuService.java @@ -1,61 +1,80 @@ package com.ruoyi.system.service; -import java.util.List; +import com.ruoyi.system.domain.BNet; import com.ruoyi.system.domain.BShanghu; +import java.util.List; + /** * 商户Service接口 - * + * * @author ruoyi * @date 2023-11-21 */ -public interface IBShanghuService -{ +public interface IBShanghuService { /** * 查询商户 - * + * * @param id 商户主键 * @return 商户 */ - public BShanghu selectBShanghuById(Long id); + BShanghu selectBShanghuById(Long id); /** * 查询商户列表 - * + * * @param bShanghu 商户 * @return 商户集合 */ - public List selectBShanghuList(BShanghu bShanghu); + List selectBShanghuList(BShanghu bShanghu); /** * 新增商户 - * + * * @param bShanghu 商户 * @return 结果 */ - public int insertBShanghu(BShanghu bShanghu); + int insertBShanghu(BShanghu bShanghu); /** * 修改商户 - * + * * @param bShanghu 商户 * @return 结果 */ - public int updateBShanghu(BShanghu bShanghu); + int updateBShanghu(BShanghu bShanghu); /** * 批量删除商户 - * + * * @param ids 需要删除的商户主键集合 * @return 结果 */ - public int deleteBShanghuByIds(Long[] ids); + int deleteBShanghuByIds(Long[] ids); /** * 删除商户信息 - * + * * @param id 商户主键 * @return 结果 */ - public int deleteBShanghuById(Long id); + int deleteBShanghuById(Long id); + + /** + * 为商户批量填充广告 + * + * @param posterId 广告id + * @param shanghuIds 商户id集合 + */ + void editPostIdByIds(Long posterId, List shanghuIds); + + /** + * 为商户批量填充广告 + * + * @param posterId 广告id + * @param shanghuCity 商户城市 + * @param shanghuName 商户名称 + */ + void editPostIdByReq(Long posterId, String shanghuCity, String shanghuName); + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BNetServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BNetServiceImpl.java index 5f53361..5e3eaec 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BNetServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BNetServiceImpl.java @@ -1,96 +1,121 @@ package com.ruoyi.system.service.impl; -import java.util.List; +import cn.hutool.core.bean.BeanUtil; +import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.utils.DateUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import com.ruoyi.system.mapper.BNetMapper; import com.ruoyi.system.domain.BNet; +import com.ruoyi.system.mapper.BNetMapper; import com.ruoyi.system.service.IBNetService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; /** * 网络Service业务层处理 - * + * * @author ruoyi * @date 2023-11-21 */ @Service -public class BNetServiceImpl implements IBNetService -{ - @Autowired +public class BNetServiceImpl implements IBNetService { + + @Resource private BNetMapper bNetMapper; /** * 查询网络 - * + * * @param id 网络主键 * @return 网络 */ @Override - public BNet selectBNetById(Long id) - { + public BNet selectBNetById(Long id) { return bNetMapper.selectBNetById(id); } /** * 查询网络列表 - * + * * @param bNet 网络 * @return 网络 */ @Override - public List selectBNetList(BNet bNet) - { + public List selectBNetList(BNet bNet) { return bNetMapper.selectBNetList(bNet); } /** * 新增网络 - * + * * @param bNet 网络 * @return 结果 */ @Override - public int insertBNet(BNet bNet) - { + public int insertBNet(BNet bNet) { + if (bNet.getShanghuId() == null) { + throw new ServiceException("商户id不能为空"); + } + BNet net = bNetMapper.findByShanghuId(bNet.getShanghuId()); + if (BeanUtil.isNotEmpty(net)) { + throw new ServiceException("已经存在wifi网络不能新增"); + } bNet.setCreateTime(DateUtils.getNowDate()); return bNetMapper.insertBNet(bNet); } /** * 修改网络 - * + * * @param bNet 网络 * @return 结果 */ @Override - public int updateBNet(BNet bNet) - { + public int updateBNet(BNet bNet) { bNet.setUpdateTime(DateUtils.getNowDate()); return bNetMapper.updateBNet(bNet); } /** * 批量删除网络 - * + * * @param ids 需要删除的网络主键 * @return 结果 */ @Override - public int deleteBNetByIds(Long[] ids) - { + public int deleteBNetByIds(Long[] ids) { return bNetMapper.deleteBNetByIds(ids); } /** * 删除网络信息 - * + * * @param id 网络主键 * @return 结果 */ @Override - public int deleteBNetById(Long id) - { + public int deleteBNetById(Long id) { return bNetMapper.deleteBNetById(id); } + + /** + * 根据商户id删除wifi + * + * @param id 商户id + */ + @Override + public void deleteBNetByShangHuId(Long id) { + bNetMapper.deleteBNetByShangHuId(id); + } + + /** + * 根据商户id查询wifi(提供二维码接口) + * + * @param id 商户id + * @return wifi信息 + */ + @Override + public BNet findById(Long id) { + return bNetMapper.findByShanghuId(id); + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BPosterServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BPosterServiceImpl.java index 30ff45b..0545235 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BPosterServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BPosterServiceImpl.java @@ -1,96 +1,123 @@ package com.ruoyi.system.service.impl; -import java.util.List; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.StrUtil; +import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.utils.DateUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import com.ruoyi.system.mapper.BPosterMapper; import com.ruoyi.system.domain.BPoster; +import com.ruoyi.system.domain.dto.request.PosterRequest; +import com.ruoyi.system.mapper.BPosterMapper; import com.ruoyi.system.service.IBPosterService; +import com.ruoyi.system.service.IBShanghuService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; /** * 广告Service业务层处理 - * + * * @author ruoyi * @date 2023-11-21 */ @Service -public class BPosterServiceImpl implements IBPosterService -{ - @Autowired +public class BPosterServiceImpl implements IBPosterService { + + @Resource private BPosterMapper bPosterMapper; + @Resource + private IBShanghuService shanghuService; + /** * 查询广告 - * + * * @param id 广告主键 * @return 广告 */ @Override - public BPoster selectBPosterById(Long id) - { + public BPoster selectBPosterById(Long id) { return bPosterMapper.selectBPosterById(id); } /** * 查询广告列表 - * + * * @param bPoster 广告 * @return 广告 */ @Override - public List selectBPosterList(BPoster bPoster) - { + public List selectBPosterList(BPoster bPoster) { return bPosterMapper.selectBPosterList(bPoster); } /** * 新增广告 - * + * * @param bPoster 广告 * @return 结果 */ @Override - public int insertBPoster(BPoster bPoster) - { + public int insertBPoster(BPoster bPoster) { bPoster.setCreateTime(DateUtils.getNowDate()); return bPosterMapper.insertBPoster(bPoster); } /** * 修改广告 - * + * * @param bPoster 广告 * @return 结果 */ @Override - public int updateBPoster(BPoster bPoster) - { + public int updateBPoster(BPoster bPoster) { bPoster.setUpdateTime(DateUtils.getNowDate()); return bPosterMapper.updateBPoster(bPoster); } /** * 批量删除广告 - * + * * @param ids 需要删除的广告主键 * @return 结果 */ @Override - public int deleteBPosterByIds(Long[] ids) - { + public int deleteBPosterByIds(Long[] ids) { return bPosterMapper.deleteBPosterByIds(ids); } /** * 删除广告信息 - * + * * @param id 广告主键 * @return 结果 */ @Override - public int deleteBPosterById(Long id) - { + public int deleteBPosterById(Long id) { return bPosterMapper.deleteBPosterById(id); } + + /** + * 广告批量分配商户 + * + * @param req 请求类 + */ + @Override + public void batchAllocation(PosterRequest req) { + BPoster bPoster = bPosterMapper.selectBPosterById(req.getPosterId()); + if (BeanUtil.isEmpty(bPoster)) { + throw new ServiceException("所选广告不存在"); + } + if (CollectionUtil.isNotEmpty(req.getShanghuIds())) { + shanghuService.editPostIdByIds(req.getPosterId(), req.getShanghuIds()); + return; + } + if (StrUtil.isNotEmpty(req.getShanghuCity())||StrUtil.isNotEmpty(req.getShanghuName())) { + shanghuService.editPostIdByReq(req.getPosterId(),req.getShanghuCity(),req.getShanghuName()); + return; + } + throw new ServiceException("参数错误"); + + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BShanghuServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BShanghuServiceImpl.java index caf8047..b9ce9f8 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BShanghuServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BShanghuServiceImpl.java @@ -1,96 +1,148 @@ package com.ruoyi.system.service.impl; -import java.util.List; +import cn.hutool.core.bean.BeanUtil; +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.utils.DateUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import com.ruoyi.system.mapper.BShanghuMapper; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.system.domain.BPoster; import com.ruoyi.system.domain.BShanghu; +import com.ruoyi.system.mapper.BShanghuMapper; +import com.ruoyi.system.service.IBNetService; +import com.ruoyi.system.service.IBPosterService; import com.ruoyi.system.service.IBShanghuService; +import com.ruoyi.system.service.ISysUserService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; /** * 商户Service业务层处理 - * + * * @author ruoyi * @date 2023-11-21 */ @Service -public class BShanghuServiceImpl implements IBShanghuService -{ - @Autowired +public class BShanghuServiceImpl implements IBShanghuService { + + @Resource private BShanghuMapper bShanghuMapper; + @Resource + private ISysUserService userService; + + @Resource + private IBPosterService posterService; + + @Resource + private IBNetService netService; + /** * 查询商户 - * + * * @param id 商户主键 * @return 商户 */ @Override - public BShanghu selectBShanghuById(Long id) - { + public BShanghu selectBShanghuById(Long id) { return bShanghuMapper.selectBShanghuById(id); } /** * 查询商户列表 - * + * * @param bShanghu 商户 * @return 商户 */ @Override - public List selectBShanghuList(BShanghu bShanghu) - { + public List selectBShanghuList(BShanghu bShanghu) { return bShanghuMapper.selectBShanghuList(bShanghu); } /** * 新增商户 - * + * * @param bShanghu 商户 * @return 结果 */ @Override - public int insertBShanghu(BShanghu bShanghu) - { + public int insertBShanghu(BShanghu bShanghu) { bShanghu.setCreateTime(DateUtils.getNowDate()); + SysUser user = new SysUser(); + user.setUserName(bShanghu.getPhoneNumber()); + user.setPassword(SecurityUtils.encryptPassword("123456")); + user.setNickName(bShanghu.getLinkMan()); + // 注册用户 + if (!userService.checkUserNameUnique(user)) { + throw new ServiceException("新增用户'" + user.getUserName() + "'失败,登录账号已存在"); + } + userService.insertUser(user); return bShanghuMapper.insertBShanghu(bShanghu); } /** * 修改商户 - * + * * @param bShanghu 商户 * @return 结果 */ @Override - public int updateBShanghu(BShanghu bShanghu) - { + public int updateBShanghu(BShanghu bShanghu) { + if (bShanghu.getPosterId() != null) { + BPoster bPoster = posterService.selectBPosterById(bShanghu.getPosterId()); + if (BeanUtil.isEmpty(bPoster)) { + throw new ServiceException("所选广告不存在"); + } + } bShanghu.setUpdateTime(DateUtils.getNowDate()); return bShanghuMapper.updateBShanghu(bShanghu); } /** * 批量删除商户 - * + * * @param ids 需要删除的商户主键 * @return 结果 */ @Override - public int deleteBShanghuByIds(Long[] ids) - { + public int deleteBShanghuByIds(Long[] ids) { return bShanghuMapper.deleteBShanghuByIds(ids); } /** * 删除商户信息 - * + * * @param id 商户主键 * @return 结果 */ @Override - public int deleteBShanghuById(Long id) - { + public int deleteBShanghuById(Long id) { + // 删除商户wifi + netService.deleteBNetByShangHuId(id); return bShanghuMapper.deleteBShanghuById(id); } + + /** + * 为商户批量填充广告 + * + * @param posterId 广告id + * @param shanghuIds 商户id集合 + */ + @Override + public void editPostIdByIds(Long posterId, List shanghuIds) { + bShanghuMapper.editPostIdByIds(posterId, shanghuIds); + } + + /** + * 为商户批量填充广告 + * + * @param posterId 广告id + * @param shanghuCity 商户城市 + * @param shanghuName 商户名称 + */ + @Override + public void editPostIdByReq(Long posterId, String shanghuCity, String shanghuName) { + bShanghuMapper.editPostIdByReq(posterId, shanghuCity, shanghuName); + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java index cec5006..44008f4 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java @@ -1,9 +1,12 @@ package com.ruoyi.web.controller.common; -import java.util.ArrayList; -import java.util.List; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import com.ruoyi.common.config.RuoYiConfig; +import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.file.FileUploadUtils; +import com.ruoyi.common.utils.file.FileUtils; +import com.ruoyi.framework.config.ServerConfig; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -13,43 +16,35 @@ import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.multipart.MultipartFile; -import com.ruoyi.common.config.RuoYiConfig; -import com.ruoyi.common.constant.Constants; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.utils.StringUtils; -import com.ruoyi.common.utils.file.FileUploadUtils; -import com.ruoyi.common.utils.file.FileUtils; -import com.ruoyi.framework.config.ServerConfig; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.ArrayList; +import java.util.List; /** * 通用请求处理 - * + * * @author ruoyi */ @RestController @RequestMapping("/common") -public class CommonController -{ +public class CommonController { private static final Logger log = LoggerFactory.getLogger(CommonController.class); - + private static final String FILE_DELIMETER = ","; @Autowired private ServerConfig serverConfig; - private static final String FILE_DELIMETER = ","; - /** * 通用下载请求 - * + * * @param fileName 文件名称 - * @param delete 是否删除 + * @param delete 是否删除 */ @GetMapping("/download") - public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request) - { - try - { - if (!FileUtils.checkAllowDownload(fileName)) - { + public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request) { + try { + if (!FileUtils.checkAllowDownload(fileName)) { throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName)); } String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1); @@ -58,13 +53,10 @@ public class CommonController response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE); FileUtils.setAttachmentResponseHeader(response, realFileName); FileUtils.writeBytes(filePath, response.getOutputStream()); - if (delete) - { + if (delete) { FileUtils.deleteFile(filePath); } - } - catch (Exception e) - { + } catch (Exception e) { log.error("下载文件失败", e); } } @@ -73,10 +65,8 @@ public class CommonController * 通用上传请求(单个) */ @PostMapping("/upload") - public AjaxResult uploadFile(MultipartFile file) throws Exception - { - try - { + public AjaxResult uploadFile(MultipartFile file) throws Exception { + try { // 上传文件路径 String filePath = RuoYiConfig.getUploadPath(); // 上传并返回新文件名称 @@ -88,9 +78,7 @@ public class CommonController ajax.put("newFileName", FileUtils.getName(fileName)); ajax.put("originalFilename", file.getOriginalFilename()); return ajax; - } - catch (Exception e) - { + } catch (Exception e) { return AjaxResult.error(e.getMessage()); } } @@ -99,18 +87,15 @@ public class CommonController * 通用上传请求(多个) */ @PostMapping("/uploads") - public AjaxResult uploadFiles(List files) throws Exception - { - try - { + public AjaxResult uploadFiles(List files) throws Exception { + try { // 上传文件路径 String filePath = RuoYiConfig.getUploadPath(); List urls = new ArrayList(); List fileNames = new ArrayList(); List newFileNames = new ArrayList(); List originalFilenames = new ArrayList(); - for (MultipartFile file : files) - { + for (MultipartFile file : files) { // 上传并返回新文件名称 String fileName = FileUploadUtils.upload(filePath, file); String url = serverConfig.getUrl() + fileName; @@ -125,9 +110,7 @@ public class CommonController ajax.put("newFileNames", StringUtils.join(newFileNames, FILE_DELIMETER)); ajax.put("originalFilenames", StringUtils.join(originalFilenames, FILE_DELIMETER)); return ajax; - } - catch (Exception e) - { + } catch (Exception e) { return AjaxResult.error(e.getMessage()); } } @@ -137,12 +120,9 @@ public class CommonController */ @GetMapping("/download/resource") public void resourceDownload(String resource, HttpServletRequest request, HttpServletResponse response) - throws Exception - { - try - { - if (!FileUtils.checkAllowDownload(resource)) - { + throws Exception { + try { + if (!FileUtils.checkAllowDownload(resource)) { throw new Exception(StringUtils.format("资源文件({})非法,不允许下载。 ", resource)); } // 本地资源路径 @@ -154,9 +134,7 @@ public class CommonController response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE); FileUtils.setAttachmentResponseHeader(response, downloadName); FileUtils.writeBytes(downloadPath, response.getOutputStream()); - } - catch (Exception e) - { + } catch (Exception e) { log.error("下载文件失败", e); } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java index 256367b..d74df55 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java @@ -1,21 +1,5 @@ package com.ruoyi.web.controller.system; -import java.util.List; -import java.util.stream.Collectors; -import javax.servlet.http.HttpServletResponse; -import org.apache.commons.lang3.ArrayUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.DeleteMapping; -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.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.multipart.MultipartFile; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; @@ -27,39 +11,59 @@ import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.system.domain.BShanghu; +import com.ruoyi.system.service.IBShanghuService; import com.ruoyi.system.service.ISysDeptService; import com.ruoyi.system.service.ISysPostService; import com.ruoyi.system.service.ISysRoleService; import com.ruoyi.system.service.ISysUserService; +import org.apache.commons.lang3.ArrayUtils; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.DeleteMapping; +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.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.stream.Collectors; /** * 用户信息 - * + * * @author ruoyi */ @RestController @RequestMapping("/system/user") -public class SysUserController extends BaseController -{ - @Autowired +public class SysUserController extends BaseController { + @Resource private ISysUserService userService; - @Autowired + @Resource private ISysRoleService roleService; - @Autowired + @Resource private ISysDeptService deptService; - @Autowired + @Resource private ISysPostService postService; + @Resource + private IBShanghuService bShanghuService; + /** * 获取用户列表 */ @PreAuthorize("@ss.hasPermi('system:user:list')") @GetMapping("/list") - public TableDataInfo list(SysUser user) - { + public TableDataInfo list(SysUser user) { startPage(); List list = userService.selectUserList(user); return getDataTable(list); @@ -68,8 +72,7 @@ public class SysUserController extends BaseController @Log(title = "用户管理", businessType = BusinessType.EXPORT) @PreAuthorize("@ss.hasPermi('system:user:export')") @PostMapping("/export") - public void export(HttpServletResponse response, SysUser user) - { + public void export(HttpServletResponse response, SysUser user) { List list = userService.selectUserList(user); ExcelUtil util = new ExcelUtil(SysUser.class); util.exportExcel(response, list, "用户数据"); @@ -78,8 +81,7 @@ public class SysUserController extends BaseController @Log(title = "用户管理", businessType = BusinessType.IMPORT) @PreAuthorize("@ss.hasPermi('system:user:import')") @PostMapping("/importData") - public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception - { + public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception { ExcelUtil util = new ExcelUtil(SysUser.class); List userList = util.importExcel(file.getInputStream()); String operName = getUsername(); @@ -88,8 +90,7 @@ public class SysUserController extends BaseController } @PostMapping("/importTemplate") - public void importTemplate(HttpServletResponse response) - { + public void importTemplate(HttpServletResponse response) { ExcelUtil util = new ExcelUtil(SysUser.class); util.importTemplateExcel(response, "用户数据"); } @@ -98,16 +99,14 @@ public class SysUserController extends BaseController * 根据用户编号获取详细信息 */ @PreAuthorize("@ss.hasPermi('system:user:query')") - @GetMapping(value = { "/", "/{userId}" }) - public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId) - { + @GetMapping(value = {"/", "/{userId}"}) + public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId) { userService.checkUserDataScope(userId); AjaxResult ajax = AjaxResult.success(); List roles = roleService.selectRoleAll(); ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList())); ajax.put("posts", postService.selectPostAll()); - if (StringUtils.isNotNull(userId)) - { + if (StringUtils.isNotNull(userId)) { SysUser sysUser = userService.selectUserById(userId); ajax.put(AjaxResult.DATA_TAG, sysUser); ajax.put("postIds", postService.selectPostListByUserId(userId)); @@ -122,21 +121,26 @@ public class SysUserController extends BaseController @PreAuthorize("@ss.hasPermi('system:user:add')") @Log(title = "用户管理", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@Validated @RequestBody SysUser user) - { - if (!userService.checkUserNameUnique(user)) - { + public AjaxResult add(@Validated @RequestBody SysUser user) { + if (!userService.checkUserNameUnique(user)) { return error("新增用户'" + user.getUserName() + "'失败,登录账号已存在"); - } - else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) - { + } else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) { return error("新增用户'" + user.getUserName() + "'失败,手机号码已存在"); - } - else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) - { + } else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) { return error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在"); } + // 添加商户 + BShanghu shangHu = new BShanghu(); + shangHu.setAddress(user.getAddress()); + shangHu.setPosName(user.getPosName()); + shangHu.setPhoneNumber(user.getUserName()); + shangHu.setLinkMan(user.getNickName()); + + bShanghuService.insertBShanghu(shangHu); user.setCreateBy(getUsername()); + if (StringUtils.isEmpty(user.getPassword())) { + user.setPassword("123456"); + } user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); return toAjax(userService.insertUser(user)); } @@ -147,20 +151,14 @@ public class SysUserController extends BaseController @PreAuthorize("@ss.hasPermi('system:user:edit')") @Log(title = "用户管理", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@Validated @RequestBody SysUser user) - { + public AjaxResult edit(@Validated @RequestBody SysUser user) { userService.checkUserAllowed(user); userService.checkUserDataScope(user.getUserId()); - if (!userService.checkUserNameUnique(user)) - { + if (!userService.checkUserNameUnique(user)) { return error("修改用户'" + user.getUserName() + "'失败,登录账号已存在"); - } - else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) - { + } else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) { return error("修改用户'" + user.getUserName() + "'失败,手机号码已存在"); - } - else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) - { + } else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) { return error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在"); } user.setUpdateBy(getUsername()); @@ -173,10 +171,8 @@ public class SysUserController extends BaseController @PreAuthorize("@ss.hasPermi('system:user:remove')") @Log(title = "用户管理", businessType = BusinessType.DELETE) @DeleteMapping("/{userIds}") - public AjaxResult remove(@PathVariable Long[] userIds) - { - if (ArrayUtils.contains(userIds, getUserId())) - { + public AjaxResult remove(@PathVariable Long[] userIds) { + if (ArrayUtils.contains(userIds, getUserId())) { return error("当前用户不能删除"); } return toAjax(userService.deleteUserByIds(userIds)); @@ -188,8 +184,7 @@ public class SysUserController extends BaseController @PreAuthorize("@ss.hasPermi('system:user:resetPwd')") @Log(title = "用户管理", businessType = BusinessType.UPDATE) @PutMapping("/resetPwd") - public AjaxResult resetPwd(@RequestBody SysUser user) - { + public AjaxResult resetPwd(@RequestBody SysUser user) { userService.checkUserAllowed(user); userService.checkUserDataScope(user.getUserId()); user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); @@ -203,8 +198,7 @@ public class SysUserController extends BaseController @PreAuthorize("@ss.hasPermi('system:user:edit')") @Log(title = "用户管理", businessType = BusinessType.UPDATE) @PutMapping("/changeStatus") - public AjaxResult changeStatus(@RequestBody SysUser user) - { + public AjaxResult changeStatus(@RequestBody SysUser user) { userService.checkUserAllowed(user); userService.checkUserDataScope(user.getUserId()); user.setUpdateBy(getUsername()); @@ -216,8 +210,7 @@ public class SysUserController extends BaseController */ @PreAuthorize("@ss.hasPermi('system:user:query')") @GetMapping("/authRole/{userId}") - public AjaxResult authRole(@PathVariable("userId") Long userId) - { + public AjaxResult authRole(@PathVariable("userId") Long userId) { AjaxResult ajax = AjaxResult.success(); SysUser user = userService.selectUserById(userId); List roles = roleService.selectRolesByUserId(userId); @@ -232,8 +225,7 @@ public class SysUserController extends BaseController @PreAuthorize("@ss.hasPermi('system:user:edit')") @Log(title = "用户管理", businessType = BusinessType.GRANT) @PutMapping("/authRole") - public AjaxResult insertAuthRole(Long userId, Long[] roleIds) - { + public AjaxResult insertAuthRole(Long userId, Long[] roleIds) { userService.checkUserDataScope(userId); userService.insertUserAuth(userId, roleIds); return success(); @@ -244,8 +236,7 @@ public class SysUserController extends BaseController */ @PreAuthorize("@ss.hasPermi('system:user:list')") @GetMapping("/deptTree") - public AjaxResult deptTree(SysDept dept) - { + public AjaxResult deptTree(SysDept dept) { return success(deptService.selectDeptTreeList(dept)); } } diff --git a/ruoyi-admin/src/main/resources/mapper/netEwm/BNetMapper.xml b/ruoyi-admin/src/main/resources/mapper/netEwm/BNetMapper.xml index 874460b..38c7fe4 100644 --- a/ruoyi-admin/src/main/resources/mapper/netEwm/BNetMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/netEwm/BNetMapper.xml @@ -17,7 +17,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select id, net_name, wifi_name, wifi_pass, create_by, create_time, update_by, update_time, remark from b_net + select id, shanghu_id, wifi_name, wifi_pass, create_by, create_time, update_by, update_time, remark from b_net - + + + insert into b_net @@ -81,4 +88,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{id} + + delete + from b_net + where shanghu_id = #{id} + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/mapper/netEwm/BShanghuMapper.xml b/ruoyi-admin/src/main/resources/mapper/netEwm/BShanghuMapper.xml index 1abf7c2..8ad9364 100644 --- a/ruoyi-admin/src/main/resources/mapper/netEwm/BShanghuMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/netEwm/BShanghuMapper.xml @@ -84,6 +84,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where id = #{id} + + update b_shanghu set poster_id = #{posterId} where id in + + #{id} + + + + update b_shanghu + set poster_id = #{posterId} + + + city like concat('%', #{shanghuCity}, '%') + + + and pos_name like concat('%', #{shanghuName}, '%') + + + + delete from b_shanghu where id = #{id} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java index 53ad695..8791b71 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java @@ -1,10 +1,5 @@ package com.ruoyi.common.core.domain.entity; -import java.util.Date; -import java.util.List; -import javax.validation.constraints.*; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.annotation.Excel.ColumnType; import com.ruoyi.common.annotation.Excel.Type; @@ -12,313 +7,315 @@ import com.ruoyi.common.annotation.Excels; import com.ruoyi.common.core.domain.BaseEntity; import com.ruoyi.common.xss.Xss; +import javax.validation.constraints.Email; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Size; +import java.util.Arrays; +import java.util.Date; +import java.util.List; + /** * 用户对象 sys_user - * + * * @author ruoyi */ -public class SysUser extends BaseEntity -{ +public class SysUser extends BaseEntity { private static final long serialVersionUID = 1L; - /** 用户ID */ + /** + * 商户名称 + */ + @Excel(name = "商户名称") + private String posName; + /** + * 城市 + */ + @Excel(name = "城市") + private String city; + /** + * 地址信息 + */ + @Excel(name = "地址信息") + private String address; + /** + * 用户ID + */ @Excel(name = "用户序号", cellType = ColumnType.NUMERIC, prompt = "用户编号") private Long userId; - - /** 部门ID */ + /** + * 部门ID + */ @Excel(name = "部门编号", type = Type.IMPORT) private Long deptId; - - /** 用户账号 */ + /** + * 用户账号 + */ @Excel(name = "登录名称") private String userName; - - /** 用户昵称 */ + /** + * 用户昵称 + */ @Excel(name = "用户名称") private String nickName; - - /** 用户邮箱 */ + /** + * 用户邮箱 + */ @Excel(name = "用户邮箱") private String email; - - /** 手机号码 */ + /** + * 手机号码 + */ @Excel(name = "手机号码") private String phonenumber; - - /** 用户性别 */ + /** + * 用户性别 + */ @Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知") private String sex; - - /** 用户头像 */ + /** + * 用户头像 + */ private String avatar; - - /** 密码 */ + /** + * 密码 + */ private String password; - - /** 帐号状态(0正常 1停用) */ + /** + * 帐号状态(0正常 1停用) + */ @Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用") private String status; - - /** 删除标志(0代表存在 2代表删除) */ + /** + * 删除标志(0代表存在 2代表删除) + */ private String delFlag; - - /** 最后登录IP */ + /** + * 最后登录IP + */ @Excel(name = "最后登录IP", type = Type.EXPORT) private String loginIp; - - /** 最后登录时间 */ + /** + * 最后登录时间 + */ @Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT) private Date loginDate; - - /** 部门对象 */ - @Excels({ - @Excel(name = "部门名称", targetAttr = "deptName", type = Type.EXPORT), - @Excel(name = "部门负责人", targetAttr = "leader", type = Type.EXPORT) - }) + /** + * 部门对象 + */ + @Excels({@Excel(name = "部门名称", targetAttr = "deptName", type = Type.EXPORT), @Excel(name = "部门负责人", targetAttr = "leader", type = Type.EXPORT)}) private SysDept dept; - - /** 角色对象 */ + /** + * 角色对象 + */ private List roles; - - /** 角色组 */ + /** + * 角色组 + */ private Long[] roleIds; - - /** 岗位组 */ + /** + * 岗位组 + */ private Long[] postIds; - - /** 角色ID */ + /** + * 角色ID + */ private Long roleId; - public SysUser() - { + public SysUser() { } - public SysUser(Long userId) - { + public SysUser(Long userId) { this.userId = userId; } - public Long getUserId() - { + public static boolean isAdmin(Long userId) { + return userId != null && 1L == userId; + } + + public String getPosName() { + return posName; + } + + public void setPosName(String posName) { + this.posName = posName; + } + + + public String getCity() { + return city; + } + + public void setCity(String city) { + this.city = city; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public Long getUserId() { return userId; } - public void setUserId(Long userId) - { + public void setUserId(Long userId) { this.userId = userId; } - public boolean isAdmin() - { + public boolean isAdmin() { return isAdmin(this.userId); } - public static boolean isAdmin(Long userId) - { - return userId != null && 1L == userId; - } - - public Long getDeptId() - { + public Long getDeptId() { return deptId; } - public void setDeptId(Long deptId) - { + public void setDeptId(Long deptId) { this.deptId = deptId; } @Xss(message = "用户昵称不能包含脚本字符") @Size(min = 0, max = 30, message = "用户昵称长度不能超过30个字符") - public String getNickName() - { + public String getNickName() { return nickName; } - public void setNickName(String nickName) - { + public void setNickName(String nickName) { this.nickName = nickName; } @Xss(message = "用户账号不能包含脚本字符") @NotBlank(message = "用户账号不能为空") @Size(min = 0, max = 30, message = "用户账号长度不能超过30个字符") - public String getUserName() - { + public String getUserName() { return userName; } - public void setUserName(String userName) - { + public void setUserName(String userName) { this.userName = userName; } @Email(message = "邮箱格式不正确") @Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符") - public String getEmail() - { + public String getEmail() { return email; } - public void setEmail(String email) - { + public void setEmail(String email) { this.email = email; } @Size(min = 0, max = 11, message = "手机号码长度不能超过11个字符") - public String getPhonenumber() - { + public String getPhonenumber() { return phonenumber; } - public void setPhonenumber(String phonenumber) - { + public void setPhonenumber(String phonenumber) { this.phonenumber = phonenumber; } - public String getSex() - { + public String getSex() { return sex; } - public void setSex(String sex) - { + public void setSex(String sex) { this.sex = sex; } - public String getAvatar() - { + public String getAvatar() { return avatar; } - public void setAvatar(String avatar) - { + public void setAvatar(String avatar) { this.avatar = avatar; } - public String getPassword() - { + public String getPassword() { return password; } - public void setPassword(String password) - { + public void setPassword(String password) { this.password = password; } - public String getStatus() - { + public String getStatus() { return status; } - public void setStatus(String status) - { + public void setStatus(String status) { this.status = status; } - public String getDelFlag() - { + public String getDelFlag() { return delFlag; } - public void setDelFlag(String delFlag) - { + public void setDelFlag(String delFlag) { this.delFlag = delFlag; } - public String getLoginIp() - { + public String getLoginIp() { return loginIp; } - public void setLoginIp(String loginIp) - { + public void setLoginIp(String loginIp) { this.loginIp = loginIp; } - public Date getLoginDate() - { + public Date getLoginDate() { return loginDate; } - public void setLoginDate(Date loginDate) - { + public void setLoginDate(Date loginDate) { this.loginDate = loginDate; } - public SysDept getDept() - { + public SysDept getDept() { return dept; } - public void setDept(SysDept dept) - { + public void setDept(SysDept dept) { this.dept = dept; } - public List getRoles() - { + public List getRoles() { return roles; } - public void setRoles(List roles) - { + public void setRoles(List roles) { this.roles = roles; } - public Long[] getRoleIds() - { + public Long[] getRoleIds() { return roleIds; } - public void setRoleIds(Long[] roleIds) - { + public void setRoleIds(Long[] roleIds) { this.roleIds = roleIds; } - public Long[] getPostIds() - { + public Long[] getPostIds() { return postIds; } - public void setPostIds(Long[] postIds) - { + public void setPostIds(Long[] postIds) { this.postIds = postIds; } - public Long getRoleId() - { + public Long getRoleId() { return roleId; } - public void setRoleId(Long roleId) - { + public void setRoleId(Long roleId) { this.roleId = roleId; } @Override public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("userId", getUserId()) - .append("deptId", getDeptId()) - .append("userName", getUserName()) - .append("nickName", getNickName()) - .append("email", getEmail()) - .append("phonenumber", getPhonenumber()) - .append("sex", getSex()) - .append("avatar", getAvatar()) - .append("password", getPassword()) - .append("status", getStatus()) - .append("delFlag", getDelFlag()) - .append("loginIp", getLoginIp()) - .append("loginDate", getLoginDate()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("remark", getRemark()) - .append("dept", getDept()) - .toString(); + return "SysUser{" + "posName='" + posName + '\'' + ", city='" + city + '\'' + ", address='" + address + '\'' + ", userId=" + userId + ", deptId=" + deptId + ", userName='" + userName + '\'' + ", nickName='" + nickName + '\'' + ", email='" + email + '\'' + ", phonenumber='" + phonenumber + '\'' + ", sex='" + sex + '\'' + ", avatar='" + avatar + '\'' + ", password='" + password + '\'' + ", status='" + status + '\'' + ", delFlag='" + delFlag + '\'' + ", loginIp='" + loginIp + '\'' + ", loginDate=" + loginDate + ", dept=" + dept + ", roles=" + roles + ", roleIds=" + Arrays.toString(roleIds) + ", postIds=" + Arrays.toString(postIds) + ", roleId=" + roleId + '}'; } }