账户条款查询api
This commit is contained in:
@@ -0,0 +1,23 @@
|
|||||||
|
package com.zt.plat.module.api;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
|
import com.zt.plat.module.api.dto.AccountRespDto;
|
||||||
|
import com.zt.plat.module.base.enums.ApiConstants;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@FeignClient(name = ApiConstants.NAME)
|
||||||
|
@Tag(name = "RPC 服务 - base")
|
||||||
|
public interface BaseApi {
|
||||||
|
|
||||||
|
String PREFIX = ApiConstants.PREFIX + "/base";
|
||||||
|
|
||||||
|
@GetMapping(PREFIX + "/getNoPage")
|
||||||
|
@Operation(summary = "数据查询")
|
||||||
|
List<AccountRespDto> getNoPage(@Valid AccountRespDto respVO);
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package com.zt.plat.module.api.dto;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Schema(description = "RPC 服务 DTO")
|
||||||
|
@Data
|
||||||
|
public class AccountRespDto {
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
private String accountName;
|
||||||
|
|
||||||
|
private String bankAccount;
|
||||||
|
|
||||||
|
private String accountNumber;
|
||||||
|
|
||||||
|
private String taxNumber;
|
||||||
|
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
private String isEnable;
|
||||||
|
|
||||||
|
private String customerNumber;
|
||||||
|
|
||||||
|
private String customerName;
|
||||||
|
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.zt.plat.module.base.enums;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.enums.RpcConstants;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API 相关的枚举
|
||||||
|
*
|
||||||
|
* @author ZT
|
||||||
|
*/
|
||||||
|
public class ApiConstants {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务名
|
||||||
|
*
|
||||||
|
* 注意,需要保证和 spring.application.name 保持一致
|
||||||
|
*/
|
||||||
|
public static final String NAME = "base-server";
|
||||||
|
|
||||||
|
public static final String PREFIX = RpcConstants.RPC_API_PREFIX + "/base";
|
||||||
|
|
||||||
|
public static final String VERSION = "1.0.0";
|
||||||
|
|
||||||
|
public static final String TABLE_FIELD_SPLY_ERP_CPN_NUM = "NUM";
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.zt.plat.module.base.api;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
|
import com.zt.plat.module.api.BaseApi;
|
||||||
|
import com.zt.plat.module.api.dto.AccountRespDto;
|
||||||
|
import com.zt.plat.module.base.dal.dataobject.base.AccountDO;
|
||||||
|
import com.zt.plat.module.base.service.base.AccountService;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ERP Api 实现类
|
||||||
|
*
|
||||||
|
* @author ZT
|
||||||
|
* @author jason
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@Validated
|
||||||
|
public class BaseApiImpl implements BaseApi {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private AccountService accountService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AccountRespDto> getNoPage(AccountRespDto respVO) {
|
||||||
|
return accountService.getAccountNoPage(respVO);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,10 +3,14 @@ package com.zt.plat.module.base.dal.mysql.base;
|
|||||||
import com.zt.plat.framework.common.pojo.PageResult;
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import com.zt.plat.module.api.dto.AccountRespDto;
|
||||||
import com.zt.plat.module.base.controller.admin.base.vo.AccountPageReqVO;
|
import com.zt.plat.module.base.controller.admin.base.vo.AccountPageReqVO;
|
||||||
|
import com.zt.plat.module.base.controller.admin.base.vo.AccountRespVO;
|
||||||
import com.zt.plat.module.base.dal.dataobject.base.AccountDO;
|
import com.zt.plat.module.base.dal.dataobject.base.AccountDO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 账户条款 Mapper
|
* 账户条款 Mapper
|
||||||
*
|
*
|
||||||
@@ -31,4 +35,18 @@ public interface AccountMapper extends BaseMapperX<AccountDO> {
|
|||||||
.orderByDesc(AccountDO::getId));
|
.orderByDesc(AccountDO::getId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default List<AccountDO> selectNoPage(AccountRespDto reqVO){
|
||||||
|
return selectList(new LambdaQueryWrapperX<AccountDO>()
|
||||||
|
.eqIfPresent(AccountDO::getType, reqVO.getType())
|
||||||
|
.likeIfPresent(AccountDO::getAccountName, reqVO.getAccountName())
|
||||||
|
.likeIfPresent(AccountDO::getAddress, reqVO.getAddress())
|
||||||
|
.likeIfPresent(AccountDO::getPhone, reqVO.getPhone())
|
||||||
|
.eqIfPresent(AccountDO::getBankAccount, reqVO.getBankAccount())
|
||||||
|
.eqIfPresent(AccountDO::getCustomerName, reqVO.getCustomerName())
|
||||||
|
.eqIfPresent(AccountDO::getCustomerNumber, reqVO.getCustomerNumber())
|
||||||
|
.eqIfPresent(AccountDO::getIsEnable, reqVO.getIsEnable())
|
||||||
|
.eqIfPresent(AccountDO::getAccountNumber, reqVO.getAccountNumber())
|
||||||
|
.eqIfPresent(AccountDO::getTaxNumber, reqVO.getTaxNumber())
|
||||||
|
.orderByDesc(AccountDO::getId));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.zt.plat.module.base.service.base;
|
package com.zt.plat.module.base.service.base;
|
||||||
|
|
||||||
import com.zt.plat.framework.common.pojo.PageResult;
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.module.api.dto.AccountRespDto;
|
||||||
import com.zt.plat.module.base.controller.admin.base.vo.AccountPageReqVO;
|
import com.zt.plat.module.base.controller.admin.base.vo.AccountPageReqVO;
|
||||||
import com.zt.plat.module.base.controller.admin.base.vo.AccountRespVO;
|
import com.zt.plat.module.base.controller.admin.base.vo.AccountRespVO;
|
||||||
import com.zt.plat.module.base.controller.admin.base.vo.AccountSaveReqVO;
|
import com.zt.plat.module.base.controller.admin.base.vo.AccountSaveReqVO;
|
||||||
@@ -67,4 +68,6 @@ public interface AccountService {
|
|||||||
* @param saveReqVOS 账户条款
|
* @param saveReqVOS 账户条款
|
||||||
*/
|
*/
|
||||||
void enableAccountList(List<AccountSaveReqVO> saveReqVOS);
|
void enableAccountList(List<AccountSaveReqVO> saveReqVOS);
|
||||||
|
|
||||||
|
List<AccountRespDto> getAccountNoPage(AccountRespDto respVO);
|
||||||
}
|
}
|
||||||
@@ -3,6 +3,7 @@ package com.zt.plat.module.base.service.base;
|
|||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import com.zt.plat.framework.common.pojo.PageResult;
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
|
import com.zt.plat.module.api.dto.AccountRespDto;
|
||||||
import com.zt.plat.module.base.controller.admin.base.vo.AccountPageReqVO;
|
import com.zt.plat.module.base.controller.admin.base.vo.AccountPageReqVO;
|
||||||
import com.zt.plat.module.base.controller.admin.base.vo.AccountRespVO;
|
import com.zt.plat.module.base.controller.admin.base.vo.AccountRespVO;
|
||||||
import com.zt.plat.module.base.controller.admin.base.vo.AccountSaveReqVO;
|
import com.zt.plat.module.base.controller.admin.base.vo.AccountSaveReqVO;
|
||||||
@@ -96,4 +97,9 @@ public class AccountServiceImpl implements AccountService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AccountRespDto> getAccountNoPage(AccountRespDto respVO) {
|
||||||
|
List<AccountDO> entityList = accountMapper.selectNoPage(respVO);
|
||||||
|
return BeanUtils.toBean(entityList, AccountRespDto.class);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -30,6 +30,7 @@
|
|||||||
left join SPLY_ERP_CPN c on r.ERP_NUM = c.NUM
|
left join SPLY_ERP_CPN c on r.ERP_NUM = c.NUM
|
||||||
where d.DELETED = 0
|
where d.DELETED = 0
|
||||||
and d.IS_COMPANY = 1
|
and d.IS_COMPANY = 1
|
||||||
|
and r.DELETED = 0
|
||||||
<if test="name != null">
|
<if test="name != null">
|
||||||
and d.NAME = #{name}
|
and d.NAME = #{name}
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
Reference in New Issue
Block a user