修改接口,添加接口

master
吴顺杰 2 years ago
parent 2e387f1394
commit 0130d1715d

@ -17,6 +17,22 @@
<dependencies> <dependencies>
<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.30</version>
<scope>provided</scope>
</dependency>
<!--hutool-->
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.8.23</version>
</dependency>
<!-- spring-boot-devtools --> <!-- spring-boot-devtools -->
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
@ -37,7 +53,7 @@
<version>1.6.2</version> <version>1.6.2</version>
</dependency> </dependency>
<!-- Mysql驱动包 --> <!-- Mysql驱动包 -->
<dependency> <dependency>
<groupId>mysql</groupId> <groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId> <artifactId>mysql-connector-java</artifactId>
@ -88,7 +104,7 @@
<failOnMissingWebXml>false</failOnMissingWebXml> <failOnMissingWebXml>false</failOnMissingWebXml>
<warName>${project.artifactId}</warName> <warName>${project.artifactId}</warName>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>
<finalName>${project.artifactId}</finalName> <finalName>${project.artifactId}</finalName>
</build> </build>

@ -9,12 +9,9 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
* *
* @author ruoyi * @author ruoyi
*/ */
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class }) @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
public class RuoYiApplication public class RuoYiApplication {
{ public static void main(String[] args) {
public static void main(String[] args)
{
// System.setProperty("spring.devtools.restart.enabled", "false");
SpringApplication.run(RuoYiApplication.class, args); SpringApplication.run(RuoYiApplication.class, args);
System.out.println("(♥◠‿◠)ノ゙ 若依启动成功 ლ(´ڡ`ლ)゙ \n" + System.out.println("(♥◠‿◠)ノ゙ 若依启动成功 ლ(´ڡ`ლ)゙ \n" +
" .-------. ____ __ \n" + " .-------. ____ __ \n" +

@ -8,11 +8,9 @@ import org.springframework.boot.web.servlet.support.SpringBootServletInitializer
* *
* @author ruoyi * @author ruoyi
*/ */
public class RuoYiServletInitializer extends SpringBootServletInitializer public class RuoYiServletInitializer extends SpringBootServletInitializer {
{
@Override @Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
{
return application.sources(RuoYiApplication.class); return application.sources(RuoYiApplication.class);
} }
} }

@ -1,25 +1,27 @@
package com.ruoyi.system.controller; package com.ruoyi.system.controller;
import java.util.List; import com.ruoyi.common.annotation.Log;
import javax.servlet.http.HttpServletResponse; 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.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.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping; 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.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController; import javax.annotation.Resource;
import com.ruoyi.common.core.domain.AjaxResult; import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.enums.BusinessType; import java.util.List;
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;
/** /**
* Controller * Controller
@ -29,9 +31,8 @@ import com.ruoyi.common.core.page.TableDataInfo;
*/ */
@RestController @RestController
@RequestMapping("/netEwm/net") @RequestMapping("/netEwm/net")
public class BNetController extends BaseController public class BNetController extends BaseController {
{ @Resource
@Autowired
private IBNetService bNetService; private IBNetService bNetService;
/** /**
@ -39,21 +40,33 @@ public class BNetController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('netEwm:net:list')") @PreAuthorize("@ss.hasPermi('netEwm:net:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(BNet bNet) public TableDataInfo list(BNet bNet) {
{
startPage(); startPage();
List<BNet> list = bNetService.selectBNetList(bNet); List<BNet> list = bNetService.selectBNetList(bNet);
return getDataTable(list); return getDataTable(list);
} }
/**
* idwifi()
*
* @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')") @PreAuthorize("@ss.hasPermi('netEwm:net:export')")
@Log(title = "网络", businessType = BusinessType.EXPORT) @Log(title = "网络", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, BNet bNet) public void export(HttpServletResponse response, BNet bNet) {
{
List<BNet> list = bNetService.selectBNetList(bNet); List<BNet> list = bNetService.selectBNetList(bNet);
ExcelUtil<BNet> util = new ExcelUtil<BNet>(BNet.class); ExcelUtil<BNet> util = new ExcelUtil<BNet>(BNet.class);
util.exportExcel(response, list, "网络数据"); util.exportExcel(response, list, "网络数据");
@ -64,8 +77,7 @@ public class BNetController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('netEwm:net:query')") @PreAuthorize("@ss.hasPermi('netEwm:net:query')")
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) public AjaxResult getInfo(@PathVariable("id") Long id) {
{
return success(bNetService.selectBNetById(id)); return success(bNetService.selectBNetById(id));
} }
@ -75,8 +87,7 @@ public class BNetController extends BaseController
@PreAuthorize("@ss.hasPermi('netEwm:net:add')") @PreAuthorize("@ss.hasPermi('netEwm:net:add')")
@Log(title = "网络", businessType = BusinessType.INSERT) @Log(title = "网络", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody BNet bNet) public AjaxResult add(@RequestBody BNet bNet) {
{
return toAjax(bNetService.insertBNet(bNet)); return toAjax(bNetService.insertBNet(bNet));
} }
@ -86,8 +97,7 @@ public class BNetController extends BaseController
@PreAuthorize("@ss.hasPermi('netEwm:net:edit')") @PreAuthorize("@ss.hasPermi('netEwm:net:edit')")
@Log(title = "网络", businessType = BusinessType.UPDATE) @Log(title = "网络", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody BNet bNet) public AjaxResult edit(@RequestBody BNet bNet) {
{
return toAjax(bNetService.updateBNet(bNet)); return toAjax(bNetService.updateBNet(bNet));
} }
@ -96,9 +106,8 @@ public class BNetController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('netEwm:net:remove')") @PreAuthorize("@ss.hasPermi('netEwm:net:remove')")
@Log(title = "网络", businessType = BusinessType.DELETE) @Log(title = "网络", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) public AjaxResult remove(@PathVariable Long[] ids) {
{
return toAjax(bNetService.deleteBNetByIds(ids)); return toAjax(bNetService.deleteBNetByIds(ids));
} }
} }

@ -1,25 +1,26 @@
package com.ruoyi.system.controller; package com.ruoyi.system.controller;
import java.util.List; import com.ruoyi.common.annotation.Log;
import javax.servlet.http.HttpServletResponse; 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.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.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping; 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.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController; import javax.annotation.Resource;
import com.ruoyi.common.core.domain.AjaxResult; import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.enums.BusinessType; import java.util.List;
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;
/** /**
* Controller * Controller
@ -29,9 +30,8 @@ import com.ruoyi.common.core.page.TableDataInfo;
*/ */
@RestController @RestController
@RequestMapping("/netEwm/netHistory") @RequestMapping("/netEwm/netHistory")
public class BNetHistoryController extends BaseController public class BNetHistoryController extends BaseController {
{ @Resource
@Autowired
private IBNetHistoryService bNetHistoryService; private IBNetHistoryService bNetHistoryService;
/** /**
@ -39,8 +39,7 @@ public class BNetHistoryController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('netEwm:netHistory:list')") @PreAuthorize("@ss.hasPermi('netEwm:netHistory:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(BNetHistory bNetHistory) public TableDataInfo list(BNetHistory bNetHistory) {
{
startPage(); startPage();
List<BNetHistory> list = bNetHistoryService.selectBNetHistoryList(bNetHistory); List<BNetHistory> list = bNetHistoryService.selectBNetHistoryList(bNetHistory);
return getDataTable(list); return getDataTable(list);
@ -52,8 +51,7 @@ public class BNetHistoryController extends BaseController
@PreAuthorize("@ss.hasPermi('netEwm:netHistory:export')") @PreAuthorize("@ss.hasPermi('netEwm:netHistory:export')")
@Log(title = "连网历史", businessType = BusinessType.EXPORT) @Log(title = "连网历史", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, BNetHistory bNetHistory) public void export(HttpServletResponse response, BNetHistory bNetHistory) {
{
List<BNetHistory> list = bNetHistoryService.selectBNetHistoryList(bNetHistory); List<BNetHistory> list = bNetHistoryService.selectBNetHistoryList(bNetHistory);
ExcelUtil<BNetHistory> util = new ExcelUtil<BNetHistory>(BNetHistory.class); ExcelUtil<BNetHistory> util = new ExcelUtil<BNetHistory>(BNetHistory.class);
util.exportExcel(response, list, "连网历史数据"); util.exportExcel(response, list, "连网历史数据");
@ -64,8 +62,7 @@ public class BNetHistoryController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('netEwm:netHistory:query')") @PreAuthorize("@ss.hasPermi('netEwm:netHistory:query')")
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) public AjaxResult getInfo(@PathVariable("id") Long id) {
{
return success(bNetHistoryService.selectBNetHistoryById(id)); return success(bNetHistoryService.selectBNetHistoryById(id));
} }
@ -75,8 +72,7 @@ public class BNetHistoryController extends BaseController
@PreAuthorize("@ss.hasPermi('netEwm:netHistory:add')") @PreAuthorize("@ss.hasPermi('netEwm:netHistory:add')")
@Log(title = "连网历史", businessType = BusinessType.INSERT) @Log(title = "连网历史", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody BNetHistory bNetHistory) public AjaxResult add(@RequestBody BNetHistory bNetHistory) {
{
return toAjax(bNetHistoryService.insertBNetHistory(bNetHistory)); return toAjax(bNetHistoryService.insertBNetHistory(bNetHistory));
} }
@ -86,8 +82,7 @@ public class BNetHistoryController extends BaseController
@PreAuthorize("@ss.hasPermi('netEwm:netHistory:edit')") @PreAuthorize("@ss.hasPermi('netEwm:netHistory:edit')")
@Log(title = "连网历史", businessType = BusinessType.UPDATE) @Log(title = "连网历史", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody BNetHistory bNetHistory) public AjaxResult edit(@RequestBody BNetHistory bNetHistory) {
{
return toAjax(bNetHistoryService.updateBNetHistory(bNetHistory)); return toAjax(bNetHistoryService.updateBNetHistory(bNetHistory));
} }
@ -96,9 +91,8 @@ public class BNetHistoryController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('netEwm:netHistory:remove')") @PreAuthorize("@ss.hasPermi('netEwm:netHistory:remove')")
@Log(title = "连网历史", businessType = BusinessType.DELETE) @Log(title = "连网历史", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) public AjaxResult remove(@PathVariable Long[] ids) {
{
return toAjax(bNetHistoryService.deleteBNetHistoryByIds(ids)); return toAjax(bNetHistoryService.deleteBNetHistoryByIds(ids));
} }
} }

@ -1,25 +1,29 @@
package com.ruoyi.system.controller; package com.ruoyi.system.controller;
import java.util.List; import com.ruoyi.common.annotation.Log;
import javax.servlet.http.HttpServletResponse; 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.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.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping; 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.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController; import javax.annotation.Resource;
import com.ruoyi.common.core.domain.AjaxResult; import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.enums.BusinessType; import javax.validation.Valid;
import com.ruoyi.system.domain.BPoster; import java.util.List;
import com.ruoyi.system.service.IBPosterService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/** /**
* 广Controller * 广Controller
@ -29,9 +33,8 @@ import com.ruoyi.common.core.page.TableDataInfo;
*/ */
@RestController @RestController
@RequestMapping("/netEwm/poster") @RequestMapping("/netEwm/poster")
public class BPosterController extends BaseController public class BPosterController extends BaseController {
{ @Resource
@Autowired
private IBPosterService bPosterService; private IBPosterService bPosterService;
/** /**
@ -39,8 +42,7 @@ public class BPosterController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('netEwm:poster:list')") @PreAuthorize("@ss.hasPermi('netEwm:poster:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(BPoster bPoster) public TableDataInfo list(BPoster bPoster) {
{
startPage(); startPage();
List<BPoster> list = bPosterService.selectBPosterList(bPoster); List<BPoster> list = bPosterService.selectBPosterList(bPoster);
return getDataTable(list); return getDataTable(list);
@ -52,8 +54,7 @@ public class BPosterController extends BaseController
@PreAuthorize("@ss.hasPermi('netEwm:poster:export')") @PreAuthorize("@ss.hasPermi('netEwm:poster:export')")
@Log(title = "广告", businessType = BusinessType.EXPORT) @Log(title = "广告", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, BPoster bPoster) public void export(HttpServletResponse response, BPoster bPoster) {
{
List<BPoster> list = bPosterService.selectBPosterList(bPoster); List<BPoster> list = bPosterService.selectBPosterList(bPoster);
ExcelUtil<BPoster> util = new ExcelUtil<BPoster>(BPoster.class); ExcelUtil<BPoster> util = new ExcelUtil<BPoster>(BPoster.class);
util.exportExcel(response, list, "广告数据"); util.exportExcel(response, list, "广告数据");
@ -64,8 +65,7 @@ public class BPosterController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('netEwm:poster:query')") @PreAuthorize("@ss.hasPermi('netEwm:poster:query')")
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) public AjaxResult getInfo(@PathVariable("id") Long id) {
{
return success(bPosterService.selectBPosterById(id)); return success(bPosterService.selectBPosterById(id));
} }
@ -75,19 +75,30 @@ public class BPosterController extends BaseController
@PreAuthorize("@ss.hasPermi('netEwm:poster:add')") @PreAuthorize("@ss.hasPermi('netEwm:poster:add')")
@Log(title = "广告", businessType = BusinessType.INSERT) @Log(title = "广告", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody BPoster bPoster) public AjaxResult add(@RequestBody BPoster bPoster) {
{
return toAjax(bPosterService.insertBPoster(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')") @PreAuthorize("@ss.hasPermi('netEwm:poster:edit')")
@Log(title = "广告", businessType = BusinessType.UPDATE) @Log(title = "广告", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody BPoster bPoster) public AjaxResult edit(@RequestBody BPoster bPoster) {
{
return toAjax(bPosterService.updateBPoster(bPoster)); return toAjax(bPosterService.updateBPoster(bPoster));
} }
@ -96,9 +107,8 @@ public class BPosterController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('netEwm:poster:remove')") @PreAuthorize("@ss.hasPermi('netEwm:poster:remove')")
@Log(title = "广告", businessType = BusinessType.DELETE) @Log(title = "广告", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) public AjaxResult remove(@PathVariable Long[] ids) {
{
return toAjax(bPosterService.deleteBPosterByIds(ids)); return toAjax(bPosterService.deleteBPosterByIds(ids));
} }
} }

@ -1,25 +1,26 @@
package com.ruoyi.system.controller; package com.ruoyi.system.controller;
import java.util.List; import com.ruoyi.common.annotation.Log;
import javax.servlet.http.HttpServletResponse; 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.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.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping; 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.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController; import javax.annotation.Resource;
import com.ruoyi.common.core.domain.AjaxResult; import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.enums.BusinessType; import java.util.List;
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;
/** /**
* 广Controller * 广Controller
@ -29,9 +30,8 @@ import com.ruoyi.common.core.page.TableDataInfo;
*/ */
@RestController @RestController
@RequestMapping("/netEwm/posterHistory") @RequestMapping("/netEwm/posterHistory")
public class BPosterHistoryController extends BaseController public class BPosterHistoryController extends BaseController {
{ @Resource
@Autowired
private IBPosterHistoryService bPosterHistoryService; private IBPosterHistoryService bPosterHistoryService;
/** /**
@ -39,8 +39,7 @@ public class BPosterHistoryController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('netEwm:posterHistory:list')") @PreAuthorize("@ss.hasPermi('netEwm:posterHistory:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(BPosterHistory bPosterHistory) public TableDataInfo list(BPosterHistory bPosterHistory) {
{
startPage(); startPage();
List<BPosterHistory> list = bPosterHistoryService.selectBPosterHistoryList(bPosterHistory); List<BPosterHistory> list = bPosterHistoryService.selectBPosterHistoryList(bPosterHistory);
return getDataTable(list); return getDataTable(list);
@ -52,8 +51,7 @@ public class BPosterHistoryController extends BaseController
@PreAuthorize("@ss.hasPermi('netEwm:posterHistory:export')") @PreAuthorize("@ss.hasPermi('netEwm:posterHistory:export')")
@Log(title = "广告历史", businessType = BusinessType.EXPORT) @Log(title = "广告历史", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, BPosterHistory bPosterHistory) public void export(HttpServletResponse response, BPosterHistory bPosterHistory) {
{
List<BPosterHistory> list = bPosterHistoryService.selectBPosterHistoryList(bPosterHistory); List<BPosterHistory> list = bPosterHistoryService.selectBPosterHistoryList(bPosterHistory);
ExcelUtil<BPosterHistory> util = new ExcelUtil<BPosterHistory>(BPosterHistory.class); ExcelUtil<BPosterHistory> util = new ExcelUtil<BPosterHistory>(BPosterHistory.class);
util.exportExcel(response, list, "广告历史数据"); util.exportExcel(response, list, "广告历史数据");
@ -64,8 +62,7 @@ public class BPosterHistoryController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('netEwm:posterHistory:query')") @PreAuthorize("@ss.hasPermi('netEwm:posterHistory:query')")
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) public AjaxResult getInfo(@PathVariable("id") Long id) {
{
return success(bPosterHistoryService.selectBPosterHistoryById(id)); return success(bPosterHistoryService.selectBPosterHistoryById(id));
} }
@ -75,8 +72,7 @@ public class BPosterHistoryController extends BaseController
@PreAuthorize("@ss.hasPermi('netEwm:posterHistory:add')") @PreAuthorize("@ss.hasPermi('netEwm:posterHistory:add')")
@Log(title = "广告历史", businessType = BusinessType.INSERT) @Log(title = "广告历史", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody BPosterHistory bPosterHistory) public AjaxResult add(@RequestBody BPosterHistory bPosterHistory) {
{
return toAjax(bPosterHistoryService.insertBPosterHistory(bPosterHistory)); return toAjax(bPosterHistoryService.insertBPosterHistory(bPosterHistory));
} }
@ -86,8 +82,7 @@ public class BPosterHistoryController extends BaseController
@PreAuthorize("@ss.hasPermi('netEwm:posterHistory:edit')") @PreAuthorize("@ss.hasPermi('netEwm:posterHistory:edit')")
@Log(title = "广告历史", businessType = BusinessType.UPDATE) @Log(title = "广告历史", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody BPosterHistory bPosterHistory) public AjaxResult edit(@RequestBody BPosterHistory bPosterHistory) {
{
return toAjax(bPosterHistoryService.updateBPosterHistory(bPosterHistory)); return toAjax(bPosterHistoryService.updateBPosterHistory(bPosterHistory));
} }
@ -96,9 +91,8 @@ public class BPosterHistoryController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('netEwm:posterHistory:remove')") @PreAuthorize("@ss.hasPermi('netEwm:posterHistory:remove')")
@Log(title = "广告历史", businessType = BusinessType.DELETE) @Log(title = "广告历史", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) public AjaxResult remove(@PathVariable Long[] ids) {
{
return toAjax(bPosterHistoryService.deleteBPosterHistoryByIds(ids)); return toAjax(bPosterHistoryService.deleteBPosterHistoryByIds(ids));
} }
} }

@ -1,25 +1,26 @@
package com.ruoyi.system.controller; package com.ruoyi.system.controller;
import java.util.List; import com.ruoyi.common.annotation.Log;
import javax.servlet.http.HttpServletResponse; 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.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.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping; 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.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController; import javax.annotation.Resource;
import com.ruoyi.common.core.domain.AjaxResult; import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.enums.BusinessType; import java.util.List;
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;
/** /**
* Controller * Controller
@ -29,9 +30,8 @@ import com.ruoyi.common.core.page.TableDataInfo;
*/ */
@RestController @RestController
@RequestMapping("/netEwm/shanghu") @RequestMapping("/netEwm/shanghu")
public class BShanghuController extends BaseController public class BShanghuController extends BaseController {
{ @Resource
@Autowired
private IBShanghuService bShanghuService; private IBShanghuService bShanghuService;
/** /**
@ -39,8 +39,7 @@ public class BShanghuController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('netEwm:shanghu:list')") @PreAuthorize("@ss.hasPermi('netEwm:shanghu:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(BShanghu bShanghu) public TableDataInfo list(BShanghu bShanghu) {
{
startPage(); startPage();
List<BShanghu> list = bShanghuService.selectBShanghuList(bShanghu); List<BShanghu> list = bShanghuService.selectBShanghuList(bShanghu);
return getDataTable(list); return getDataTable(list);
@ -52,8 +51,7 @@ public class BShanghuController extends BaseController
@PreAuthorize("@ss.hasPermi('netEwm:shanghu:export')") @PreAuthorize("@ss.hasPermi('netEwm:shanghu:export')")
@Log(title = "商户", businessType = BusinessType.EXPORT) @Log(title = "商户", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, BShanghu bShanghu) public void export(HttpServletResponse response, BShanghu bShanghu) {
{
List<BShanghu> list = bShanghuService.selectBShanghuList(bShanghu); List<BShanghu> list = bShanghuService.selectBShanghuList(bShanghu);
ExcelUtil<BShanghu> util = new ExcelUtil<BShanghu>(BShanghu.class); ExcelUtil<BShanghu> util = new ExcelUtil<BShanghu>(BShanghu.class);
util.exportExcel(response, list, "商户数据"); util.exportExcel(response, list, "商户数据");
@ -64,8 +62,7 @@ public class BShanghuController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('netEwm:shanghu:query')") @PreAuthorize("@ss.hasPermi('netEwm:shanghu:query')")
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) public AjaxResult getInfo(@PathVariable("id") Long id) {
{
return success(bShanghuService.selectBShanghuById(id)); return success(bShanghuService.selectBShanghuById(id));
} }
@ -75,8 +72,7 @@ public class BShanghuController extends BaseController
@PreAuthorize("@ss.hasPermi('netEwm:shanghu:add')") @PreAuthorize("@ss.hasPermi('netEwm:shanghu:add')")
@Log(title = "商户", businessType = BusinessType.INSERT) @Log(title = "商户", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody BShanghu bShanghu) public AjaxResult add(@RequestBody BShanghu bShanghu) {
{
return toAjax(bShanghuService.insertBShanghu(bShanghu)); return toAjax(bShanghuService.insertBShanghu(bShanghu));
} }
@ -86,8 +82,7 @@ public class BShanghuController extends BaseController
@PreAuthorize("@ss.hasPermi('netEwm:shanghu:edit')") @PreAuthorize("@ss.hasPermi('netEwm:shanghu:edit')")
@Log(title = "商户", businessType = BusinessType.UPDATE) @Log(title = "商户", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody BShanghu bShanghu) public AjaxResult edit(@RequestBody BShanghu bShanghu) {
{
return toAjax(bShanghuService.updateBShanghu(bShanghu)); return toAjax(bShanghuService.updateBShanghu(bShanghu));
} }
@ -96,9 +91,8 @@ public class BShanghuController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('netEwm:shanghu:remove')") @PreAuthorize("@ss.hasPermi('netEwm:shanghu:remove')")
@Log(title = "商户", businessType = BusinessType.DELETE) @Log(title = "商户", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) public AjaxResult remove(@PathVariable Long[] ids) {
{
return toAjax(bShanghuService.deleteBShanghuByIds(ids)); return toAjax(bShanghuService.deleteBShanghuByIds(ids));
} }
} }

@ -1,7 +1,5 @@
package com.ruoyi.system.domain; 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.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity; import com.ruoyi.common.core.domain.BaseEntity;
@ -11,74 +9,96 @@ import com.ruoyi.common.core.domain.BaseEntity;
* @author ruoyi * @author ruoyi
* @date 2023-11-21 * @date 2023-11-21
*/ */
public class BNet extends BaseEntity public class BNet extends BaseEntity {
{
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** $column.columnComment */ /**
* $column.columnComment
*/
private Long id; private Long id;
/** 网络名称 */ /**
* id
*/
private Long shanghuId;
/**
*
*/
@Excel(name = "网络名称") @Excel(name = "网络名称")
private String netName; private String netName;
/** wifi名称 */ /**
* wifi
*/
@Excel(name = "wifi名称") @Excel(name = "wifi名称")
private String wifiName; private String wifiName;
/** wifi密码 */ /**
* wifi
*/
@Excel(name = "wifi密码") @Excel(name = "wifi密码")
private String wifiPass; 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.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; return id;
} }
public void setNetName(String netName)
{ public void setId(Long id) {
this.netName = netName; this.id = id;
} }
public String getNetName() public Long getShanghuId() {
{ return shanghuId;
}
public void setShanghuId(Long shanghuId) {
this.shanghuId = shanghuId;
}
public String getNetName() {
return netName; return netName;
} }
public void setWifiName(String wifiName)
{ public void setNetName(String netName) {
this.wifiName = wifiName; this.netName = netName;
} }
public String getWifiName() public String getWifiName() {
{
return wifiName; return wifiName;
} }
public void setWifiPass(String wifiPass)
{ public void setWifiName(String wifiName) {
this.wifiPass = wifiPass; this.wifiName = wifiName;
} }
public String getWifiPass() public String getWifiPass() {
{
return wifiPass; return wifiPass;
} }
@Override public void setWifiPass(String wifiPass) {
public String toString() { this.wifiPass = wifiPass;
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();
} }
} }

@ -1,7 +1,5 @@
package com.ruoyi.system.domain; 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.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity; import com.ruoyi.common.core.domain.BaseEntity;
@ -11,102 +9,121 @@ import com.ruoyi.common.core.domain.BaseEntity;
* @author ruoyi * @author ruoyi
* @date 2023-11-21 * @date 2023-11-21
*/ */
public class BNetHistory extends BaseEntity public class BNetHistory extends BaseEntity {
{
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** $column.columnComment */ /**
* $column.columnComment
*/
private Long id; private Long id;
/** 是否连接成功 */ /**
* id
*/
private Long shanghuId;
/**
*
*/
@Excel(name = "是否连接成功") @Excel(name = "是否连接成功")
private Long isTrue; private Long isTrue;
/** 网络id */ /**
* id
*/
@Excel(name = "网络id") @Excel(name = "网络id")
private Long netId; private Long netId;
/** 网络名称 */ /**
*
*/
@Excel(name = "网络名称") @Excel(name = "网络名称")
private String netName; private String netName;
/** wifi名称 */ /**
* wifi
*/
@Excel(name = "wifi名称") @Excel(name = "wifi名称")
private String wifiName; private String wifiName;
/** wifi密码 */ /**
* wifi
*/
@Excel(name = "wifi密码") @Excel(name = "wifi密码")
private String wifiPass; 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.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; return id;
} }
public void setIsTrue(Long isTrue)
{ public void setId(Long id) {
this.isTrue = isTrue; this.id = id;
} }
public Long getIsTrue() public Long getIsTrue() {
{
return isTrue; return isTrue;
} }
public void setNetId(Long netId)
{ public void setIsTrue(Long isTrue) {
this.netId = netId; this.isTrue = isTrue;
} }
public Long getNetId() public Long getNetId() {
{
return netId; return netId;
} }
public void setNetName(String netName)
{ public void setNetId(Long netId) {
this.netName = netName; this.netId = netId;
} }
public String getNetName() public String getNetName() {
{
return netName; return netName;
} }
public void setWifiName(String wifiName)
{ public void setNetName(String netName) {
this.wifiName = wifiName; this.netName = netName;
} }
public String getWifiName() public String getWifiName() {
{
return wifiName; return wifiName;
} }
public void setWifiPass(String wifiPass)
{ public void setWifiName(String wifiName) {
this.wifiPass = wifiPass; this.wifiName = wifiName;
} }
public String getWifiPass() public String getWifiPass() {
{
return wifiPass; return wifiPass;
} }
public void setWifiPass(String wifiPass) {
this.wifiPass = wifiPass;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return "BNetHistory{" + "id=" + id + ", shanghuId=" + shanghuId + ", isTrue=" + isTrue + ", netId=" + netId + ", netName='" + netName + '\'' + ", wifiName='" + wifiName + '\'' + ", wifiPass='" + wifiPass + '\'' + '}';
.append("id", getId()) }
.append("isTrue", getIsTrue())
.append("netId", getNetId()) public Long getShanghuId() {
.append("netName", getNetName()) return shanghuId;
.append("wifiName", getWifiName()) }
.append("wifiPass", getWifiPass())
.append("createBy", getCreateBy()) public void setShanghuId(Long shanghuId) {
.append("createTime", getCreateTime()) this.shanghuId = shanghuId;
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
} }
} }

@ -1,130 +1,148 @@
package com.ruoyi.system.domain; package com.ruoyi.system.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat; 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.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity; import com.ruoyi.common.core.domain.BaseEntity;
import java.util.Date;
/** /**
* 广 b_poster_history * 广 b_poster_history
* *
* @author ruoyi * @author ruoyi
* @date 2023-11-21 * @date 2023-11-21
*/ */
public class BPosterHistory extends BaseEntity public class BPosterHistory extends BaseEntity {
{
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** $column.columnComment */ /**
* $column.columnComment
*/
private Long id; private Long id;
/** 广告id */ /**
* id
*/
private Long shanghuId;
/**
* 广id
*/
@Excel(name = "广告id") @Excel(name = "广告id")
private Long posterId; private Long posterId;
/** 广告名称 */ /**
* 广
*/
@Excel(name = "广告名称") @Excel(name = "广告名称")
private String posterName; private String posterName;
/** 有效起始时间 */ /**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "有效起始时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "有效起始时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date startTime; private Date startTime;
/** 有效结束时间 */ /**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "有效结束时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "有效结束时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date endTime; private Date endTime;
/** 视频路径 */ /**
*
*/
@Excel(name = "视频路径") @Excel(name = "视频路径")
private String videoPath; private String videoPath;
/** 视频封面 */ /**
*
*/
@Excel(name = "视频封面") @Excel(name = "视频封面")
private String videoLogo; 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.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; return id;
} }
public void setPosterId(Long posterId)
{ public void setId(Long id) {
this.posterId = posterId; this.id = id;
} }
public Long getPosterId() public Long getPosterId() {
{
return posterId; return posterId;
} }
public void setPosterName(String posterName)
{ public void setPosterId(Long posterId) {
this.posterName = posterName; this.posterId = posterId;
} }
public String getPosterName() public String getPosterName() {
{
return posterName; return posterName;
} }
public void setStartTime(Date startTime)
{ public void setPosterName(String posterName) {
this.startTime = startTime; this.posterName = posterName;
} }
public Date getStartTime() public Date getStartTime() {
{
return startTime; return startTime;
} }
public void setEndTime(Date endTime)
{ public void setStartTime(Date startTime) {
this.endTime = endTime; this.startTime = startTime;
} }
public Date getEndTime() public Date getEndTime() {
{
return endTime; return endTime;
} }
public void setVideoPath(String videoPath)
{ public void setEndTime(Date endTime) {
this.videoPath = videoPath; this.endTime = endTime;
} }
public String getVideoPath() public String getVideoPath() {
{
return videoPath; return videoPath;
} }
public void setVideoLogo(String videoLogo)
{ public void setVideoPath(String videoPath) {
this.videoLogo = videoLogo; this.videoPath = videoPath;
} }
public String getVideoLogo() public String getVideoLogo() {
{
return videoLogo; return videoLogo;
} }
public void setVideoLogo(String videoLogo) {
this.videoLogo = videoLogo;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return "BPosterHistory{" + "id=" + id + ", shanghuId=" + shanghuId + ", posterId=" + posterId + ", posterName='" + posterName + '\'' + ", startTime=" + startTime + ", endTime=" + endTime + ", videoPath='" + videoPath + '\'' + ", videoLogo='" + videoLogo + '\'' + '}';
.append("id", getId()) }
.append("posterId", getPosterId())
.append("posterName", getPosterName()) public Long getShanghuId() {
.append("startTime", getStartTime()) return shanghuId;
.append("endTime", getEndTime()) }
.append("videoPath", getVideoPath())
.append("videoLogo", getVideoLogo()) public void setShanghuId(Long shanghuId) {
.append("createBy", getCreateBy()) this.shanghuId = shanghuId;
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
} }
} }

@ -1,9 +1,9 @@
package com.ruoyi.system.domain; 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.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity; import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/** /**
* b_shanghu * b_shanghu
@ -11,116 +11,121 @@ import com.ruoyi.common.core.domain.BaseEntity;
* @author ruoyi * @author ruoyi
* @date 2023-11-21 * @date 2023-11-21
*/ */
public class BShanghu extends BaseEntity public class BShanghu extends BaseEntity {
{
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** $column.columnComment */ /**
* $column.columnComment
*/
private Long id; private Long id;
/** 商户名称 */ /**
*
*/
@Excel(name = "商户名称") @Excel(name = "商户名称")
private String posName; private String posName;
/** 手机号 */ /**
*
*/
@Excel(name = "手机号") @Excel(name = "手机号")
private String phoneNumber; private String phoneNumber;
/** 联系人 */ /**
*
*/
@Excel(name = "联系人") @Excel(name = "联系人")
private String linkMan; private String linkMan;
/** 城市 */ /**
*
*/
@Excel(name = "城市") @Excel(name = "城市")
private String city; private String city;
/** 地址信息 */ /**
*
*/
@Excel(name = "地址信息") @Excel(name = "地址信息")
private String address; private String address;
/** 广告标识 */ /**
* 广
*/
@Excel(name = "广告标识") @Excel(name = "广告标识")
private Long posterId; private Long posterId;
public void setId(Long id) public Long getId() {
{
this.id = id;
}
public Long getId()
{
return id; return id;
} }
public void setPosName(String posName)
{ public void setId(Long id) {
this.posName = posName; this.id = id;
} }
public String getPosName() public String getPosName() {
{
return posName; return posName;
} }
public void setPhoneNumber(String phoneNumber)
{ public void setPosName(String posName) {
this.phoneNumber = phoneNumber; this.posName = posName;
} }
public String getPhoneNumber() public String getPhoneNumber() {
{
return phoneNumber; return phoneNumber;
} }
public void setLinkMan(String linkMan)
{ public void setPhoneNumber(String phoneNumber) {
this.linkMan = linkMan; this.phoneNumber = phoneNumber;
} }
public String getLinkMan() public String getLinkMan() {
{
return linkMan; return linkMan;
} }
public void setCity(String city)
{ public void setLinkMan(String linkMan) {
this.city = city; this.linkMan = linkMan;
} }
public String getCity() public String getCity() {
{
return city; return city;
} }
public void setAddress(String address)
{ public void setCity(String city) {
this.address = address; this.city = city;
} }
public String getAddress() public String getAddress() {
{
return address; return address;
} }
public void setPosterId(Long posterId)
{ public void setAddress(String address) {
this.posterId = posterId; this.address = address;
} }
public Long getPosterId() public Long getPosterId() {
{
return posterId; return posterId;
} }
public void setPosterId(Long posterId) {
this.posterId = posterId;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId()) .append("id", getId())
.append("posName", getPosName()) .append("posName", getPosName())
.append("phoneNumber", getPhoneNumber()) .append("phoneNumber", getPhoneNumber())
.append("linkMan", getLinkMan()) .append("linkMan", getLinkMan())
.append("city", getCity()) .append("city", getCity())
.append("address", getAddress()) .append("address", getAddress())
.append("posterId", getPosterId()) .append("posterId", getPosterId())
.append("createBy", getCreateBy()) .append("createBy", getCreateBy())
.append("createTime", getCreateTime()) .append("createTime", getCreateTime())
.append("updateBy", getUpdateBy()) .append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime()) .append("updateTime", getUpdateTime())
.append("remark", getRemark()) .append("remark", getRemark())
.toString(); .toString();
} }
} }

@ -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<Long> shanghuIds;
/**
*
*/
@ApiModelProperty(value = "商户城市")
private String shanghuCity;
/**
*
*/
@ApiModelProperty(value = "商户名称")
private String shanghuName;
}

@ -1,7 +1,9 @@
package com.ruoyi.system.mapper; package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.system.domain.BNet; import com.ruoyi.system.domain.BNet;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* Mapper * Mapper
@ -9,15 +11,14 @@ import com.ruoyi.system.domain.BNet;
* @author ruoyi * @author ruoyi
* @date 2023-11-21 * @date 2023-11-21
*/ */
public interface BNetMapper public interface BNetMapper {
{
/** /**
* *
* *
* @param id * @param id
* @return * @return
*/ */
public BNet selectBNetById(Long id); BNet selectBNetById(Long id);
/** /**
* *
@ -25,7 +26,7 @@ public interface BNetMapper
* @param bNet * @param bNet
* @return * @return
*/ */
public List<BNet> selectBNetList(BNet bNet); List<BNet> selectBNetList(BNet bNet);
/** /**
* *
@ -33,7 +34,7 @@ public interface BNetMapper
* @param bNet * @param bNet
* @return * @return
*/ */
public int insertBNet(BNet bNet); int insertBNet(BNet bNet);
/** /**
* *
@ -41,7 +42,7 @@ public interface BNetMapper
* @param bNet * @param bNet
* @return * @return
*/ */
public int updateBNet(BNet bNet); int updateBNet(BNet bNet);
/** /**
* *
@ -49,7 +50,7 @@ public interface BNetMapper
* @param id * @param id
* @return * @return
*/ */
public int deleteBNetById(Long id); int deleteBNetById(Long id);
/** /**
* *
@ -57,5 +58,21 @@ public interface BNetMapper
* @param ids * @param ids
* @return * @return
*/ */
public int deleteBNetByIds(Long[] ids); int deleteBNetByIds(Long[] ids);
/**
* idwifi
*
* @param id id
*/
void deleteBNetByShangHuId(Long id);
/**
* idwifi
*
* @param shanghuId id
* @return wifi
*/
BNet findByShanghuId(@Param("shanghuId") Long shanghuId);
} }

@ -1,7 +1,9 @@
package com.ruoyi.system.mapper; package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.system.domain.BShanghu; import com.ruoyi.system.domain.BShanghu;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* Mapper * Mapper
@ -9,15 +11,14 @@ import com.ruoyi.system.domain.BShanghu;
* @author ruoyi * @author ruoyi
* @date 2023-11-21 * @date 2023-11-21
*/ */
public interface BShanghuMapper public interface BShanghuMapper {
{
/** /**
* *
* *
* @param id * @param id
* @return * @return
*/ */
public BShanghu selectBShanghuById(Long id); BShanghu selectBShanghuById(Long id);
/** /**
* *
@ -25,7 +26,7 @@ public interface BShanghuMapper
* @param bShanghu * @param bShanghu
* @return * @return
*/ */
public List<BShanghu> selectBShanghuList(BShanghu bShanghu); List<BShanghu> selectBShanghuList(BShanghu bShanghu);
/** /**
* *
@ -33,7 +34,7 @@ public interface BShanghuMapper
* @param bShanghu * @param bShanghu
* @return * @return
*/ */
public int insertBShanghu(BShanghu bShanghu); int insertBShanghu(BShanghu bShanghu);
/** /**
* *
@ -41,7 +42,7 @@ public interface BShanghuMapper
* @param bShanghu * @param bShanghu
* @return * @return
*/ */
public int updateBShanghu(BShanghu bShanghu); int updateBShanghu(BShanghu bShanghu);
/** /**
* *
@ -49,7 +50,7 @@ public interface BShanghuMapper
* @param id * @param id
* @return * @return
*/ */
public int deleteBShanghuById(Long id); int deleteBShanghuById(Long id);
/** /**
* *
@ -57,5 +58,22 @@ public interface BShanghuMapper
* @param ids * @param ids
* @return * @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<Long> list);
/**
* 广
*
* @param posterId 广id
* @param shanghuCity
* @param shanghuName
*/
void editPostIdByReq(@Param("posterId") Long posterId, @Param("shanghuCity") String shanghuCity, @Param("shanghuName") String shanghuName);
} }

@ -1,23 +1,23 @@
package com.ruoyi.system.service; package com.ruoyi.system.service;
import java.util.List;
import com.ruoyi.system.domain.BNet; import com.ruoyi.system.domain.BNet;
import java.util.List;
/** /**
* Service * Service
* *
* @author ruoyi * @author ruoyi
* @date 2023-11-21 * @date 2023-11-21
*/ */
public interface IBNetService public interface IBNetService {
{
/** /**
* *
* *
* @param id * @param id
* @return * @return
*/ */
public BNet selectBNetById(Long id); BNet selectBNetById(Long id);
/** /**
* *
@ -25,7 +25,7 @@ public interface IBNetService
* @param bNet * @param bNet
* @return * @return
*/ */
public List<BNet> selectBNetList(BNet bNet); List<BNet> selectBNetList(BNet bNet);
/** /**
* *
@ -33,7 +33,7 @@ public interface IBNetService
* @param bNet * @param bNet
* @return * @return
*/ */
public int insertBNet(BNet bNet); int insertBNet(BNet bNet);
/** /**
* *
@ -41,7 +41,7 @@ public interface IBNetService
* @param bNet * @param bNet
* @return * @return
*/ */
public int updateBNet(BNet bNet); int updateBNet(BNet bNet);
/** /**
* *
@ -49,7 +49,7 @@ public interface IBNetService
* @param ids * @param ids
* @return * @return
*/ */
public int deleteBNetByIds(Long[] ids); int deleteBNetByIds(Long[] ids);
/** /**
* *
@ -57,5 +57,20 @@ public interface IBNetService
* @param id * @param id
* @return * @return
*/ */
public int deleteBNetById(Long id); int deleteBNetById(Long id);
/**
* idwifi
*
* @param id id
*/
void deleteBNetByShangHuId(Long id);
/**
* idwifi()
*
* @param id id
* @return wifi
*/
BNet findById(Long id);
} }

@ -1,7 +1,9 @@
package com.ruoyi.system.service; package com.ruoyi.system.service;
import java.util.List;
import com.ruoyi.system.domain.BPoster; import com.ruoyi.system.domain.BPoster;
import com.ruoyi.system.domain.dto.request.PosterRequest;
import java.util.List;
/** /**
* 广Service * 广Service
@ -9,15 +11,14 @@ import com.ruoyi.system.domain.BPoster;
* @author ruoyi * @author ruoyi
* @date 2023-11-21 * @date 2023-11-21
*/ */
public interface IBPosterService public interface IBPosterService {
{
/** /**
* 广 * 广
* *
* @param id 广 * @param id 广
* @return 广 * @return 广
*/ */
public BPoster selectBPosterById(Long id); BPoster selectBPosterById(Long id);
/** /**
* 广 * 广
@ -25,7 +26,7 @@ public interface IBPosterService
* @param bPoster 广 * @param bPoster 广
* @return 广 * @return 广
*/ */
public List<BPoster> selectBPosterList(BPoster bPoster); List<BPoster> selectBPosterList(BPoster bPoster);
/** /**
* 广 * 广
@ -33,7 +34,7 @@ public interface IBPosterService
* @param bPoster 广 * @param bPoster 广
* @return * @return
*/ */
public int insertBPoster(BPoster bPoster); int insertBPoster(BPoster bPoster);
/** /**
* 广 * 广
@ -41,7 +42,7 @@ public interface IBPosterService
* @param bPoster 广 * @param bPoster 广
* @return * @return
*/ */
public int updateBPoster(BPoster bPoster); int updateBPoster(BPoster bPoster);
/** /**
* 广 * 广
@ -49,7 +50,7 @@ public interface IBPosterService
* @param ids 广 * @param ids 广
* @return * @return
*/ */
public int deleteBPosterByIds(Long[] ids); int deleteBPosterByIds(Long[] ids);
/** /**
* 广 * 广
@ -57,5 +58,12 @@ public interface IBPosterService
* @param id 广 * @param id 广
* @return * @return
*/ */
public int deleteBPosterById(Long id); int deleteBPosterById(Long id);
/**
* 广
*
* @param req
*/
void batchAllocation(PosterRequest req);
} }

@ -1,23 +1,24 @@
package com.ruoyi.system.service; package com.ruoyi.system.service;
import java.util.List; import com.ruoyi.system.domain.BNet;
import com.ruoyi.system.domain.BShanghu; import com.ruoyi.system.domain.BShanghu;
import java.util.List;
/** /**
* Service * Service
* *
* @author ruoyi * @author ruoyi
* @date 2023-11-21 * @date 2023-11-21
*/ */
public interface IBShanghuService public interface IBShanghuService {
{
/** /**
* *
* *
* @param id * @param id
* @return * @return
*/ */
public BShanghu selectBShanghuById(Long id); BShanghu selectBShanghuById(Long id);
/** /**
* *
@ -25,7 +26,7 @@ public interface IBShanghuService
* @param bShanghu * @param bShanghu
* @return * @return
*/ */
public List<BShanghu> selectBShanghuList(BShanghu bShanghu); List<BShanghu> selectBShanghuList(BShanghu bShanghu);
/** /**
* *
@ -33,7 +34,7 @@ public interface IBShanghuService
* @param bShanghu * @param bShanghu
* @return * @return
*/ */
public int insertBShanghu(BShanghu bShanghu); int insertBShanghu(BShanghu bShanghu);
/** /**
* *
@ -41,7 +42,7 @@ public interface IBShanghuService
* @param bShanghu * @param bShanghu
* @return * @return
*/ */
public int updateBShanghu(BShanghu bShanghu); int updateBShanghu(BShanghu bShanghu);
/** /**
* *
@ -49,7 +50,7 @@ public interface IBShanghuService
* @param ids * @param ids
* @return * @return
*/ */
public int deleteBShanghuByIds(Long[] ids); int deleteBShanghuByIds(Long[] ids);
/** /**
* *
@ -57,5 +58,23 @@ public interface IBShanghuService
* @param id * @param id
* @return * @return
*/ */
public int deleteBShanghuById(Long id); int deleteBShanghuById(Long id);
/**
* 广
*
* @param posterId 广id
* @param shanghuIds id
*/
void editPostIdByIds(Long posterId, List<Long> shanghuIds);
/**
* 广
*
* @param posterId 广id
* @param shanghuCity
* @param shanghuName
*/
void editPostIdByReq(Long posterId, String shanghuCity, String shanghuName);
} }

@ -1,12 +1,15 @@
package com.ruoyi.system.service.impl; 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 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.domain.BNet;
import com.ruoyi.system.mapper.BNetMapper;
import com.ruoyi.system.service.IBNetService; import com.ruoyi.system.service.IBNetService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/** /**
* Service * Service
@ -15,9 +18,9 @@ import com.ruoyi.system.service.IBNetService;
* @date 2023-11-21 * @date 2023-11-21
*/ */
@Service @Service
public class BNetServiceImpl implements IBNetService public class BNetServiceImpl implements IBNetService {
{
@Autowired @Resource
private BNetMapper bNetMapper; private BNetMapper bNetMapper;
/** /**
@ -27,8 +30,7 @@ public class BNetServiceImpl implements IBNetService
* @return * @return
*/ */
@Override @Override
public BNet selectBNetById(Long id) public BNet selectBNetById(Long id) {
{
return bNetMapper.selectBNetById(id); return bNetMapper.selectBNetById(id);
} }
@ -39,8 +41,7 @@ public class BNetServiceImpl implements IBNetService
* @return * @return
*/ */
@Override @Override
public List<BNet> selectBNetList(BNet bNet) public List<BNet> selectBNetList(BNet bNet) {
{
return bNetMapper.selectBNetList(bNet); return bNetMapper.selectBNetList(bNet);
} }
@ -51,8 +52,14 @@ public class BNetServiceImpl implements IBNetService
* @return * @return
*/ */
@Override @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()); bNet.setCreateTime(DateUtils.getNowDate());
return bNetMapper.insertBNet(bNet); return bNetMapper.insertBNet(bNet);
} }
@ -64,8 +71,7 @@ public class BNetServiceImpl implements IBNetService
* @return * @return
*/ */
@Override @Override
public int updateBNet(BNet bNet) public int updateBNet(BNet bNet) {
{
bNet.setUpdateTime(DateUtils.getNowDate()); bNet.setUpdateTime(DateUtils.getNowDate());
return bNetMapper.updateBNet(bNet); return bNetMapper.updateBNet(bNet);
} }
@ -77,8 +83,7 @@ public class BNetServiceImpl implements IBNetService
* @return * @return
*/ */
@Override @Override
public int deleteBNetByIds(Long[] ids) public int deleteBNetByIds(Long[] ids) {
{
return bNetMapper.deleteBNetByIds(ids); return bNetMapper.deleteBNetByIds(ids);
} }
@ -89,8 +94,28 @@ public class BNetServiceImpl implements IBNetService
* @return * @return
*/ */
@Override @Override
public int deleteBNetById(Long id) public int deleteBNetById(Long id) {
{
return bNetMapper.deleteBNetById(id); return bNetMapper.deleteBNetById(id);
} }
/**
* idwifi
*
* @param id id
*/
@Override
public void deleteBNetByShangHuId(Long id) {
bNetMapper.deleteBNetByShangHuId(id);
}
/**
* idwifi()
*
* @param id id
* @return wifi
*/
@Override
public BNet findById(Long id) {
return bNetMapper.findByShanghuId(id);
}
} }

@ -1,12 +1,19 @@
package com.ruoyi.system.service.impl; 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 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.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.IBPosterService;
import com.ruoyi.system.service.IBShanghuService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/** /**
* 广Service * 广Service
@ -15,11 +22,14 @@ import com.ruoyi.system.service.IBPosterService;
* @date 2023-11-21 * @date 2023-11-21
*/ */
@Service @Service
public class BPosterServiceImpl implements IBPosterService public class BPosterServiceImpl implements IBPosterService {
{
@Autowired @Resource
private BPosterMapper bPosterMapper; private BPosterMapper bPosterMapper;
@Resource
private IBShanghuService shanghuService;
/** /**
* 广 * 广
* *
@ -27,8 +37,7 @@ public class BPosterServiceImpl implements IBPosterService
* @return 广 * @return 广
*/ */
@Override @Override
public BPoster selectBPosterById(Long id) public BPoster selectBPosterById(Long id) {
{
return bPosterMapper.selectBPosterById(id); return bPosterMapper.selectBPosterById(id);
} }
@ -39,8 +48,7 @@ public class BPosterServiceImpl implements IBPosterService
* @return 广 * @return 广
*/ */
@Override @Override
public List<BPoster> selectBPosterList(BPoster bPoster) public List<BPoster> selectBPosterList(BPoster bPoster) {
{
return bPosterMapper.selectBPosterList(bPoster); return bPosterMapper.selectBPosterList(bPoster);
} }
@ -51,8 +59,7 @@ public class BPosterServiceImpl implements IBPosterService
* @return * @return
*/ */
@Override @Override
public int insertBPoster(BPoster bPoster) public int insertBPoster(BPoster bPoster) {
{
bPoster.setCreateTime(DateUtils.getNowDate()); bPoster.setCreateTime(DateUtils.getNowDate());
return bPosterMapper.insertBPoster(bPoster); return bPosterMapper.insertBPoster(bPoster);
} }
@ -64,8 +71,7 @@ public class BPosterServiceImpl implements IBPosterService
* @return * @return
*/ */
@Override @Override
public int updateBPoster(BPoster bPoster) public int updateBPoster(BPoster bPoster) {
{
bPoster.setUpdateTime(DateUtils.getNowDate()); bPoster.setUpdateTime(DateUtils.getNowDate());
return bPosterMapper.updateBPoster(bPoster); return bPosterMapper.updateBPoster(bPoster);
} }
@ -77,8 +83,7 @@ public class BPosterServiceImpl implements IBPosterService
* @return * @return
*/ */
@Override @Override
public int deleteBPosterByIds(Long[] ids) public int deleteBPosterByIds(Long[] ids) {
{
return bPosterMapper.deleteBPosterByIds(ids); return bPosterMapper.deleteBPosterByIds(ids);
} }
@ -89,8 +94,30 @@ public class BPosterServiceImpl implements IBPosterService
* @return * @return
*/ */
@Override @Override
public int deleteBPosterById(Long id) public int deleteBPosterById(Long id) {
{
return bPosterMapper.deleteBPosterById(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("参数错误");
}
} }

@ -1,12 +1,21 @@
package com.ruoyi.system.service.impl; 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 com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired; import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.stereotype.Service; import com.ruoyi.system.domain.BPoster;
import com.ruoyi.system.mapper.BShanghuMapper;
import com.ruoyi.system.domain.BShanghu; 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.IBShanghuService;
import com.ruoyi.system.service.ISysUserService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/** /**
* Service * Service
@ -15,11 +24,20 @@ import com.ruoyi.system.service.IBShanghuService;
* @date 2023-11-21 * @date 2023-11-21
*/ */
@Service @Service
public class BShanghuServiceImpl implements IBShanghuService public class BShanghuServiceImpl implements IBShanghuService {
{
@Autowired @Resource
private BShanghuMapper bShanghuMapper; private BShanghuMapper bShanghuMapper;
@Resource
private ISysUserService userService;
@Resource
private IBPosterService posterService;
@Resource
private IBNetService netService;
/** /**
* *
* *
@ -27,8 +45,7 @@ public class BShanghuServiceImpl implements IBShanghuService
* @return * @return
*/ */
@Override @Override
public BShanghu selectBShanghuById(Long id) public BShanghu selectBShanghuById(Long id) {
{
return bShanghuMapper.selectBShanghuById(id); return bShanghuMapper.selectBShanghuById(id);
} }
@ -39,8 +56,7 @@ public class BShanghuServiceImpl implements IBShanghuService
* @return * @return
*/ */
@Override @Override
public List<BShanghu> selectBShanghuList(BShanghu bShanghu) public List<BShanghu> selectBShanghuList(BShanghu bShanghu) {
{
return bShanghuMapper.selectBShanghuList(bShanghu); return bShanghuMapper.selectBShanghuList(bShanghu);
} }
@ -51,9 +67,17 @@ public class BShanghuServiceImpl implements IBShanghuService
* @return * @return
*/ */
@Override @Override
public int insertBShanghu(BShanghu bShanghu) public int insertBShanghu(BShanghu bShanghu) {
{
bShanghu.setCreateTime(DateUtils.getNowDate()); 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); return bShanghuMapper.insertBShanghu(bShanghu);
} }
@ -64,8 +88,13 @@ public class BShanghuServiceImpl implements IBShanghuService
* @return * @return
*/ */
@Override @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()); bShanghu.setUpdateTime(DateUtils.getNowDate());
return bShanghuMapper.updateBShanghu(bShanghu); return bShanghuMapper.updateBShanghu(bShanghu);
} }
@ -77,8 +106,7 @@ public class BShanghuServiceImpl implements IBShanghuService
* @return * @return
*/ */
@Override @Override
public int deleteBShanghuByIds(Long[] ids) public int deleteBShanghuByIds(Long[] ids) {
{
return bShanghuMapper.deleteBShanghuByIds(ids); return bShanghuMapper.deleteBShanghuByIds(ids);
} }
@ -89,8 +117,32 @@ public class BShanghuServiceImpl implements IBShanghuService
* @return * @return
*/ */
@Override @Override
public int deleteBShanghuById(Long id) public int deleteBShanghuById(Long id) {
{ // 删除商户wifi
netService.deleteBNetByShangHuId(id);
return bShanghuMapper.deleteBShanghuById(id); return bShanghuMapper.deleteBShanghuById(id);
} }
/**
* 广
*
* @param posterId 广id
* @param shanghuIds id
*/
@Override
public void editPostIdByIds(Long posterId, List<Long> 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);
}
} }

@ -1,9 +1,12 @@
package com.ruoyi.web.controller.common; package com.ruoyi.web.controller.common;
import java.util.ArrayList; import com.ruoyi.common.config.RuoYiConfig;
import java.util.List; import com.ruoyi.common.constant.Constants;
import javax.servlet.http.HttpServletRequest; import com.ruoyi.common.core.domain.AjaxResult;
import javax.servlet.http.HttpServletResponse; 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.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -13,13 +16,11 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.constant.Constants; import javax.servlet.http.HttpServletRequest;
import com.ruoyi.common.core.domain.AjaxResult; import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.utils.StringUtils; import java.util.ArrayList;
import com.ruoyi.common.utils.file.FileUploadUtils; import java.util.List;
import com.ruoyi.common.utils.file.FileUtils;
import com.ruoyi.framework.config.ServerConfig;
/** /**
* *
@ -28,28 +29,22 @@ import com.ruoyi.framework.config.ServerConfig;
*/ */
@RestController @RestController
@RequestMapping("/common") @RequestMapping("/common")
public class CommonController public class CommonController {
{
private static final Logger log = LoggerFactory.getLogger(CommonController.class); private static final Logger log = LoggerFactory.getLogger(CommonController.class);
private static final String FILE_DELIMETER = ",";
@Autowired @Autowired
private ServerConfig serverConfig; private ServerConfig serverConfig;
private static final String FILE_DELIMETER = ",";
/** /**
* *
* *
* @param fileName * @param fileName
* @param delete * @param delete
*/ */
@GetMapping("/download") @GetMapping("/download")
public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request) public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request) {
{ try {
try if (!FileUtils.checkAllowDownload(fileName)) {
{
if (!FileUtils.checkAllowDownload(fileName))
{
throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName)); throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName));
} }
String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1); String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1);
@ -58,13 +53,10 @@ public class CommonController
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE); response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
FileUtils.setAttachmentResponseHeader(response, realFileName); FileUtils.setAttachmentResponseHeader(response, realFileName);
FileUtils.writeBytes(filePath, response.getOutputStream()); FileUtils.writeBytes(filePath, response.getOutputStream());
if (delete) if (delete) {
{
FileUtils.deleteFile(filePath); FileUtils.deleteFile(filePath);
} }
} } catch (Exception e) {
catch (Exception e)
{
log.error("下载文件失败", e); log.error("下载文件失败", e);
} }
} }
@ -73,10 +65,8 @@ public class CommonController
* *
*/ */
@PostMapping("/upload") @PostMapping("/upload")
public AjaxResult uploadFile(MultipartFile file) throws Exception public AjaxResult uploadFile(MultipartFile file) throws Exception {
{ try {
try
{
// 上传文件路径 // 上传文件路径
String filePath = RuoYiConfig.getUploadPath(); String filePath = RuoYiConfig.getUploadPath();
// 上传并返回新文件名称 // 上传并返回新文件名称
@ -88,9 +78,7 @@ public class CommonController
ajax.put("newFileName", FileUtils.getName(fileName)); ajax.put("newFileName", FileUtils.getName(fileName));
ajax.put("originalFilename", file.getOriginalFilename()); ajax.put("originalFilename", file.getOriginalFilename());
return ajax; return ajax;
} } catch (Exception e) {
catch (Exception e)
{
return AjaxResult.error(e.getMessage()); return AjaxResult.error(e.getMessage());
} }
} }
@ -99,18 +87,15 @@ public class CommonController
* *
*/ */
@PostMapping("/uploads") @PostMapping("/uploads")
public AjaxResult uploadFiles(List<MultipartFile> files) throws Exception public AjaxResult uploadFiles(List<MultipartFile> files) throws Exception {
{ try {
try
{
// 上传文件路径 // 上传文件路径
String filePath = RuoYiConfig.getUploadPath(); String filePath = RuoYiConfig.getUploadPath();
List<String> urls = new ArrayList<String>(); List<String> urls = new ArrayList<String>();
List<String> fileNames = new ArrayList<String>(); List<String> fileNames = new ArrayList<String>();
List<String> newFileNames = new ArrayList<String>(); List<String> newFileNames = new ArrayList<String>();
List<String> originalFilenames = new ArrayList<String>(); List<String> originalFilenames = new ArrayList<String>();
for (MultipartFile file : files) for (MultipartFile file : files) {
{
// 上传并返回新文件名称 // 上传并返回新文件名称
String fileName = FileUploadUtils.upload(filePath, file); String fileName = FileUploadUtils.upload(filePath, file);
String url = serverConfig.getUrl() + fileName; String url = serverConfig.getUrl() + fileName;
@ -125,9 +110,7 @@ public class CommonController
ajax.put("newFileNames", StringUtils.join(newFileNames, FILE_DELIMETER)); ajax.put("newFileNames", StringUtils.join(newFileNames, FILE_DELIMETER));
ajax.put("originalFilenames", StringUtils.join(originalFilenames, FILE_DELIMETER)); ajax.put("originalFilenames", StringUtils.join(originalFilenames, FILE_DELIMETER));
return ajax; return ajax;
} } catch (Exception e) {
catch (Exception e)
{
return AjaxResult.error(e.getMessage()); return AjaxResult.error(e.getMessage());
} }
} }
@ -137,12 +120,9 @@ public class CommonController
*/ */
@GetMapping("/download/resource") @GetMapping("/download/resource")
public void resourceDownload(String resource, HttpServletRequest request, HttpServletResponse response) public void resourceDownload(String resource, HttpServletRequest request, HttpServletResponse response)
throws Exception throws Exception {
{ try {
try if (!FileUtils.checkAllowDownload(resource)) {
{
if (!FileUtils.checkAllowDownload(resource))
{
throw new Exception(StringUtils.format("资源文件({})非法,不允许下载。 ", resource)); throw new Exception(StringUtils.format("资源文件({})非法,不允许下载。 ", resource));
} }
// 本地资源路径 // 本地资源路径
@ -154,9 +134,7 @@ public class CommonController
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE); response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
FileUtils.setAttachmentResponseHeader(response, downloadName); FileUtils.setAttachmentResponseHeader(response, downloadName);
FileUtils.writeBytes(downloadPath, response.getOutputStream()); FileUtils.writeBytes(downloadPath, response.getOutputStream());
} } catch (Exception e) {
catch (Exception e)
{
log.error("下载文件失败", e); log.error("下载文件失败", e);
} }
} }

@ -1,21 +1,5 @@
package com.ruoyi.web.controller.system; 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.annotation.Log;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
@ -27,10 +11,29 @@ import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil; 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.ISysDeptService;
import com.ruoyi.system.service.ISysPostService; import com.ruoyi.system.service.ISysPostService;
import com.ruoyi.system.service.ISysRoleService; import com.ruoyi.system.service.ISysRoleService;
import com.ruoyi.system.service.ISysUserService; 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;
/** /**
* *
@ -39,27 +42,28 @@ import com.ruoyi.system.service.ISysUserService;
*/ */
@RestController @RestController
@RequestMapping("/system/user") @RequestMapping("/system/user")
public class SysUserController extends BaseController public class SysUserController extends BaseController {
{ @Resource
@Autowired
private ISysUserService userService; private ISysUserService userService;
@Autowired @Resource
private ISysRoleService roleService; private ISysRoleService roleService;
@Autowired @Resource
private ISysDeptService deptService; private ISysDeptService deptService;
@Autowired @Resource
private ISysPostService postService; private ISysPostService postService;
@Resource
private IBShanghuService bShanghuService;
/** /**
* *
*/ */
@PreAuthorize("@ss.hasPermi('system:user:list')") @PreAuthorize("@ss.hasPermi('system:user:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(SysUser user) public TableDataInfo list(SysUser user) {
{
startPage(); startPage();
List<SysUser> list = userService.selectUserList(user); List<SysUser> list = userService.selectUserList(user);
return getDataTable(list); return getDataTable(list);
@ -68,8 +72,7 @@ public class SysUserController extends BaseController
@Log(title = "用户管理", businessType = BusinessType.EXPORT) @Log(title = "用户管理", businessType = BusinessType.EXPORT)
@PreAuthorize("@ss.hasPermi('system:user:export')") @PreAuthorize("@ss.hasPermi('system:user:export')")
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, SysUser user) public void export(HttpServletResponse response, SysUser user) {
{
List<SysUser> list = userService.selectUserList(user); List<SysUser> list = userService.selectUserList(user);
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class); ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
util.exportExcel(response, list, "用户数据"); util.exportExcel(response, list, "用户数据");
@ -78,8 +81,7 @@ public class SysUserController extends BaseController
@Log(title = "用户管理", businessType = BusinessType.IMPORT) @Log(title = "用户管理", businessType = BusinessType.IMPORT)
@PreAuthorize("@ss.hasPermi('system:user:import')") @PreAuthorize("@ss.hasPermi('system:user:import')")
@PostMapping("/importData") @PostMapping("/importData")
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception {
{
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class); ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
List<SysUser> userList = util.importExcel(file.getInputStream()); List<SysUser> userList = util.importExcel(file.getInputStream());
String operName = getUsername(); String operName = getUsername();
@ -88,8 +90,7 @@ public class SysUserController extends BaseController
} }
@PostMapping("/importTemplate") @PostMapping("/importTemplate")
public void importTemplate(HttpServletResponse response) public void importTemplate(HttpServletResponse response) {
{
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class); ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
util.importTemplateExcel(response, "用户数据"); util.importTemplateExcel(response, "用户数据");
} }
@ -98,16 +99,14 @@ public class SysUserController extends BaseController
* *
*/ */
@PreAuthorize("@ss.hasPermi('system:user:query')") @PreAuthorize("@ss.hasPermi('system:user:query')")
@GetMapping(value = { "/", "/{userId}" }) @GetMapping(value = {"/", "/{userId}"})
public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId) public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId) {
{
userService.checkUserDataScope(userId); userService.checkUserDataScope(userId);
AjaxResult ajax = AjaxResult.success(); AjaxResult ajax = AjaxResult.success();
List<SysRole> roles = roleService.selectRoleAll(); List<SysRole> roles = roleService.selectRoleAll();
ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList())); ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
ajax.put("posts", postService.selectPostAll()); ajax.put("posts", postService.selectPostAll());
if (StringUtils.isNotNull(userId)) if (StringUtils.isNotNull(userId)) {
{
SysUser sysUser = userService.selectUserById(userId); SysUser sysUser = userService.selectUserById(userId);
ajax.put(AjaxResult.DATA_TAG, sysUser); ajax.put(AjaxResult.DATA_TAG, sysUser);
ajax.put("postIds", postService.selectPostListByUserId(userId)); ajax.put("postIds", postService.selectPostListByUserId(userId));
@ -122,21 +121,26 @@ public class SysUserController extends BaseController
@PreAuthorize("@ss.hasPermi('system:user:add')") @PreAuthorize("@ss.hasPermi('system:user:add')")
@Log(title = "用户管理", businessType = BusinessType.INSERT) @Log(title = "用户管理", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@Validated @RequestBody SysUser user) public AjaxResult add(@Validated @RequestBody SysUser user) {
{ if (!userService.checkUserNameUnique(user)) {
if (!userService.checkUserNameUnique(user))
{
return error("新增用户'" + user.getUserName() + "'失败,登录账号已存在"); 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() + "'失败,手机号码已存在"); 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() + "'失败,邮箱账号已存在"); 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()); user.setCreateBy(getUsername());
if (StringUtils.isEmpty(user.getPassword())) {
user.setPassword("123456");
}
user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
return toAjax(userService.insertUser(user)); return toAjax(userService.insertUser(user));
} }
@ -147,20 +151,14 @@ public class SysUserController extends BaseController
@PreAuthorize("@ss.hasPermi('system:user:edit')") @PreAuthorize("@ss.hasPermi('system:user:edit')")
@Log(title = "用户管理", businessType = BusinessType.UPDATE) @Log(title = "用户管理", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@Validated @RequestBody SysUser user) public AjaxResult edit(@Validated @RequestBody SysUser user) {
{
userService.checkUserAllowed(user); userService.checkUserAllowed(user);
userService.checkUserDataScope(user.getUserId()); userService.checkUserDataScope(user.getUserId());
if (!userService.checkUserNameUnique(user)) if (!userService.checkUserNameUnique(user)) {
{
return error("修改用户'" + user.getUserName() + "'失败,登录账号已存在"); 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() + "'失败,手机号码已存在"); 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() + "'失败,邮箱账号已存在"); return error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在");
} }
user.setUpdateBy(getUsername()); user.setUpdateBy(getUsername());
@ -173,10 +171,8 @@ public class SysUserController extends BaseController
@PreAuthorize("@ss.hasPermi('system:user:remove')") @PreAuthorize("@ss.hasPermi('system:user:remove')")
@Log(title = "用户管理", businessType = BusinessType.DELETE) @Log(title = "用户管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{userIds}") @DeleteMapping("/{userIds}")
public AjaxResult remove(@PathVariable Long[] userIds) public AjaxResult remove(@PathVariable Long[] userIds) {
{ if (ArrayUtils.contains(userIds, getUserId())) {
if (ArrayUtils.contains(userIds, getUserId()))
{
return error("当前用户不能删除"); return error("当前用户不能删除");
} }
return toAjax(userService.deleteUserByIds(userIds)); return toAjax(userService.deleteUserByIds(userIds));
@ -188,8 +184,7 @@ public class SysUserController extends BaseController
@PreAuthorize("@ss.hasPermi('system:user:resetPwd')") @PreAuthorize("@ss.hasPermi('system:user:resetPwd')")
@Log(title = "用户管理", businessType = BusinessType.UPDATE) @Log(title = "用户管理", businessType = BusinessType.UPDATE)
@PutMapping("/resetPwd") @PutMapping("/resetPwd")
public AjaxResult resetPwd(@RequestBody SysUser user) public AjaxResult resetPwd(@RequestBody SysUser user) {
{
userService.checkUserAllowed(user); userService.checkUserAllowed(user);
userService.checkUserDataScope(user.getUserId()); userService.checkUserDataScope(user.getUserId());
user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
@ -203,8 +198,7 @@ public class SysUserController extends BaseController
@PreAuthorize("@ss.hasPermi('system:user:edit')") @PreAuthorize("@ss.hasPermi('system:user:edit')")
@Log(title = "用户管理", businessType = BusinessType.UPDATE) @Log(title = "用户管理", businessType = BusinessType.UPDATE)
@PutMapping("/changeStatus") @PutMapping("/changeStatus")
public AjaxResult changeStatus(@RequestBody SysUser user) public AjaxResult changeStatus(@RequestBody SysUser user) {
{
userService.checkUserAllowed(user); userService.checkUserAllowed(user);
userService.checkUserDataScope(user.getUserId()); userService.checkUserDataScope(user.getUserId());
user.setUpdateBy(getUsername()); user.setUpdateBy(getUsername());
@ -216,8 +210,7 @@ public class SysUserController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('system:user:query')") @PreAuthorize("@ss.hasPermi('system:user:query')")
@GetMapping("/authRole/{userId}") @GetMapping("/authRole/{userId}")
public AjaxResult authRole(@PathVariable("userId") Long userId) public AjaxResult authRole(@PathVariable("userId") Long userId) {
{
AjaxResult ajax = AjaxResult.success(); AjaxResult ajax = AjaxResult.success();
SysUser user = userService.selectUserById(userId); SysUser user = userService.selectUserById(userId);
List<SysRole> roles = roleService.selectRolesByUserId(userId); List<SysRole> roles = roleService.selectRolesByUserId(userId);
@ -232,8 +225,7 @@ public class SysUserController extends BaseController
@PreAuthorize("@ss.hasPermi('system:user:edit')") @PreAuthorize("@ss.hasPermi('system:user:edit')")
@Log(title = "用户管理", businessType = BusinessType.GRANT) @Log(title = "用户管理", businessType = BusinessType.GRANT)
@PutMapping("/authRole") @PutMapping("/authRole")
public AjaxResult insertAuthRole(Long userId, Long[] roleIds) public AjaxResult insertAuthRole(Long userId, Long[] roleIds) {
{
userService.checkUserDataScope(userId); userService.checkUserDataScope(userId);
userService.insertUserAuth(userId, roleIds); userService.insertUserAuth(userId, roleIds);
return success(); return success();
@ -244,8 +236,7 @@ public class SysUserController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('system:user:list')") @PreAuthorize("@ss.hasPermi('system:user:list')")
@GetMapping("/deptTree") @GetMapping("/deptTree")
public AjaxResult deptTree(SysDept dept) public AjaxResult deptTree(SysDept dept) {
{
return success(deptService.selectDeptTreeList(dept)); return success(deptService.selectDeptTreeList(dept));
} }
} }

@ -17,7 +17,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectBNetVo"> <sql id="selectBNetVo">
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
</sql> </sql>
<select id="selectBNetList" parameterType="BNet" resultMap="BNetResult"> <select id="selectBNetList" parameterType="BNet" resultMap="BNetResult">
@ -32,6 +32,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id} where id = #{id}
</select> </select>
<select id="findByShanghuId" resultType="com.ruoyi.system.domain.BNet">
select *
from b_net
where shanghu_id = #{shanghuId}
limit 1
</select>
<insert id="insertBNet" parameterType="BNet" useGeneratedKeys="true" keyProperty="id"> <insert id="insertBNet" parameterType="BNet" useGeneratedKeys="true" keyProperty="id">
insert into b_net insert into b_net
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
@ -81,4 +88,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id} #{id}
</foreach> </foreach>
</delete> </delete>
<delete id="deleteBNetByShangHuId">
delete
from b_net
where shanghu_id = #{id}
</delete>
</mapper> </mapper>

@ -84,6 +84,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>
<update id="editPostIdByIds">
update b_shanghu set poster_id = #{posterId} where id in
<foreach item="id" collection="list" open="(" separator="," close=")">
#{id}
</foreach>
</update>
<update id="editPostIdByReq">
update b_shanghu
set poster_id = #{posterId}
<where>
<if test="shanghuCity != null and shanghuCity != ''">
city like concat('%', #{shanghuCity}, '%')
</if>
<if test="shanghuName != null and shanghuName != ''">
and pos_name like concat('%', #{shanghuName}, '%')
</if>
</where>
</update>
<delete id="deleteBShanghuById" parameterType="Long"> <delete id="deleteBShanghuById" parameterType="Long">
delete from b_shanghu where id = #{id} delete from b_shanghu where id = #{id}

@ -1,10 +1,5 @@
package com.ruoyi.common.core.domain.entity; 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;
import com.ruoyi.common.annotation.Excel.ColumnType; import com.ruoyi.common.annotation.Excel.ColumnType;
import com.ruoyi.common.annotation.Excel.Type; 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.core.domain.BaseEntity;
import com.ruoyi.common.xss.Xss; 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 * sys_user
* *
* @author ruoyi * @author ruoyi
*/ */
public class SysUser extends BaseEntity public class SysUser extends BaseEntity {
{
private static final long serialVersionUID = 1L; 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 = "用户编号") @Excel(name = "用户序号", cellType = ColumnType.NUMERIC, prompt = "用户编号")
private Long userId; private Long userId;
/**
/** 部门ID */ * ID
*/
@Excel(name = "部门编号", type = Type.IMPORT) @Excel(name = "部门编号", type = Type.IMPORT)
private Long deptId; private Long deptId;
/**
/** 用户账号 */ *
*/
@Excel(name = "登录名称") @Excel(name = "登录名称")
private String userName; private String userName;
/**
/** 用户昵称 */ *
*/
@Excel(name = "用户名称") @Excel(name = "用户名称")
private String nickName; private String nickName;
/**
/** 用户邮箱 */ *
*/
@Excel(name = "用户邮箱") @Excel(name = "用户邮箱")
private String email; private String email;
/**
/** 手机号码 */ *
*/
@Excel(name = "手机号码") @Excel(name = "手机号码")
private String phonenumber; private String phonenumber;
/**
/** 用户性别 */ *
*/
@Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知") @Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知")
private String sex; private String sex;
/**
/** 用户头像 */ *
*/
private String avatar; private String avatar;
/**
/** 密码 */ *
*/
private String password; private String password;
/**
/** 帐号状态0正常 1停用 */ * 0 1
*/
@Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用") @Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用")
private String status; private String status;
/**
/** 删除标志0代表存在 2代表删除 */ * 0 2
*/
private String delFlag; private String delFlag;
/**
/** 最后登录IP */ * IP
*/
@Excel(name = "最后登录IP", type = Type.EXPORT) @Excel(name = "最后登录IP", type = Type.EXPORT)
private String loginIp; private String loginIp;
/**
/** 最后登录时间 */ *
*/
@Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT) @Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT)
private Date loginDate; private Date loginDate;
/**
/** 部门对象 */ *
@Excels({ */
@Excel(name = "部门名称", targetAttr = "deptName", type = Type.EXPORT), @Excels({@Excel(name = "部门名称", targetAttr = "deptName", type = Type.EXPORT), @Excel(name = "部门负责人", targetAttr = "leader", type = Type.EXPORT)})
@Excel(name = "部门负责人", targetAttr = "leader", type = Type.EXPORT)
})
private SysDept dept; private SysDept dept;
/**
/** 角色对象 */ *
*/
private List<SysRole> roles; private List<SysRole> roles;
/**
/** 角色组 */ *
*/
private Long[] roleIds; private Long[] roleIds;
/**
/** 岗位组 */ *
*/
private Long[] postIds; private Long[] postIds;
/**
/** 角色ID */ * ID
*/
private Long roleId; private Long roleId;
public SysUser() public SysUser() {
{
} }
public SysUser(Long userId) public SysUser(Long userId) {
{
this.userId = 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; return userId;
} }
public void setUserId(Long userId) public void setUserId(Long userId) {
{
this.userId = userId; this.userId = userId;
} }
public boolean isAdmin() public boolean isAdmin() {
{
return isAdmin(this.userId); return isAdmin(this.userId);
} }
public static boolean isAdmin(Long userId) public Long getDeptId() {
{
return userId != null && 1L == userId;
}
public Long getDeptId()
{
return deptId; return deptId;
} }
public void setDeptId(Long deptId) public void setDeptId(Long deptId) {
{
this.deptId = deptId; this.deptId = deptId;
} }
@Xss(message = "用户昵称不能包含脚本字符") @Xss(message = "用户昵称不能包含脚本字符")
@Size(min = 0, max = 30, message = "用户昵称长度不能超过30个字符") @Size(min = 0, max = 30, message = "用户昵称长度不能超过30个字符")
public String getNickName() public String getNickName() {
{
return nickName; return nickName;
} }
public void setNickName(String nickName) public void setNickName(String nickName) {
{
this.nickName = nickName; this.nickName = nickName;
} }
@Xss(message = "用户账号不能包含脚本字符") @Xss(message = "用户账号不能包含脚本字符")
@NotBlank(message = "用户账号不能为空") @NotBlank(message = "用户账号不能为空")
@Size(min = 0, max = 30, message = "用户账号长度不能超过30个字符") @Size(min = 0, max = 30, message = "用户账号长度不能超过30个字符")
public String getUserName() public String getUserName() {
{
return userName; return userName;
} }
public void setUserName(String userName) public void setUserName(String userName) {
{
this.userName = userName; this.userName = userName;
} }
@Email(message = "邮箱格式不正确") @Email(message = "邮箱格式不正确")
@Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符") @Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符")
public String getEmail() public String getEmail() {
{
return email; return email;
} }
public void setEmail(String email) public void setEmail(String email) {
{
this.email = email; this.email = email;
} }
@Size(min = 0, max = 11, message = "手机号码长度不能超过11个字符") @Size(min = 0, max = 11, message = "手机号码长度不能超过11个字符")
public String getPhonenumber() public String getPhonenumber() {
{
return phonenumber; return phonenumber;
} }
public void setPhonenumber(String phonenumber) public void setPhonenumber(String phonenumber) {
{
this.phonenumber = phonenumber; this.phonenumber = phonenumber;
} }
public String getSex() public String getSex() {
{
return sex; return sex;
} }
public void setSex(String sex) public void setSex(String sex) {
{
this.sex = sex; this.sex = sex;
} }
public String getAvatar() public String getAvatar() {
{
return avatar; return avatar;
} }
public void setAvatar(String avatar) public void setAvatar(String avatar) {
{
this.avatar = avatar; this.avatar = avatar;
} }
public String getPassword() public String getPassword() {
{
return password; return password;
} }
public void setPassword(String password) public void setPassword(String password) {
{
this.password = password; this.password = password;
} }
public String getStatus() public String getStatus() {
{
return status; return status;
} }
public void setStatus(String status) public void setStatus(String status) {
{
this.status = status; this.status = status;
} }
public String getDelFlag() public String getDelFlag() {
{
return delFlag; return delFlag;
} }
public void setDelFlag(String delFlag) public void setDelFlag(String delFlag) {
{
this.delFlag = delFlag; this.delFlag = delFlag;
} }
public String getLoginIp() public String getLoginIp() {
{
return loginIp; return loginIp;
} }
public void setLoginIp(String loginIp) public void setLoginIp(String loginIp) {
{
this.loginIp = loginIp; this.loginIp = loginIp;
} }
public Date getLoginDate() public Date getLoginDate() {
{
return loginDate; return loginDate;
} }
public void setLoginDate(Date loginDate) public void setLoginDate(Date loginDate) {
{
this.loginDate = loginDate; this.loginDate = loginDate;
} }
public SysDept getDept() public SysDept getDept() {
{
return dept; return dept;
} }
public void setDept(SysDept dept) public void setDept(SysDept dept) {
{
this.dept = dept; this.dept = dept;
} }
public List<SysRole> getRoles() public List<SysRole> getRoles() {
{
return roles; return roles;
} }
public void setRoles(List<SysRole> roles) public void setRoles(List<SysRole> roles) {
{
this.roles = roles; this.roles = roles;
} }
public Long[] getRoleIds() public Long[] getRoleIds() {
{
return roleIds; return roleIds;
} }
public void setRoleIds(Long[] roleIds) public void setRoleIds(Long[] roleIds) {
{
this.roleIds = roleIds; this.roleIds = roleIds;
} }
public Long[] getPostIds() public Long[] getPostIds() {
{
return postIds; return postIds;
} }
public void setPostIds(Long[] postIds) public void setPostIds(Long[] postIds) {
{
this.postIds = postIds; this.postIds = postIds;
} }
public Long getRoleId() public Long getRoleId() {
{
return roleId; return roleId;
} }
public void setRoleId(Long roleId) public void setRoleId(Long roleId) {
{
this.roleId = roleId; this.roleId = roleId;
} }
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) 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 + '}';
.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();
} }
} }

Loading…
Cancel
Save