完善供应商、客户、会员查询接口,支持模糊查询
This commit is contained in:
@@ -275,7 +275,7 @@ public class DepotHeadService {
|
||||
Long userId = userService.getCurrentUser().getId();
|
||||
//获取权限信息
|
||||
String ubValue = userBusinessService.getUBValueByTypeAndKeyId(type, userId.toString());
|
||||
List<Supplier> supplierList = supplierService.findBySelectCus();
|
||||
List<SupplierSimple> supplierList = supplierService.getAllCustomer();
|
||||
if(BusinessConstants.SUB_TYPE_SALES_ORDER.equals(subType) || BusinessConstants.SUB_TYPE_SALES.equals(subType)
|
||||
||BusinessConstants.SUB_TYPE_SALES_RETURN.equals(subType) ) {
|
||||
//采购订单里面选择销售订单的时候不要过滤
|
||||
@@ -283,7 +283,7 @@ public class DepotHeadService {
|
||||
if (null != supplierList && supplierList.size() > 0) {
|
||||
boolean customerFlag = systemConfigService.getCustomerFlag();
|
||||
List<String> organList = new ArrayList<>();
|
||||
for (Supplier supplier : supplierList) {
|
||||
for (SupplierSimple supplier : supplierList) {
|
||||
boolean flag = ubValue.contains("[" + supplier.getId().toString() + "]");
|
||||
if (!customerFlag || flag) {
|
||||
organList.add(supplier.getId().toString());
|
||||
|
||||
@@ -288,47 +288,68 @@ public class SupplierService {
|
||||
}
|
||||
}
|
||||
|
||||
public List<Supplier> findBySelectCus()throws Exception {
|
||||
SupplierExample example = new SupplierExample();
|
||||
example.createCriteria().andTypeLike("客户").andEnabledEqualTo(true).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
||||
example.setOrderByClause("sort asc, id desc");
|
||||
public List<Supplier> findBySelectCus(String key, Long organId)throws Exception {
|
||||
List<Supplier> list=null;
|
||||
try{
|
||||
list = supplierMapper.selectByExample(example);
|
||||
list = supplierMapperEx.findByTypeAndKey("客户", key);
|
||||
if(organId!=null) {
|
||||
list = addOrganToList(list, organId);
|
||||
}
|
||||
}catch(Exception e){
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public List<Supplier> findBySelectSup()throws Exception {
|
||||
SupplierExample example = new SupplierExample();
|
||||
example.createCriteria().andTypeLike("供应商").andEnabledEqualTo(true)
|
||||
.andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
||||
example.setOrderByClause("sort asc, id desc");
|
||||
public List<Supplier> findBySelectSup(String key, Long organId)throws Exception {
|
||||
List<Supplier> list=null;
|
||||
try{
|
||||
list = supplierMapper.selectByExample(example);
|
||||
list = supplierMapperEx.findByTypeAndKey("供应商", key);
|
||||
if(organId!=null) {
|
||||
list = addOrganToList(list, organId);
|
||||
}
|
||||
}catch(Exception e){
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public List<Supplier> findBySelectRetail()throws Exception {
|
||||
SupplierExample example = new SupplierExample();
|
||||
example.createCriteria().andTypeLike("会员").andEnabledEqualTo(true)
|
||||
.andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
||||
example.setOrderByClause("sort asc, id desc");
|
||||
public List<Supplier> findBySelectRetail(String key, Long organId)throws Exception {
|
||||
List<Supplier> list=null;
|
||||
try{
|
||||
list = supplierMapper.selectByExample(example);
|
||||
list = supplierMapperEx.findByTypeAndKey("会员", key);
|
||||
if(organId!=null) {
|
||||
list = addOrganToList(list, organId);
|
||||
}
|
||||
}catch(Exception e){
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 给列表追加供应商信息
|
||||
* @param list
|
||||
* @param organId
|
||||
* @return
|
||||
*/
|
||||
public List<Supplier> addOrganToList(List<Supplier> list, Long organId) {
|
||||
boolean isExist = false;
|
||||
for(Supplier supplier: list) {
|
||||
if(supplier.getId().equals(organId)) {
|
||||
isExist = true;
|
||||
}
|
||||
}
|
||||
if(!isExist) {
|
||||
//列表里面不存在则追加
|
||||
Supplier info = supplierMapperEx.getInfoById(organId);
|
||||
if(info!=null) {
|
||||
list.add(info);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public List<Supplier> findById(Long supplierId)throws Exception {
|
||||
SupplierExample example = new SupplierExample();
|
||||
example.createCriteria().andIdEqualTo(supplierId)
|
||||
|
||||
Reference in New Issue
Block a user