Browse Source

租户编码对外接口

test
kilo 2 years ago
parent
commit
1e00b17d21
  1. 8
      blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/feign/IBasicTenantCodeClient.java
  2. 4
      blade-service/logpm-basic/src/main/java/com/logpm/basic/controller/BasicTenantCodeController.java
  3. 11
      blade-service/logpm-basic/src/main/java/com/logpm/basic/feign/BasicBasicTenantCodeClient.java
  4. 3
      blade-service/logpm-basic/src/main/java/com/logpm/basic/mapper/BasicTenantCodeMapper.java
  5. 4
      blade-service/logpm-basic/src/main/java/com/logpm/basic/mapper/BasicTenantCodeMapper.xml
  6. 2
      blade-service/logpm-basic/src/main/java/com/logpm/basic/service/IBasicTenantCodeService.java
  7. 15
      blade-service/logpm-basic/src/main/java/com/logpm/basic/service/impl/BasicTenantCodeServiceImpl.java

8
blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/feign/IBasicTenantCodeClient.java

@ -17,12 +17,14 @@ package com.logpm.basic.feign;
* Author: Chill 庄骞 (smallchill@163.com)
*/
import com.logpm.basic.entity.BasicPdaEntity;
import com.logpm.basic.entity.BasicTenantCodeEntity;
import org.springblade.core.mp.support.BladePage;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
import static org.springblade.common.constant.LauncherConstant.APPLICATION_BASIC_NAME;
@ -50,4 +52,8 @@ public interface IBasicTenantCodeClient {
@GetMapping(TOP)
BladePage<BasicTenantCodeEntity> tenantCodeTop(@RequestParam("current") Integer current, @RequestParam("size") Integer size);
@GetMapping(TOP+"/list")
List<BasicTenantCodeEntity> list(@ApiIgnore BasicTenantCodeEntity basicTenantCodeEntity) throws IllegalAccessException;
}

4
blade-service/logpm-basic/src/main/java/com/logpm/basic/controller/BasicTenantCodeController.java

@ -80,6 +80,7 @@ public class BasicTenantCodeController extends BladeController {
public R<?> list(@ApiIgnore @RequestParam Map<String, Object> basicTenantCode, Query query) {
IPage<BasicTenantCodeEntity> page = Condition.getPage(query);
IPage<BasicTenantCodeEntity> list = basicTenantCodeService.list(basicTenantCode,page);
// basicTenantCodeService.page(page,Condition.getQueryWrapper(basicTenantCode,BasicTenantCodeEntity.class));
return R.data(list);
}
@ -101,7 +102,8 @@ public class BasicTenantCodeController extends BladeController {
@ApiOperationSupport(order = 4)
@ApiOperation(value = "新增", notes = "传入basicTenantCode")
public R save(@Valid @RequestBody BasicTenantCodeEntity basicTenantCode) {
return R.status(basicTenantCodeService.save(basicTenantCode));
boolean save = basicTenantCodeService.save(basicTenantCode);
return R.status(save);
}
/**

11
blade-service/logpm-basic/src/main/java/com/logpm/basic/feign/BasicBasicTenantCodeClient.java

@ -18,9 +18,7 @@ package com.logpm.basic.feign;
*/
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.basic.entity.BasicPdaEntity;
import com.logpm.basic.entity.BasicTenantCodeEntity;
import com.logpm.basic.service.IBasicPdaService;
import com.logpm.basic.service.IBasicTenantCodeService;
import lombok.AllArgsConstructor;
import org.springblade.core.mp.support.BladePage;
@ -30,6 +28,8 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
/**
* 租户设置编码信息 Feign实现类
*
@ -53,4 +53,11 @@ public class BasicBasicTenantCodeClient implements IBasicTenantCodeClient {
return BladePage.of(page);
}
@Override
@GetMapping(TOP+"/list")
public List<BasicTenantCodeEntity> list(BasicTenantCodeEntity basicTenantCodeEntity) throws IllegalAccessException {
List<BasicTenantCodeEntity> list = basicTenantCodeService.list(Condition.getQueryWrapper(basicTenantCodeEntity));
return list;
}
}

3
blade-service/logpm-basic/src/main/java/com/logpm/basic/mapper/BasicTenantCodeMapper.java

@ -19,6 +19,7 @@ package com.logpm.basic.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.basic.dto.BasicTenantCodeDTO;
import com.logpm.basic.entity.BasicTenantCodeEntity;
import com.logpm.basic.excel.BasicTenantCodeExcel;
import com.logpm.basic.vo.BasicTenantCodeVO;
@ -57,7 +58,7 @@ public interface BasicTenantCodeMapper extends BaseMapper<BasicTenantCodeEntity>
* @param basicTenantCode
* @return
*/
IPage<BasicTenantCodeEntity> selectTenantCodeList(IPage<BasicTenantCodeEntity> page,@Param("po")Map<String, Object> basicTenantCode);
IPage<BasicTenantCodeEntity> selectTenantCodeList(IPage<BasicTenantCodeEntity> page,@Param("po") Map<String, Object> basicTenantCode);
BasicTenantCodeEntity selectTenantCodeDetail(Long id);
}

4
blade-service/logpm-basic/src/main/java/com/logpm/basic/mapper/BasicTenantCodeMapper.xml

@ -39,10 +39,10 @@
logpm_basic_tenant_code
<where>
is_deleted = 0
<if test="po.input!=null and po.input!=''">
<if test="po.codeType!=null and po.codeType!=''">
and code_type = #{po.input}
</if>
<if test="po.type!=null and po.type!=''">
<if test="po.showType!=null and po.showType!=''">
and show_type = #{po.type}
</if>
</where>

2
blade-service/logpm-basic/src/main/java/com/logpm/basic/service/IBasicTenantCodeService.java

@ -19,6 +19,7 @@ package com.logpm.basic.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.logpm.basic.dto.BasicTenantCodeDTO;
import com.logpm.basic.entity.BasicTenantCodeEntity;
import com.logpm.basic.excel.BasicTenantCodeExcel;
import com.logpm.basic.vo.BasicTenantCodeVO;
@ -68,4 +69,5 @@ public interface IBasicTenantCodeService extends BaseService<BasicTenantCodeEnti
* @return
*/
BasicTenantCodeEntity gerOne(Long id);
}

15
blade-service/logpm-basic/src/main/java/com/logpm/basic/service/impl/BasicTenantCodeServiceImpl.java

@ -17,6 +17,7 @@
package com.logpm.basic.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.logpm.basic.dto.BasicTenantCodeDTO;
import com.logpm.basic.entity.BasicTenantCodeEntity;
import com.logpm.basic.excel.BasicTenantCodeExcel;
import com.logpm.basic.mapper.BasicTenantCodeMapper;
@ -25,11 +26,12 @@ import com.logpm.basic.vo.BasicTenantCodeVO;
import lombok.AllArgsConstructor;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.Query;
import org.springblade.system.feign.IDictBizClient;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.util.StringUtils;
import javax.validation.constraints.NotEmpty;
import java.util.List;
import java.util.Map;
@ -45,6 +47,7 @@ public class BasicTenantCodeServiceImpl extends BaseServiceImpl<BasicTenantCodeM
private BasicTenantCodeMapper basicTenantCodeMapper;
@Override
public IPage<BasicTenantCodeEntity> list(Map<String, Object> basicTenantCode, IPage<BasicTenantCodeEntity> page) {
IPage<BasicTenantCodeEntity> basicTenantCodeEntityIPage = basicTenantCodeMapper.selectTenantCodeList(page,basicTenantCode);
@ -75,4 +78,14 @@ public class BasicTenantCodeServiceImpl extends BaseServiceImpl<BasicTenantCodeM
return basicTenantCodeList;
}
@Override
public boolean save(BasicTenantCodeEntity entity) {
String code = entity.getCode();
Integer codeType = entity.getCodeType();
if (StringUtils.isEmpty(code)){
code = "DA--00"+codeType;
entity.setCode(code);
}
return super.save(entity);
}
}

Loading…
Cancel
Save