修改接口,添加接口

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

@ -17,6 +17,22 @@
<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 -->
<dependency>
<groupId>org.springframework.boot</groupId>
@ -37,7 +53,7 @@
<version>1.6.2</version>
</dependency>
<!-- Mysql驱动包 -->
<!-- Mysql驱动包 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
@ -80,15 +96,15 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.1.0</version>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<warName>${project.artifactId}</warName>
</configuration>
</plugin>
</configuration>
</plugin>
</plugins>
<finalName>${project.artifactId}</finalName>
</build>

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

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

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

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

@ -1,37 +1,40 @@
package com.ruoyi.system.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.domain.BPoster;
import com.ruoyi.system.domain.dto.request.PosterRequest;
import com.ruoyi.system.service.IBPosterService;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.BPoster;
import com.ruoyi.system.service.IBPosterService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.util.List;
/**
* 广Controller
*
*
* @author ruoyi
* @date 2023-11-21
*/
@RestController
@RequestMapping("/netEwm/poster")
public class BPosterController extends BaseController
{
@Autowired
public class BPosterController extends BaseController {
@Resource
private IBPosterService bPosterService;
/**
@ -39,8 +42,7 @@ public class BPosterController extends BaseController
*/
@PreAuthorize("@ss.hasPermi('netEwm:poster:list')")
@GetMapping("/list")
public TableDataInfo list(BPoster bPoster)
{
public TableDataInfo list(BPoster bPoster) {
startPage();
List<BPoster> list = bPosterService.selectBPosterList(bPoster);
return getDataTable(list);
@ -52,8 +54,7 @@ public class BPosterController extends BaseController
@PreAuthorize("@ss.hasPermi('netEwm:poster:export')")
@Log(title = "广告", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, BPoster bPoster)
{
public void export(HttpServletResponse response, BPoster bPoster) {
List<BPoster> list = bPosterService.selectBPosterList(bPoster);
ExcelUtil<BPoster> util = new ExcelUtil<BPoster>(BPoster.class);
util.exportExcel(response, list, "广告数据");
@ -64,8 +65,7 @@ public class BPosterController extends BaseController
*/
@PreAuthorize("@ss.hasPermi('netEwm:poster:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(bPosterService.selectBPosterById(id));
}
@ -75,19 +75,30 @@ public class BPosterController extends BaseController
@PreAuthorize("@ss.hasPermi('netEwm:poster:add')")
@Log(title = "广告", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody BPoster bPoster)
{
public AjaxResult add(@RequestBody BPoster bPoster) {
return toAjax(bPosterService.insertBPoster(bPoster));
}
/**
* 广
*
* @param req
* @return
*/
@PostMapping("batchAllocation")
@ApiOperation("广告批量分配商户")
public AjaxResult batchAllocation(@Valid @RequestBody PosterRequest req) {
bPosterService.batchAllocation(req);
return success();
}
/**
* 广
*/
@PreAuthorize("@ss.hasPermi('netEwm:poster:edit')")
@Log(title = "广告", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody BPoster bPoster)
{
public AjaxResult edit(@RequestBody BPoster bPoster) {
return toAjax(bPosterService.updateBPoster(bPoster));
}
@ -96,9 +107,8 @@ public class BPosterController extends BaseController
*/
@PreAuthorize("@ss.hasPermi('netEwm:poster:remove')")
@Log(title = "广告", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(bPosterService.deleteBPosterByIds(ids));
}
}

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

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

@ -1,84 +1,104 @@
package com.ruoyi.system.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* b_net
*
*
* @author ruoyi
* @date 2023-11-21
*/
public class BNet extends BaseEntity
{
public class BNet extends BaseEntity {
private static final long serialVersionUID = 1L;
/** $column.columnComment */
/**
* $column.columnComment
*/
private Long id;
/** 网络名称 */
/**
* id
*/
private Long shanghuId;
/**
*
*/
@Excel(name = "网络名称")
private String netName;
/** wifi名称 */
/**
* wifi
*/
@Excel(name = "wifi名称")
private String wifiName;
/** wifi密码 */
/**
* wifi
*/
@Excel(name = "wifi密码")
private String wifiPass;
public void setId(Long id)
{
public BNet() {
}
public BNet(Long id, Long shanghuId, String netName, String wifiName, String wifiPass) {
this.id = id;
this.shanghuId = shanghuId;
this.netName = netName;
this.wifiName = wifiName;
this.wifiPass = wifiPass;
}
public Long getId()
{
@Override
public String toString() {
return "BNet{" +
"id=" + id +
", shanghuId=" + shanghuId +
", netName='" + netName + '\'' +
", wifiName='" + wifiName + '\'' +
", wifiPass='" + wifiPass + '\'' +
'}';
}
public Long getId() {
return id;
}
public void setNetName(String netName)
{
this.netName = netName;
public void setId(Long id) {
this.id = id;
}
public String getNetName()
{
public Long getShanghuId() {
return shanghuId;
}
public void setShanghuId(Long shanghuId) {
this.shanghuId = shanghuId;
}
public String getNetName() {
return netName;
}
public void setWifiName(String wifiName)
{
this.wifiName = wifiName;
public void setNetName(String netName) {
this.netName = netName;
}
public String getWifiName()
{
public String getWifiName() {
return wifiName;
}
public void setWifiPass(String wifiPass)
{
this.wifiPass = wifiPass;
public void setWifiName(String wifiName) {
this.wifiName = wifiName;
}
public String getWifiPass()
{
public String getWifiPass() {
return wifiPass;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("netName", getNetName())
.append("wifiName", getWifiName())
.append("wifiPass", getWifiPass())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
public void setWifiPass(String wifiPass) {
this.wifiPass = wifiPass;
}
}

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

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

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

@ -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,61 +1,78 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.system.domain.BNet;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Mapper
*
*
* @author ruoyi
* @date 2023-11-21
*/
public interface BNetMapper
{
public interface BNetMapper {
/**
*
*
*
* @param id
* @return
*/
public BNet selectBNetById(Long id);
BNet selectBNetById(Long id);
/**
*
*
*
* @param bNet
* @return
*/
public List<BNet> selectBNetList(BNet bNet);
List<BNet> selectBNetList(BNet bNet);
/**
*
*
*
* @param bNet
* @return
*/
public int insertBNet(BNet bNet);
int insertBNet(BNet bNet);
/**
*
*
*
* @param bNet
* @return
*/
public int updateBNet(BNet bNet);
int updateBNet(BNet bNet);
/**
*
*
*
* @param id
* @return
*/
public int deleteBNetById(Long id);
int deleteBNetById(Long id);
/**
*
*
*
* @param ids
* @return
*/
public int deleteBNetByIds(Long[] ids);
int deleteBNetByIds(Long[] ids);
/**
* idwifi
*
* @param id id
*/
void deleteBNetByShangHuId(Long id);
/**
* idwifi
*
* @param shanghuId id
* @return wifi
*/
BNet findByShanghuId(@Param("shanghuId") Long shanghuId);
}

@ -1,61 +1,79 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.system.domain.BShanghu;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Mapper
*
*
* @author ruoyi
* @date 2023-11-21
*/
public interface BShanghuMapper
{
public interface BShanghuMapper {
/**
*
*
*
* @param id
* @return
*/
public BShanghu selectBShanghuById(Long id);
BShanghu selectBShanghuById(Long id);
/**
*
*
*
* @param bShanghu
* @return
*/
public List<BShanghu> selectBShanghuList(BShanghu bShanghu);
List<BShanghu> selectBShanghuList(BShanghu bShanghu);
/**
*
*
*
* @param bShanghu
* @return
*/
public int insertBShanghu(BShanghu bShanghu);
int insertBShanghu(BShanghu bShanghu);
/**
*
*
*
* @param bShanghu
* @return
*/
public int updateBShanghu(BShanghu bShanghu);
int updateBShanghu(BShanghu bShanghu);
/**
*
*
*
* @param id
* @return
*/
public int deleteBShanghuById(Long id);
int deleteBShanghuById(Long id);
/**
*
*
*
* @param ids
* @return
*/
public int deleteBShanghuByIds(Long[] ids);
int deleteBShanghuByIds(Long[] ids);
/**
* 广
*
* @param posterId 广id
* @param list id
*/
void editPostIdByIds(@Param("posterId") Long posterId, @Param("list") List<Long> list);
/**
* 广
*
* @param posterId 广id
* @param shanghuCity
* @param shanghuName
*/
void editPostIdByReq(@Param("posterId") Long posterId, @Param("shanghuCity") String shanghuCity, @Param("shanghuName") String shanghuName);
}

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

@ -1,61 +1,69 @@
package com.ruoyi.system.service;
import java.util.List;
import com.ruoyi.system.domain.BPoster;
import com.ruoyi.system.domain.dto.request.PosterRequest;
import java.util.List;
/**
* 广Service
*
*
* @author ruoyi
* @date 2023-11-21
*/
public interface IBPosterService
{
public interface IBPosterService {
/**
* 广
*
*
* @param id 广
* @return 广
*/
public BPoster selectBPosterById(Long id);
BPoster selectBPosterById(Long id);
/**
* 广
*
*
* @param bPoster 广
* @return 广
*/
public List<BPoster> selectBPosterList(BPoster bPoster);
List<BPoster> selectBPosterList(BPoster bPoster);
/**
* 广
*
*
* @param bPoster 广
* @return
*/
public int insertBPoster(BPoster bPoster);
int insertBPoster(BPoster bPoster);
/**
* 广
*
*
* @param bPoster 广
* @return
*/
public int updateBPoster(BPoster bPoster);
int updateBPoster(BPoster bPoster);
/**
* 广
*
*
* @param ids 广
* @return
*/
public int deleteBPosterByIds(Long[] ids);
int deleteBPosterByIds(Long[] ids);
/**
* 广
*
*
* @param id 广
* @return
*/
public int deleteBPosterById(Long id);
int deleteBPosterById(Long id);
/**
* 广
*
* @param req
*/
void batchAllocation(PosterRequest req);
}

@ -1,61 +1,80 @@
package com.ruoyi.system.service;
import java.util.List;
import com.ruoyi.system.domain.BNet;
import com.ruoyi.system.domain.BShanghu;
import java.util.List;
/**
* Service
*
*
* @author ruoyi
* @date 2023-11-21
*/
public interface IBShanghuService
{
public interface IBShanghuService {
/**
*
*
*
* @param id
* @return
*/
public BShanghu selectBShanghuById(Long id);
BShanghu selectBShanghuById(Long id);
/**
*
*
*
* @param bShanghu
* @return
*/
public List<BShanghu> selectBShanghuList(BShanghu bShanghu);
List<BShanghu> selectBShanghuList(BShanghu bShanghu);
/**
*
*
*
* @param bShanghu
* @return
*/
public int insertBShanghu(BShanghu bShanghu);
int insertBShanghu(BShanghu bShanghu);
/**
*
*
*
* @param bShanghu
* @return
*/
public int updateBShanghu(BShanghu bShanghu);
int updateBShanghu(BShanghu bShanghu);
/**
*
*
*
* @param ids
* @return
*/
public int deleteBShanghuByIds(Long[] ids);
int deleteBShanghuByIds(Long[] ids);
/**
*
*
*
* @param id
* @return
*/
public int deleteBShanghuById(Long id);
int deleteBShanghuById(Long id);
/**
* 广
*
* @param posterId 广id
* @param shanghuIds id
*/
void editPostIdByIds(Long posterId, List<Long> shanghuIds);
/**
* 广
*
* @param posterId 广id
* @param shanghuCity
* @param shanghuName
*/
void editPostIdByReq(Long posterId, String shanghuCity, String shanghuName);
}

@ -1,96 +1,121 @@
package com.ruoyi.system.service.impl;
import java.util.List;
import cn.hutool.core.bean.BeanUtil;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.BNetMapper;
import com.ruoyi.system.domain.BNet;
import com.ruoyi.system.mapper.BNetMapper;
import com.ruoyi.system.service.IBNetService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* Service
*
*
* @author ruoyi
* @date 2023-11-21
*/
@Service
public class BNetServiceImpl implements IBNetService
{
@Autowired
public class BNetServiceImpl implements IBNetService {
@Resource
private BNetMapper bNetMapper;
/**
*
*
*
* @param id
* @return
*/
@Override
public BNet selectBNetById(Long id)
{
public BNet selectBNetById(Long id) {
return bNetMapper.selectBNetById(id);
}
/**
*
*
*
* @param bNet
* @return
*/
@Override
public List<BNet> selectBNetList(BNet bNet)
{
public List<BNet> selectBNetList(BNet bNet) {
return bNetMapper.selectBNetList(bNet);
}
/**
*
*
*
* @param bNet
* @return
*/
@Override
public int insertBNet(BNet bNet)
{
public int insertBNet(BNet bNet) {
if (bNet.getShanghuId() == null) {
throw new ServiceException("商户id不能为空");
}
BNet net = bNetMapper.findByShanghuId(bNet.getShanghuId());
if (BeanUtil.isNotEmpty(net)) {
throw new ServiceException("已经存在wifi网络不能新增");
}
bNet.setCreateTime(DateUtils.getNowDate());
return bNetMapper.insertBNet(bNet);
}
/**
*
*
*
* @param bNet
* @return
*/
@Override
public int updateBNet(BNet bNet)
{
public int updateBNet(BNet bNet) {
bNet.setUpdateTime(DateUtils.getNowDate());
return bNetMapper.updateBNet(bNet);
}
/**
*
*
*
* @param ids
* @return
*/
@Override
public int deleteBNetByIds(Long[] ids)
{
public int deleteBNetByIds(Long[] ids) {
return bNetMapper.deleteBNetByIds(ids);
}
/**
*
*
*
* @param id
* @return
*/
@Override
public int deleteBNetById(Long id)
{
public int deleteBNetById(Long id) {
return bNetMapper.deleteBNetById(id);
}
/**
* 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,96 +1,123 @@
package com.ruoyi.system.service.impl;
import java.util.List;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.BPosterMapper;
import com.ruoyi.system.domain.BPoster;
import com.ruoyi.system.domain.dto.request.PosterRequest;
import com.ruoyi.system.mapper.BPosterMapper;
import com.ruoyi.system.service.IBPosterService;
import com.ruoyi.system.service.IBShanghuService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* 广Service
*
*
* @author ruoyi
* @date 2023-11-21
*/
@Service
public class BPosterServiceImpl implements IBPosterService
{
@Autowired
public class BPosterServiceImpl implements IBPosterService {
@Resource
private BPosterMapper bPosterMapper;
@Resource
private IBShanghuService shanghuService;
/**
* 广
*
*
* @param id 广
* @return 广
*/
@Override
public BPoster selectBPosterById(Long id)
{
public BPoster selectBPosterById(Long id) {
return bPosterMapper.selectBPosterById(id);
}
/**
* 广
*
*
* @param bPoster 广
* @return 广
*/
@Override
public List<BPoster> selectBPosterList(BPoster bPoster)
{
public List<BPoster> selectBPosterList(BPoster bPoster) {
return bPosterMapper.selectBPosterList(bPoster);
}
/**
* 广
*
*
* @param bPoster 广
* @return
*/
@Override
public int insertBPoster(BPoster bPoster)
{
public int insertBPoster(BPoster bPoster) {
bPoster.setCreateTime(DateUtils.getNowDate());
return bPosterMapper.insertBPoster(bPoster);
}
/**
* 广
*
*
* @param bPoster 广
* @return
*/
@Override
public int updateBPoster(BPoster bPoster)
{
public int updateBPoster(BPoster bPoster) {
bPoster.setUpdateTime(DateUtils.getNowDate());
return bPosterMapper.updateBPoster(bPoster);
}
/**
* 广
*
*
* @param ids 广
* @return
*/
@Override
public int deleteBPosterByIds(Long[] ids)
{
public int deleteBPosterByIds(Long[] ids) {
return bPosterMapper.deleteBPosterByIds(ids);
}
/**
* 广
*
*
* @param id 广
* @return
*/
@Override
public int deleteBPosterById(Long id)
{
public int deleteBPosterById(Long id) {
return bPosterMapper.deleteBPosterById(id);
}
/**
* 广
*
* @param req
*/
@Override
public void batchAllocation(PosterRequest req) {
BPoster bPoster = bPosterMapper.selectBPosterById(req.getPosterId());
if (BeanUtil.isEmpty(bPoster)) {
throw new ServiceException("所选广告不存在");
}
if (CollectionUtil.isNotEmpty(req.getShanghuIds())) {
shanghuService.editPostIdByIds(req.getPosterId(), req.getShanghuIds());
return;
}
if (StrUtil.isNotEmpty(req.getShanghuCity())||StrUtil.isNotEmpty(req.getShanghuName())) {
shanghuService.editPostIdByReq(req.getPosterId(),req.getShanghuCity(),req.getShanghuName());
return;
}
throw new ServiceException("参数错误");
}
}

@ -1,96 +1,148 @@
package com.ruoyi.system.service.impl;
import java.util.List;
import cn.hutool.core.bean.BeanUtil;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.BShanghuMapper;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.system.domain.BPoster;
import com.ruoyi.system.domain.BShanghu;
import com.ruoyi.system.mapper.BShanghuMapper;
import com.ruoyi.system.service.IBNetService;
import com.ruoyi.system.service.IBPosterService;
import com.ruoyi.system.service.IBShanghuService;
import com.ruoyi.system.service.ISysUserService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* Service
*
*
* @author ruoyi
* @date 2023-11-21
*/
@Service
public class BShanghuServiceImpl implements IBShanghuService
{
@Autowired
public class BShanghuServiceImpl implements IBShanghuService {
@Resource
private BShanghuMapper bShanghuMapper;
@Resource
private ISysUserService userService;
@Resource
private IBPosterService posterService;
@Resource
private IBNetService netService;
/**
*
*
*
* @param id
* @return
*/
@Override
public BShanghu selectBShanghuById(Long id)
{
public BShanghu selectBShanghuById(Long id) {
return bShanghuMapper.selectBShanghuById(id);
}
/**
*
*
*
* @param bShanghu
* @return
*/
@Override
public List<BShanghu> selectBShanghuList(BShanghu bShanghu)
{
public List<BShanghu> selectBShanghuList(BShanghu bShanghu) {
return bShanghuMapper.selectBShanghuList(bShanghu);
}
/**
*
*
*
* @param bShanghu
* @return
*/
@Override
public int insertBShanghu(BShanghu bShanghu)
{
public int insertBShanghu(BShanghu bShanghu) {
bShanghu.setCreateTime(DateUtils.getNowDate());
SysUser user = new SysUser();
user.setUserName(bShanghu.getPhoneNumber());
user.setPassword(SecurityUtils.encryptPassword("123456"));
user.setNickName(bShanghu.getLinkMan());
// 注册用户
if (!userService.checkUserNameUnique(user)) {
throw new ServiceException("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
}
userService.insertUser(user);
return bShanghuMapper.insertBShanghu(bShanghu);
}
/**
*
*
*
* @param bShanghu
* @return
*/
@Override
public int updateBShanghu(BShanghu bShanghu)
{
public int updateBShanghu(BShanghu bShanghu) {
if (bShanghu.getPosterId() != null) {
BPoster bPoster = posterService.selectBPosterById(bShanghu.getPosterId());
if (BeanUtil.isEmpty(bPoster)) {
throw new ServiceException("所选广告不存在");
}
}
bShanghu.setUpdateTime(DateUtils.getNowDate());
return bShanghuMapper.updateBShanghu(bShanghu);
}
/**
*
*
*
* @param ids
* @return
*/
@Override
public int deleteBShanghuByIds(Long[] ids)
{
public int deleteBShanghuByIds(Long[] ids) {
return bShanghuMapper.deleteBShanghuByIds(ids);
}
/**
*
*
*
* @param id
* @return
*/
@Override
public int deleteBShanghuById(Long id)
{
public int deleteBShanghuById(Long id) {
// 删除商户wifi
netService.deleteBNetByShangHuId(id);
return bShanghuMapper.deleteBShanghuById(id);
}
/**
* 广
*
* @param posterId 广id
* @param shanghuIds id
*/
@Override
public void editPostIdByIds(Long posterId, List<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;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.file.FileUploadUtils;
import com.ruoyi.common.utils.file.FileUtils;
import com.ruoyi.framework.config.ServerConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -13,43 +16,35 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.file.FileUploadUtils;
import com.ruoyi.common.utils.file.FileUtils;
import com.ruoyi.framework.config.ServerConfig;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
/**
*
*
*
* @author ruoyi
*/
@RestController
@RequestMapping("/common")
public class CommonController
{
public class CommonController {
private static final Logger log = LoggerFactory.getLogger(CommonController.class);
private static final String FILE_DELIMETER = ",";
@Autowired
private ServerConfig serverConfig;
private static final String FILE_DELIMETER = ",";
/**
*
*
*
* @param fileName
* @param delete
* @param delete
*/
@GetMapping("/download")
public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request)
{
try
{
if (!FileUtils.checkAllowDownload(fileName))
{
public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request) {
try {
if (!FileUtils.checkAllowDownload(fileName)) {
throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName));
}
String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1);
@ -58,13 +53,10 @@ public class CommonController
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
FileUtils.setAttachmentResponseHeader(response, realFileName);
FileUtils.writeBytes(filePath, response.getOutputStream());
if (delete)
{
if (delete) {
FileUtils.deleteFile(filePath);
}
}
catch (Exception e)
{
} catch (Exception e) {
log.error("下载文件失败", e);
}
}
@ -73,10 +65,8 @@ public class CommonController
*
*/
@PostMapping("/upload")
public AjaxResult uploadFile(MultipartFile file) throws Exception
{
try
{
public AjaxResult uploadFile(MultipartFile file) throws Exception {
try {
// 上传文件路径
String filePath = RuoYiConfig.getUploadPath();
// 上传并返回新文件名称
@ -88,9 +78,7 @@ public class CommonController
ajax.put("newFileName", FileUtils.getName(fileName));
ajax.put("originalFilename", file.getOriginalFilename());
return ajax;
}
catch (Exception e)
{
} catch (Exception e) {
return AjaxResult.error(e.getMessage());
}
}
@ -99,18 +87,15 @@ public class CommonController
*
*/
@PostMapping("/uploads")
public AjaxResult uploadFiles(List<MultipartFile> files) throws Exception
{
try
{
public AjaxResult uploadFiles(List<MultipartFile> files) throws Exception {
try {
// 上传文件路径
String filePath = RuoYiConfig.getUploadPath();
List<String> urls = new ArrayList<String>();
List<String> fileNames = new ArrayList<String>();
List<String> newFileNames = new ArrayList<String>();
List<String> originalFilenames = new ArrayList<String>();
for (MultipartFile file : files)
{
for (MultipartFile file : files) {
// 上传并返回新文件名称
String fileName = FileUploadUtils.upload(filePath, file);
String url = serverConfig.getUrl() + fileName;
@ -125,9 +110,7 @@ public class CommonController
ajax.put("newFileNames", StringUtils.join(newFileNames, FILE_DELIMETER));
ajax.put("originalFilenames", StringUtils.join(originalFilenames, FILE_DELIMETER));
return ajax;
}
catch (Exception e)
{
} catch (Exception e) {
return AjaxResult.error(e.getMessage());
}
}
@ -137,12 +120,9 @@ public class CommonController
*/
@GetMapping("/download/resource")
public void resourceDownload(String resource, HttpServletRequest request, HttpServletResponse response)
throws Exception
{
try
{
if (!FileUtils.checkAllowDownload(resource))
{
throws Exception {
try {
if (!FileUtils.checkAllowDownload(resource)) {
throw new Exception(StringUtils.format("资源文件({})非法,不允许下载。 ", resource));
}
// 本地资源路径
@ -154,9 +134,7 @@ public class CommonController
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
FileUtils.setAttachmentResponseHeader(response, downloadName);
FileUtils.writeBytes(downloadPath, response.getOutputStream());
}
catch (Exception e)
{
} catch (Exception e) {
log.error("下载文件失败", e);
}
}

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

@ -17,7 +17,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<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>
<select id="selectBNetList" parameterType="BNet" resultMap="BNetResult">
@ -31,7 +31,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectBNetVo"/>
where id = #{id}
</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 into b_net
<trim prefix="(" suffix=")" suffixOverrides=",">
@ -81,4 +88,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<delete id="deleteBNetByShangHuId">
delete
from b_net
where shanghu_id = #{id}
</delete>
</mapper>

@ -84,6 +84,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
where id = #{id}
</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 from b_shanghu where id = #{id}

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

Loading…
Cancel
Save