refactor(vo): 重构VO对象结构,统一字段命名和接口实现
重构所有VO对象,统一字段命名规范,移除冗余字段,优化接口实现 新增Voable接口用于VO对象转换 调整BaseViewModel和ProjectBasedViewModel接口定义 更新相关服务和控制器以适应VO对象变更
This commit is contained in:
@@ -1,21 +1,21 @@
|
||||
package com.ecep.contract.service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.model.ContractItem;
|
||||
import com.ecep.contract.model.Inventory;
|
||||
import com.ecep.contract.util.ParamUtils;
|
||||
import com.ecep.contract.vm.ContractItemViewModel;
|
||||
import com.ecep.contract.vo.ContractItemVo;
|
||||
import com.ecep.contract.vo.InventoryVo;
|
||||
|
||||
@Service
|
||||
public class ContractItemService extends QueryService<ContractItem, ContractItemViewModel> {
|
||||
public class ContractItemService extends QueryService<ContractItemVo, ContractItemViewModel> {
|
||||
|
||||
public List<ContractItem> findAllByInventory(Inventory parent) {
|
||||
HashMap<String, Object> params = new HashMap<>();
|
||||
params.put("inventory", parent.getId());
|
||||
return findAll(params, null).getContent();
|
||||
public List<ContractItemVo> findAllByInventory(InventoryVo parent) {
|
||||
return findAll(ParamUtils.builder().equals("inventory", parent.getId()).build(), Pageable.unpaged())
|
||||
.getContent();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user