add: 常量池类

This commit is contained in:
2023-12-06 16:06:57 +08:00
parent 045a1f9066
commit 1f680c1b0a
2 changed files with 18 additions and 1 deletions

View File

@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import lombok.AllArgsConstructor;
import org.nl.acs.common.base.CommonFinalParam;
import org.nl.acs.common.base.PageInfo;
import org.nl.acs.common.base.QueryHelpMybatisPlus;
import org.nl.acs.common.base.impl.CommonServiceImpl;
@@ -50,6 +51,8 @@ public class AddressServiceImpl extends CommonServiceImpl<AddressMapper, Address
// private final RedisUtils redisUtils;
private final AddressMapper sysInterfaceMethodsAddressMapper;
private final String delete = "";
@Override
public PageInfo<AddressDto> queryAll(AddressQueryParam query, Pageable pageable) {
IPage<Address> queryPage = PageUtil.toMybatisPage(pageable);
@@ -198,9 +201,10 @@ public class AddressServiceImpl extends CommonServiceImpl<AddressMapper, Address
@Override
@Transactional(rollbackFor = Exception.class)
public void create(AddressDto dto) {
CommonFinalParam commonFinalParam = new CommonFinalParam();
String Methods_code = dto.getMethods_code();
AddressDto methodsDto = this.findByCode(Methods_code);
if (methodsDto != null && methodsDto.getIs_delete().equals("0") && dto.getMethods_code().equals(methodsDto.getMethods_code())) {
if (methodsDto != null && commonFinalParam.getDELETE().equals(methodsDto.getIs_delete()) && dto.getMethods_code().equals(methodsDto.getMethods_code())) {
throw new BadRequestException(LangProcess.msg("error_checkExist", methodsDto.getMethods_code()));
}
Long userId = Long.valueOf(SecurityUtils.getCurrentUserId());

View File

@@ -0,0 +1,13 @@
/**
* @author ls
* @date 2023/12/6 16:04
*/
package org.nl.acs.common.base;
import lombok.Data;
@Data
public class CommonFinalParam {
private final String DELETE = "0";
}