添加了总部查看要审核的商家的信息的功能模块
This commit is contained in:
parent
70e4535198
commit
e7cd3b4159
@ -146,4 +146,17 @@ public class MerchantSettlementController {
|
|||||||
String phone = (String) map.get("phone");
|
String phone = (String) map.get("phone");
|
||||||
return merchantSettlementService.updateNotPassBusiness(id,phone);
|
return merchantSettlementService.updateNotPassBusiness(id,phone);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 总部查看要审核的商家的信息
|
||||||
|
* @param map
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/selectDefaultBusiness")
|
||||||
|
public String selectDefaultBusiness(@RequestBody Map map){
|
||||||
|
String businessCity = (String) map.get("businessCity");
|
||||||
|
String businessCountry = (String) map.get("businessCountry");
|
||||||
|
String businessName = (String) map.get("businessName");
|
||||||
|
return merchantSettlementService.selectDefaultBusiness(businessCity,businessCountry,businessName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -78,4 +78,13 @@ public interface MerchantSettlementService {
|
|||||||
* @throws ClientException
|
* @throws ClientException
|
||||||
*/
|
*/
|
||||||
String updateNotPassBusiness(Integer id,String phone) throws ClientException;
|
String updateNotPassBusiness(Integer id,String phone) throws ClientException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 总部查看要审核的商家的信息
|
||||||
|
* @param businessCity
|
||||||
|
* @param businessCountry
|
||||||
|
* @param businessName
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
String selectDefaultBusiness(String businessCity, String businessCountry, String businessName);
|
||||||
}
|
}
|
||||||
|
@ -226,4 +226,21 @@ public class MerchantSettlementServiceImpl implements MerchantSettlementService
|
|||||||
businessDao.updateNotPassBusiness(id);
|
businessDao.updateNotPassBusiness(id);
|
||||||
return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"操作成功!",locale);
|
return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"操作成功!",locale);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 总部查看要审核的商家的信息
|
||||||
|
* @param businessCity
|
||||||
|
* @param businessCountry
|
||||||
|
* @param businessName
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String selectDefaultBusiness(String businessCity, String businessCountry, String businessName) {
|
||||||
|
Locale locale = LocaleContextHolder.getLocale();
|
||||||
|
List<BusinessEntity> businessEntities = query.selectDefaultBusiness(businessCity, businessCountry, businessName);
|
||||||
|
if(businessEntities == null || businessEntities.size() == 0){
|
||||||
|
return outputEncapsulationObject(PromptMessageEnum.DATA_NONE,"暂时还没有要审核的商家的信息!",locale);
|
||||||
|
}
|
||||||
|
return outputEncapsulationObject(PromptMessageEnum.SUCCESS,businessEntities,locale);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -117,5 +117,34 @@ public class Query {
|
|||||||
return businessDao.findAll(specification);
|
return businessDao.findAll(specification);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 总部查看要审核的商家的信息
|
||||||
|
* @param businessCity
|
||||||
|
* @param businessCountry
|
||||||
|
* @param businessName
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<BusinessEntity> selectDefaultBusiness(String businessCity, String businessCountry, String businessName) {
|
||||||
|
Specification<BusinessEntity> specification = new Specification<BusinessEntity>() {
|
||||||
|
@Override
|
||||||
|
public Predicate toPredicate(Root<BusinessEntity> root, CriteriaQuery<?> criteriaQuery, CriteriaBuilder criteriaBuilder) {
|
||||||
|
List<Predicate> list = new ArrayList<>();
|
||||||
|
if(businessCity != null && !"".equals(businessCity)){
|
||||||
|
list.add(criteriaBuilder.equal(root.get("businessCity").as(Integer.class), businessCity));
|
||||||
|
}
|
||||||
|
if(businessCountry != null && !"".equals(businessCountry)){
|
||||||
|
list.add(criteriaBuilder.equal(root.get("businessCountry").as(String.class), businessCountry));
|
||||||
|
}
|
||||||
|
if(businessName != null && !"".equals(businessName)){
|
||||||
|
list.add(criteriaBuilder.like(root.get("businessName").as(String.class), "%" + businessName + "%"));
|
||||||
|
}
|
||||||
|
list.add(criteriaBuilder.equal(root.get("businessType").as(String.class), "0"));
|
||||||
|
Predicate[] predicates = new Predicate[list.size()];
|
||||||
|
return criteriaBuilder.and(list.toArray(predicates));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return businessDao.findAll(specification);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user