|
|
@@ -71,9 +71,19 @@ public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendo
|
|
|
* 返回列表数据
|
|
|
* @return
|
|
|
*/
|
|
|
- public List<VendorList> getListDataByCondition(ListReqDTO listReqDTO){
|
|
|
+ public PageInfo<VendorList> getListDataByCondition(PageRequest page, ListReqDTO listReqDTO){
|
|
|
+ //设置分页
|
|
|
+ if (null == page || page.getSize() == 0 || page.getNumber() == 0) {
|
|
|
+ page = new PageRequest();
|
|
|
+ page.setNumber(1);
|
|
|
+ page.setSize(10);
|
|
|
+ }
|
|
|
+ PageHelper.startPage(page.getNumber(), page.getSize());
|
|
|
+ //取分页信息
|
|
|
String condition = listReqDTO.getFinalCondition();
|
|
|
- return getMapper().getListDataByCondition(condition, BaseContextHolder.getCompanyId());
|
|
|
+ List<VendorList> list = getMapper().getListDataByCondition(condition, BaseContextHolder.getCompanyId());
|
|
|
+ PageInfo<VendorList> pageInfo = new PageInfo<VendorList>(list);
|
|
|
+ return pageInfo;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -82,6 +92,9 @@ public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendo
|
|
|
*/
|
|
|
@Override
|
|
|
public DocBaseDTO saveFormData(VendorListDTO vendorListDTO) {
|
|
|
+ if (null == vendorListDTO || null == vendorListDTO.getMain()){
|
|
|
+ throw new BizException(500, "数据为空,请填写后再保存");
|
|
|
+ }
|
|
|
Vendor main = vendorListDTO.getMain();
|
|
|
main.setCompanyId(BaseContextHolder.getCompanyId());
|
|
|
List<Vendorcontact> items = vendorListDTO.getItems();
|