ÎļþÃû´Ó Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/feign/OmdBtmTypeClient.java ÐÞ¸Ä |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.vci.ubcs.omd.entity.OmdBtmType; |
| | | import com.vci.ubcs.omd.service.IOmdBtmTypeService; |
| | | import com.vci.ubcs.omd.vo.OmdBtmTypeVO; |
| | | import com.vci.ubcs.omd.wrapper.OmdBtmTypeWrapper; |
| | | import com.vci.ubcs.omd.entity.BtmType; |
| | | import com.vci.ubcs.omd.service.IBtmTypeService; |
| | | import com.vci.ubcs.omd.vo.BtmTypeVO; |
| | | import com.vci.ubcs.omd.wrapper.BtmTypeWrapper; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | |
| | | @ApiIgnore |
| | | @RestController |
| | | @AllArgsConstructor |
| | | public class OmdBtmTypeClient implements IOmdBtmTypeClient{ |
| | | public class BtmTypeClient implements IBtmTypeClient { |
| | | |
| | | private final IOmdBtmTypeService btmTypeService; |
| | | private final IBtmTypeService btmTypeService; |
| | | |
| | | |
| | | /** |
| | |
| | | * @return ä¸å¡ç±»å详æ
ä¿¡æ¯ |
| | | */ |
| | | @Override |
| | | public R<OmdBtmTypeVO> getDetail(String oid) { |
| | | public R<BtmTypeVO> getDetail(String oid) { |
| | | return R.data(btmTypeService.getBtmTypeByOid(oid)); |
| | | } |
| | | |
| | |
| | | * @return æ¥è¯¢ç»æ |
| | | */ |
| | | @Override |
| | | public R<IPage<OmdBtmTypeVO>> getRef(Map<String, Object> condition, Query query, String domain) { |
| | | public R<IPage<BtmTypeVO>> getRef(Map<String, Object> condition, Query query, String domain) { |
| | | Func.requireNotNull(domain,"é¢åå¼"); |
| | | IPage<OmdBtmType> page = btmTypeService.page(Condition.getPage(query), Condition.getQueryWrapper(condition, OmdBtmType.class).lambda().eq(OmdBtmType::getDomain, domain).orderByAsc(OmdBtmType::getId)); |
| | | IPage<OmdBtmTypeVO> pageVO = new Page<>(); |
| | | IPage<BtmType> page = btmTypeService.page(Condition.getPage(query), Condition.getQueryWrapper(condition, BtmType.class).lambda().eq(BtmType::getDomain, domain).orderByAsc(BtmType::getId)); |
| | | IPage<BtmTypeVO> pageVO = new Page<>(); |
| | | BeanUtil.copy(page,pageVO); |
| | | pageVO.setRecords(OmdBtmTypeWrapper.build().listEntityVO(page.getRecords())); |
| | | R<IPage<OmdBtmTypeVO>> r = R.data(pageVO); |
| | | pageVO.setRecords(BtmTypeWrapper.build().listEntityVO(page.getRecords())); |
| | | R<IPage<BtmTypeVO>> r = R.data(pageVO); |
| | | r.setSuccess(true); |
| | | return r; |
| | | } |
| | |
| | | * @return ä¸å¡å¯¹è±¡ |
| | | */ |
| | | @Override |
| | | public R<List<OmdBtmTypeVO>> selectByIdCollection(List<String> ids) { |
| | | public R<List<BtmTypeVO>> selectByIdCollection(List<String> ids) { |
| | | Func.requireNotNull(ids,"ä¸å¡ç±»åè±æåç§°"); |
| | | List<OmdBtmTypeVO> voList = OmdBtmTypeWrapper.build().listEntityVO( |
| | | List<BtmTypeVO> voList = BtmTypeWrapper.build().listEntityVO( |
| | | Optional.ofNullable(btmTypeService.list( |
| | | Wrappers.<OmdBtmType>query().lambda().in(OmdBtmType::getId, ids) |
| | | Wrappers.<BtmType>query().lambda().in(BtmType::getId, ids) |
| | | ) |
| | | ).orElseGet(ArrayList::new) |
| | | ); |
| | |
| | | * @return ä¸å¡ç±»åå表ï¼å¦ææä¸åå¨çä¸ä¼è¿åï¼å
¨é¨ä¸åå¨çåè¿å空å表 |
| | | */ |
| | | @Override |
| | | public R<List<OmdBtmTypeVO>> listBtmTypeByOidCollection(Collection<String> pkBtmTypeCollection) { |
| | | public R<List<BtmTypeVO>> listBtmTypeByOidCollection(Collection<String> pkBtmTypeCollection) { |
| | | Func.requireNotNull(pkBtmTypeCollection,"ä¸å¡ç±»å主é®"); |
| | | List<OmdBtmTypeVO> voList = OmdBtmTypeWrapper.build().listEntityVO( |
| | | List<BtmTypeVO> voList = BtmTypeWrapper.build().listEntityVO( |
| | | Optional.ofNullable(btmTypeService.list( |
| | | Wrappers.<OmdBtmType>query().lambda().in(OmdBtmType::getOid, pkBtmTypeCollection) |
| | | Wrappers.<BtmType>query().lambda().in(BtmType::getOid, pkBtmTypeCollection) |
| | | ) |
| | | ).orElseGet(ArrayList::new) |
| | | ); |