Browse Source

外部应用查询接口,增加根据内外部客户类型进行筛选

master
wxz 4 years ago
parent
commit
5a78896bd8
  1. 2
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalAppController.java
  2. 2
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/ExternalAppDao.java
  3. 2
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalAppService.java
  4. 4
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppServiceImpl.java
  5. 3
      epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalAppDao.xml

2
epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalAppController.java

@ -103,7 +103,7 @@ public class ExternalAppController {
*/
@PostMapping("/list")
public Result<PageData<ExternalAppResultDTO>> list(@RequestBody ExternalAppFormDTO formDTO) {
PageData<ExternalAppResultDTO> page = externalAppService.listPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getCustomerId());
PageData<ExternalAppResultDTO> page = externalAppService.listPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getCustomerId(), formDTO.getCustomerType());
return new Result<PageData<ExternalAppResultDTO>>().ok(page);
}

2
epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/ExternalAppDao.java

@ -39,7 +39,7 @@ public interface ExternalAppDao extends BaseDao<ExternalAppEntity> {
ExternalAppResultDTO getByNameAndCustomerId(@Param("appName") String appName, @Param("customerId") String customerId);
List<ExternalAppResultDTO> list(@Param("customerId") String customerId);
List<ExternalAppResultDTO> list(@Param("customerId") String customerId, @Param("customerType") String customerType);
List<String> getCustomerIds();

2
epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalAppService.java

@ -35,7 +35,7 @@ public interface ExternalAppService {
ExternalAppResultDTO updateById(String appId, String appName, String customerId, String customerType);
PageData<ExternalAppResultDTO> listPage(Integer pageNo, Integer pageSize, String customerId);
PageData<ExternalAppResultDTO> listPage(Integer pageNo, Integer pageSize, String customerId, String customerType);
List<String> getCustomerIds();

4
epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppServiceImpl.java

@ -158,9 +158,9 @@ public class ExternalAppServiceImpl implements ExternalAppService {
}
@Override
public PageData<ExternalAppResultDTO> listPage(Integer pageNo, Integer pageSize, String customerId) {
public PageData<ExternalAppResultDTO> listPage(Integer pageNo, Integer pageSize, String customerId, String customerType) {
PageHelper.startPage(pageNo, pageSize);
List<ExternalAppResultDTO> list = externalAppDao.list(customerId);
List<ExternalAppResultDTO> list = externalAppDao.list(customerId, customerType);
for (ExternalAppResultDTO app : list) {
// 设置客户类型中文
app.setCustomerTypeName(CustomerTypeEnum.getName(app.getCustomerType()));

3
epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalAppDao.xml

@ -45,6 +45,9 @@
<if test="customerId != null and customerId != ''">
AND ea.CUSTOMER_ID = #{customerId}
</if>
<if test="customerType != null and customerType != ''">
AND ea.CUSTOMER_TYPE = #{customerType}
</if>
</where>
</select>

Loading…
Cancel
Save