正选问题
This commit is contained in:
parent
d8b6c15034
commit
d44591330a
|
|
@ -70,6 +70,11 @@ public class CustomerSelectionController extends BaseController
|
|||
@ResponseBody
|
||||
public AjaxResult listNoPage(@RequestBody CustomerSelection customerSelection)
|
||||
{
|
||||
// 判断是否有上级,有上级则取上级的 -- 没有则就是自身
|
||||
Customer customer = customerService.selectByCustomerId(customerSelection.getCustomerId());
|
||||
if(customer.getPlaceStatus() != 2 && customer.getCustomerPlace() != null){
|
||||
customerSelection.setCustomerId(customer.getCustomerPlace());
|
||||
}
|
||||
List<CustomerSelection> list = customerSelectionService.selectCustomerSelectionList(customerSelection);
|
||||
return AjaxResult.success(list.stream().map(CustomerSelection::getDeptCategoryId).collect(Collectors.toList()));
|
||||
}
|
||||
|
|
@ -146,14 +151,16 @@ public class CustomerSelectionController extends BaseController
|
|||
hisParam.setCustomerId(customerSelection.getCustomerId());
|
||||
hisParam.setSelectionType(customerSelection.getSelectionType());
|
||||
List<CustomerSelection> hisList = customerSelectionService.selectCustomerSelectionList(hisParam);
|
||||
List<Long> hisIds = hisList.stream().map(CustomerSelection::getCustomerId).collect(Collectors.toList());
|
||||
StringBuilder ids = new StringBuilder();
|
||||
hisIds.forEach(model->{
|
||||
ids.append(model).append(",");
|
||||
});
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
String idString = ids.substring(0, ids.length()-1);
|
||||
customerSelectionService.deleteCustomerSelectionByIds(idString);
|
||||
if(!CollectionUtils.isEmpty(hisList)){
|
||||
List<String> hisIds = hisList.stream().map(CustomerSelection::getId).collect(Collectors.toList());
|
||||
StringBuilder ids = new StringBuilder();
|
||||
hisIds.forEach(model->{
|
||||
ids.append(model.trim()).append(",");
|
||||
});
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
String idString = ids.substring(0, ids.length()-1);
|
||||
customerSelectionService.deleteCustomerSelectionByIds(idString);
|
||||
}
|
||||
}
|
||||
// 判断是否有历史数据 - 有则删除
|
||||
customerSelection.getDeptCategoryIds().forEach(selection->{
|
||||
|
|
|
|||
Loading…
Reference in New Issue