package com.ld.igds.m.view;
|
|
import java.text.Collator;
|
import java.util.*;
|
|
import com.ld.igds.m.service.HInoutCustomerService;
|
import com.ld.igds.models.InoutCustomer;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Component;
|
import com.bstek.dorado.annotation.DataProvider;
|
import com.bstek.dorado.annotation.Expose;
|
|
/**
|
* 出入库-往来单位管理
|
*
|
* @author: andy.jia
|
* @description:
|
* @version:
|
* @data:2020年3月12日
|
*/
|
@Component("inoutCustomerPR")
|
public class InoutCustomerPR {
|
|
@Autowired
|
private HInoutCustomerService customerService;
|
|
/**
|
* inoutCustomerPR#queryList 获取所有信息
|
*
|
* @param parameter
|
* @return
|
*/
|
@DataProvider
|
public List<InoutCustomer> queryList(Map<String, Object> parameter) {
|
|
List<InoutCustomer> list = customerService.queryList(parameter);
|
Collections.sort(list, new Comparator<InoutCustomer>() {
|
@Override
|
public int compare(InoutCustomer a1, InoutCustomer a2) {
|
return Collator.getInstance(Locale.CHINESE).compare(a1.getName(), a2.getName());
|
}
|
});
|
return list;
|
|
}
|
|
/**
|
* inoutCustomerPR#queryListByKey
|
* 根据关键字查询,可能是ID可能是名称
|
*
|
* @param
|
* @return
|
*/
|
@DataProvider
|
public List<InoutCustomer> queryListByKey(Map<String, Object> param) {
|
List<InoutCustomer> list = customerService.queryList(param);
|
Collections.sort(list, new Comparator<InoutCustomer>() {
|
@Override
|
public int compare(InoutCustomer a1, InoutCustomer a2) {
|
return Collator.getInstance(Locale.CHINESE).compare(a1.getName(), a2.getName());
|
}
|
});
|
return list;
|
}
|
|
/**
|
* inoutCustomerPR#saveData
|
*/
|
@Expose
|
public String saveData(InoutCustomer data) {
|
return customerService.saveOrUpdateData(data);
|
}
|
|
/**
|
* inoutCustomerPR#delData
|
*/
|
@Expose
|
public String delData(InoutCustomer data) {
|
return customerService.delData(data);
|
}
|
|
|
/**
|
* inoutCustomerPR#queryListByParam
|
* 根据关键字查询,ID
|
*
|
* @param
|
* @return
|
*/
|
@Expose
|
public InoutCustomer queryListByParam(String id) {
|
Map<String, Object> param = new HashMap<>();
|
param.put("id", id);
|
List<InoutCustomer> list = customerService.queryList(param);
|
|
return list.get(0);
|
}
|
}
|