Commit 2ab1b0f2 by 吴迪

【新增】

parent 9149956a
package io.office.modules.manage.controller;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Date;
import java.util.Map;
......@@ -28,7 +29,7 @@ import javax.servlet.http.HttpServletRequest;
* ${comments}
*
* @author wudi
* @email
* @email
* @date 2021-12-01 21:14:01
*/
@RestController
......@@ -46,8 +47,8 @@ public class BikefirmController {
* 列表
*/
@RequestMapping("/list")
// @RequiresPermissions("manage:bikefirm:list")
public R list(@RequestParam Map<String, Object> params){
// @RequiresPermissions("manage:bikefirm:list")
public R list(@RequestParam Map<String, Object> params) {
PageUtils page = bikefirmService.queryPage(params);
return R.ok().put("page", page);
......@@ -58,9 +59,9 @@ public class BikefirmController {
* 信息
*/
@RequestMapping("/info/{id}")
// @RequiresPermissions("manage:bikefirm:info")
public R info(@PathVariable("id") Integer id){
BikefirmEntity bikefirm = bikefirmService.getById(id);
// @RequiresPermissions("manage:bikefirm:info")
public R info(@PathVariable("id") Integer id) {
BikefirmEntity bikefirm = bikefirmService.getById(id);
return R.ok().put("bikefirm", bikefirm);
}
......@@ -69,9 +70,9 @@ public class BikefirmController {
* 保存
*/
@RequestMapping("/save")
// @RequiresPermissions("manage:bikefirm:save")
public R save(@RequestBody BikefirmEntity bikefirm){
bikefirmService.save(bikefirm);
// @RequiresPermissions("manage:bikefirm:save")
public R save(@RequestBody BikefirmEntity bikefirm) {
bikefirmService.save(bikefirm);
return R.ok();
}
......@@ -80,9 +81,9 @@ public class BikefirmController {
* 修改
*/
@RequestMapping("/update")
// @RequiresPermissions("manage:bikefirm:update")
public R update(@RequestBody BikefirmEntity bikefirm){
bikefirmService.updateById(bikefirm);
// @RequiresPermissions("manage:bikefirm:update")
public R update(@RequestBody BikefirmEntity bikefirm) {
bikefirmService.updateById(bikefirm);
return R.ok();
}
......@@ -91,9 +92,9 @@ public class BikefirmController {
* 删除
*/
@RequestMapping("/delete")
// @RequiresPermissions("manage:bikefirm:delete")
public R delete(@RequestBody Integer[] ids){
bikefirmService.removeByIds(Arrays.asList(ids));
// @RequiresPermissions("manage:bikefirm:delete")
public R delete(@RequestBody Integer[] ids) {
bikefirmService.removeByIds(Arrays.asList(ids));
return R.ok();
}
......@@ -103,18 +104,22 @@ public class BikefirmController {
@PostMapping("/api/getBikeFirm")
public R getBikeFirm(@RequestBody BikeFirmVo bikeFirmVo, HttpServletRequest request) {
boolean captcha = sysCaptchaService.validate(bikeFirmVo.getUuid(), bikeFirmVo.getCaptcha());
if(!captcha){
if (!captcha) {
return R.error("验证码不正确");
}
SearchgtinlogEntity searchgtinlogEntity = new SearchgtinlogEntity();
searchgtinlogEntity.setCreatedate(new Date());
searchgtinlogEntity.setIp(IPUtils.getIpAddr(request));
if(StringUtils.isNotBlank(bikeFirmVo.getCode())) {
if (StringUtils.isNotBlank(bikeFirmVo.getCode())) {
try {
new BigDecimal(bikeFirmVo.getCode()).toString();
} catch (Exception e) {
return R.error("请输入正常的企业代码!");
}
searchgtinlogEntity.setKeyword(bikeFirmVo.getCode());
searchgtinlogEntity.setClassStr("自行车企业代码公告查询:企业代码查询");
}
if(StringUtils.isNotBlank(bikeFirmVo.getFirmName())) {
if (StringUtils.isNotBlank(bikeFirmVo.getFirmName())) {
searchgtinlogEntity.setKeyword(bikeFirmVo.getFirmName());
searchgtinlogEntity.setClassStr("自行车企业代码公告查询:企业名称查询");
}
......@@ -123,10 +128,10 @@ public class BikefirmController {
//新增查询日志
searchgtinlogService.save(searchgtinlogEntity);
return R.ok().put("data",bikefirmService.getBikeFirm(bikeFirmVo));
}
return R.ok().
put("data", bikefirmService.getBikeFirm(bikeFirmVo));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment