Commit 2956ec2f by ZhangYunfei

Merge remote-tracking branch 'origin/master'

parents 7f0873de 8a51cce4
package io.office.modules.manage.controller;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Date;
import java.util.Map;
......@@ -47,7 +48,7 @@ public class BikefirmController {
*/
@RequestMapping("/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);
return R.ok().put("page", page);
......@@ -59,7 +60,7 @@ public class BikefirmController {
*/
@RequestMapping("/info/{id}")
// @RequiresPermissions("manage:bikefirm:info")
public R info(@PathVariable("id") Integer id){
public R info(@PathVariable("id") Integer id) {
BikefirmEntity bikefirm = bikefirmService.getById(id);
return R.ok().put("bikefirm", bikefirm);
......@@ -70,7 +71,7 @@ public class BikefirmController {
*/
@RequestMapping("/save")
// @RequiresPermissions("manage:bikefirm:save")
public R save(@RequestBody BikefirmEntity bikefirm){
public R save(@RequestBody BikefirmEntity bikefirm) {
bikefirmService.save(bikefirm);
return R.ok();
......@@ -81,7 +82,7 @@ public class BikefirmController {
*/
@RequestMapping("/update")
// @RequiresPermissions("manage:bikefirm:update")
public R update(@RequestBody BikefirmEntity bikefirm){
public R update(@RequestBody BikefirmEntity bikefirm) {
bikefirmService.updateById(bikefirm);
return R.ok();
......@@ -92,7 +93,7 @@ public class BikefirmController {
*/
@RequestMapping("/delete")
// @RequiresPermissions("manage:bikefirm:delete")
public R delete(@RequestBody Integer[] ids){
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