From 5ed0e121513898ab3faba2dd76c94e1f953777f9 Mon Sep 17 00:00:00 2001 From: x_z Date: Thu, 22 Sep 2022 18:18:48 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E5=A4=8D=E9=83=A8=E5=88=86bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/auth/AuthAdminController.java | 2 +- .../controller/auth/RegisterController.java | 6 +++++- .../basic/BussinessTypeController.java | 4 ---- .../glxp/udi/admin/dao/auth/DeviceKeyDao.java | 2 +- .../admin/dao/inventory/InvWarehouseDao.java | 9 --------- .../admin/entity/auth/AuthPermissionRule.java | 2 ++ .../udi/admin/res/auth/CheckCodeRequest.java | 2 ++ .../admin/service/auth/DeviceKeyService.java | 4 ++-- .../inventory/InvWarehouseService.java | 20 ++++++++++++------- .../mapper/inventory/InvWarehouseDao.xml | 7 ------- 10 files changed, 26 insertions(+), 32 deletions(-) diff --git a/src/main/java/com/glxp/udi/admin/controller/auth/AuthAdminController.java b/src/main/java/com/glxp/udi/admin/controller/auth/AuthAdminController.java index 94ac32e..09eb303 100644 --- a/src/main/java/com/glxp/udi/admin/controller/auth/AuthAdminController.java +++ b/src/main/java/com/glxp/udi/admin/controller/auth/AuthAdminController.java @@ -364,7 +364,7 @@ public class AuthAdminController { return authAdminRoleResponse; }).collect(Collectors.toList()); pageSimpleResponse.setList(authAdminRoleResponses); - return ResultVOUtils.success(authAdminRoleResponses); + return ResultVOUtils.success(pageSimpleResponse); } } diff --git a/src/main/java/com/glxp/udi/admin/controller/auth/RegisterController.java b/src/main/java/com/glxp/udi/admin/controller/auth/RegisterController.java index 7c407f0..20930b0 100644 --- a/src/main/java/com/glxp/udi/admin/controller/auth/RegisterController.java +++ b/src/main/java/com/glxp/udi/admin/controller/auth/RegisterController.java @@ -1,6 +1,7 @@ package com.glxp.udi.admin.controller.auth; import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.glxp.udi.admin.annotation.AuthRuleAnnotation; @@ -93,6 +94,9 @@ public class RegisterController { @PostMapping("udiwarehouse/register/getCheckcode") public BaseResponse getCheckcode(@RequestBody CheckCodeRequest checkCodeRequest, HttpSession httpSession) { + if (StrUtil.isBlank(checkCodeRequest.getPhoneNum())) { + return ResultVOUtils.error(500, "请输入手机号!"); + } if (checkCodeRequest.getUserName() != null) { AuthAdmin authAdmin = authAdminService.findByUserName(checkCodeRequest.getUserName()); @@ -110,7 +114,7 @@ public class RegisterController { int mobile_code = (int) ((Math.random() * 9 + 1) * 100000); MultiValueMap postParameters = new LinkedMultiValueMap<>(); int time = 5; - String content = new String("您正在进行手机验证,验证码是" + mobile_code + "," + time + "分钟内有效。"); + String content = "您正在进行手机验证,验证码是" + mobile_code + "," + time + "分钟内有效。"; postParameters.add("account", "C07086222"); postParameters.add("password", "2dddbbf73636c193c5903324bdb47c5c"); postParameters.add("mobile", checkCodeRequest.getPhoneNum()); diff --git a/src/main/java/com/glxp/udi/admin/controller/basic/BussinessTypeController.java b/src/main/java/com/glxp/udi/admin/controller/basic/BussinessTypeController.java index 4fd995c..67b2da1 100644 --- a/src/main/java/com/glxp/udi/admin/controller/basic/BussinessTypeController.java +++ b/src/main/java/com/glxp/udi/admin/controller/basic/BussinessTypeController.java @@ -160,10 +160,6 @@ public class BussinessTypeController { } List bussinessTypeEntities = bussinessTypeService.candidateBussinessType(cndidateRequest.getMainAction(), cndidateRequest.getCustomerId()); - if (!StrUtil.isEmpty(cndidateRequest.getCurAction())) { - BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(cndidateRequest.getCurAction(), cndidateRequest.getCustomerId()); - bussinessTypeEntities.add(bussinessTypeEntity); - } //查询补单单据类型 return ResultVOUtils.success(bussinessTypeEntities); } diff --git a/src/main/java/com/glxp/udi/admin/dao/auth/DeviceKeyDao.java b/src/main/java/com/glxp/udi/admin/dao/auth/DeviceKeyDao.java index a91585d..d874bad 100644 --- a/src/main/java/com/glxp/udi/admin/dao/auth/DeviceKeyDao.java +++ b/src/main/java/com/glxp/udi/admin/dao/auth/DeviceKeyDao.java @@ -32,5 +32,5 @@ public interface DeviceKeyDao extends BaseMapper { * @param customerId * @return */ - IPage findDeviceKeyByCustomerId(IPage page, @Param("imei") String imei, @Param("isCheck") String isCheck, @Param("customerIds") List customerIds); + IPage findDeviceKeyByCustomerId(@Param("page") IPage page, @Param("imei") String imei, @Param("isCheck") String isCheck, @Param("customerIds") List customerIds); } diff --git a/src/main/java/com/glxp/udi/admin/dao/inventory/InvWarehouseDao.java b/src/main/java/com/glxp/udi/admin/dao/inventory/InvWarehouseDao.java index 026ee1b..f793013 100644 --- a/src/main/java/com/glxp/udi/admin/dao/inventory/InvWarehouseDao.java +++ b/src/main/java/com/glxp/udi/admin/dao/inventory/InvWarehouseDao.java @@ -42,13 +42,4 @@ public interface InvWarehouseDao extends BaseMapper { String selectNameByCode(@Param("code") String code); - /** - * 根据客户ID和仓库名称统计仓库数量 - * - * @param name - * @param customerId - * @param code 仓库码 - * @return - */ - int count(@Param("name") String name, @Param("customerId") String customerId, @Param("code") String code); } diff --git a/src/main/java/com/glxp/udi/admin/entity/auth/AuthPermissionRule.java b/src/main/java/com/glxp/udi/admin/entity/auth/AuthPermissionRule.java index c661a2f..c48aa05 100644 --- a/src/main/java/com/glxp/udi/admin/entity/auth/AuthPermissionRule.java +++ b/src/main/java/com/glxp/udi/admin/entity/auth/AuthPermissionRule.java @@ -21,8 +21,10 @@ public class AuthPermissionRule { private String title; + @TableField("`status`") private Integer status; + @TableField("`condition`") private String condition; private Integer listorder; diff --git a/src/main/java/com/glxp/udi/admin/res/auth/CheckCodeRequest.java b/src/main/java/com/glxp/udi/admin/res/auth/CheckCodeRequest.java index 3517825..08d15f3 100644 --- a/src/main/java/com/glxp/udi/admin/res/auth/CheckCodeRequest.java +++ b/src/main/java/com/glxp/udi/admin/res/auth/CheckCodeRequest.java @@ -4,6 +4,8 @@ import lombok.Data; @Data public class CheckCodeRequest { + private String phoneNum; + private String userName; } diff --git a/src/main/java/com/glxp/udi/admin/service/auth/DeviceKeyService.java b/src/main/java/com/glxp/udi/admin/service/auth/DeviceKeyService.java index 1dd7552..1eeb799 100644 --- a/src/main/java/com/glxp/udi/admin/service/auth/DeviceKeyService.java +++ b/src/main/java/com/glxp/udi/admin/service/auth/DeviceKeyService.java @@ -20,7 +20,7 @@ import java.util.List; @Slf4j @Service @Transactional(rollbackFor = Exception.class) -public class DeviceKeyService { +public class DeviceKeyService { @Resource private DeviceKeyDao deviceKeyDao; @@ -62,6 +62,6 @@ public class DeviceKeyService { } } IPage page = new Page<>(filterDeviceKeyRequest.getPage(), filterDeviceKeyRequest.getLimit()); - return deviceKeyDao.findDeviceKeyByCustomerId(page, filterDeviceKeyRequest.getImei(), filterDeviceKeyRequest.getIsCheck(),filterDeviceKeyRequest.getCustomerIds()); + return deviceKeyDao.findDeviceKeyByCustomerId(page, filterDeviceKeyRequest.getImei(), filterDeviceKeyRequest.getIsCheck(), filterDeviceKeyRequest.getCustomerIds()); } } diff --git a/src/main/java/com/glxp/udi/admin/service/inventory/InvWarehouseService.java b/src/main/java/com/glxp/udi/admin/service/inventory/InvWarehouseService.java index da0b5d5..dbfdd59 100644 --- a/src/main/java/com/glxp/udi/admin/service/inventory/InvWarehouseService.java +++ b/src/main/java/com/glxp/udi/admin/service/inventory/InvWarehouseService.java @@ -87,10 +87,11 @@ public class InvWarehouseService { if (filterInvWarehouseRequest == null) { return Collections.emptyList(); } - Page page = new Page<>(filterInvWarehouseRequest.getPage(), filterInvWarehouseRequest.getLimit()); - Page pageResult = warehouseUserDao.selectCodeByUser(page, String.valueOf(filterInvWarehouseRequest.getUserId())); + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("userId", filterInvWarehouseRequest.getUserId()); + List warehouseUserEntities = warehouseUserDao.selectList(wrapper); List invWarehouseEntities = new ArrayList<>(); - for (WarehouseUserEntity warehouseUserEntity : pageResult.getRecords()) { + for (WarehouseUserEntity warehouseUserEntity : warehouseUserEntities) { filterInvWarehouseRequest.setCode(warehouseUserEntity.getCode()); invWarehouseEntities.addAll(invWarehouseDao.filterGroupInvWarehouse(filterInvWarehouseRequest)); } @@ -175,11 +176,16 @@ public class InvWarehouseService { * @return */ public boolean checkNameExist(String name, String customerId, String code) { - if (StrUtil.isBlank(code)) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StrUtil.isNotBlank(name), "name", name) + .eq(StrUtil.isNotBlank(customerId), "customerId", customerId) + .eq(StrUtil.isNotBlank(code), "code", code); + long count = invWarehouseDao.selectCount(wrapper); + if (count == 1 && StrUtil.isNotBlank(code)) { return false; - } - int count = invWarehouseDao.count(name, customerId, code); - if (count == 1) { + } else if (count == 0 && StrUtil.isBlank(code)) { + return false; + } else if (count == 0 && StrUtil.isNotBlank(code)) { return false; } return true; diff --git a/src/main/resources/mybatis/mapper/inventory/InvWarehouseDao.xml b/src/main/resources/mybatis/mapper/inventory/InvWarehouseDao.xml index f67e4f3..6999db9 100644 --- a/src/main/resources/mybatis/mapper/inventory/InvWarehouseDao.xml +++ b/src/main/resources/mybatis/mapper/inventory/InvWarehouseDao.xml @@ -210,11 +210,4 @@ where code = #{code} - \ No newline at end of file