Commit 2ab1b0f2 by 吴迪

【新增】

parent 9149956a
package io.office.modules.manage.controller; package io.office.modules.manage.controller;
import java.math.BigDecimal;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date; import java.util.Date;
import java.util.Map; import java.util.Map;
...@@ -47,7 +48,7 @@ public class BikefirmController { ...@@ -47,7 +48,7 @@ public class BikefirmController {
*/ */
@RequestMapping("/list") @RequestMapping("/list")
// @RequiresPermissions("manage:bikefirm:list") // @RequiresPermissions("manage:bikefirm:list")
public R list(@RequestParam Map<String, Object> params){ public R list(@RequestParam Map<String, Object> params) {
PageUtils page = bikefirmService.queryPage(params); PageUtils page = bikefirmService.queryPage(params);
return R.ok().put("page", page); return R.ok().put("page", page);
...@@ -59,7 +60,7 @@ public class BikefirmController { ...@@ -59,7 +60,7 @@ public class BikefirmController {
*/ */
@RequestMapping("/info/{id}") @RequestMapping("/info/{id}")
// @RequiresPermissions("manage:bikefirm:info") // @RequiresPermissions("manage:bikefirm:info")
public R info(@PathVariable("id") Integer id){ public R info(@PathVariable("id") Integer id) {
BikefirmEntity bikefirm = bikefirmService.getById(id); BikefirmEntity bikefirm = bikefirmService.getById(id);
return R.ok().put("bikefirm", bikefirm); return R.ok().put("bikefirm", bikefirm);
...@@ -70,7 +71,7 @@ public class BikefirmController { ...@@ -70,7 +71,7 @@ public class BikefirmController {
*/ */
@RequestMapping("/save") @RequestMapping("/save")
// @RequiresPermissions("manage:bikefirm:save") // @RequiresPermissions("manage:bikefirm:save")
public R save(@RequestBody BikefirmEntity bikefirm){ public R save(@RequestBody BikefirmEntity bikefirm) {
bikefirmService.save(bikefirm); bikefirmService.save(bikefirm);
return R.ok(); return R.ok();
...@@ -81,7 +82,7 @@ public class BikefirmController { ...@@ -81,7 +82,7 @@ public class BikefirmController {
*/ */
@RequestMapping("/update") @RequestMapping("/update")
// @RequiresPermissions("manage:bikefirm:update") // @RequiresPermissions("manage:bikefirm:update")
public R update(@RequestBody BikefirmEntity bikefirm){ public R update(@RequestBody BikefirmEntity bikefirm) {
bikefirmService.updateById(bikefirm); bikefirmService.updateById(bikefirm);
return R.ok(); return R.ok();
...@@ -92,7 +93,7 @@ public class BikefirmController { ...@@ -92,7 +93,7 @@ public class BikefirmController {
*/ */
@RequestMapping("/delete") @RequestMapping("/delete")
// @RequiresPermissions("manage:bikefirm:delete") // @RequiresPermissions("manage:bikefirm:delete")
public R delete(@RequestBody Integer[] ids){ public R delete(@RequestBody Integer[] ids) {
bikefirmService.removeByIds(Arrays.asList(ids)); bikefirmService.removeByIds(Arrays.asList(ids));
return R.ok(); return R.ok();
...@@ -103,18 +104,22 @@ public class BikefirmController { ...@@ -103,18 +104,22 @@ public class BikefirmController {
@PostMapping("/api/getBikeFirm") @PostMapping("/api/getBikeFirm")
public R getBikeFirm(@RequestBody BikeFirmVo bikeFirmVo, HttpServletRequest request) { public R getBikeFirm(@RequestBody BikeFirmVo bikeFirmVo, HttpServletRequest request) {
boolean captcha = sysCaptchaService.validate(bikeFirmVo.getUuid(), bikeFirmVo.getCaptcha()); boolean captcha = sysCaptchaService.validate(bikeFirmVo.getUuid(), bikeFirmVo.getCaptcha());
if(!captcha){ if (!captcha) {
return R.error("验证码不正确"); return R.error("验证码不正确");
} }
SearchgtinlogEntity searchgtinlogEntity = new SearchgtinlogEntity(); SearchgtinlogEntity searchgtinlogEntity = new SearchgtinlogEntity();
searchgtinlogEntity.setCreatedate(new Date()); searchgtinlogEntity.setCreatedate(new Date());
searchgtinlogEntity.setIp(IPUtils.getIpAddr(request)); 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.setKeyword(bikeFirmVo.getCode());
searchgtinlogEntity.setClassStr("自行车企业代码公告查询:企业代码查询"); searchgtinlogEntity.setClassStr("自行车企业代码公告查询:企业代码查询");
} }
if(StringUtils.isNotBlank(bikeFirmVo.getFirmName())) { if (StringUtils.isNotBlank(bikeFirmVo.getFirmName())) {
searchgtinlogEntity.setKeyword(bikeFirmVo.getFirmName()); searchgtinlogEntity.setKeyword(bikeFirmVo.getFirmName());
searchgtinlogEntity.setClassStr("自行车企业代码公告查询:企业名称查询"); searchgtinlogEntity.setClassStr("自行车企业代码公告查询:企业名称查询");
} }
...@@ -123,10 +128,10 @@ public class BikefirmController { ...@@ -123,10 +128,10 @@ public class BikefirmController {
//新增查询日志 //新增查询日志
searchgtinlogService.save(searchgtinlogEntity); 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