|
@@ -2,10 +2,7 @@ package com.iamberry.rst.controllers.customer;
|
|
|
|
|
|
import com.iamberry.rst.controllers.cm.AdminCustomerController;
|
|
|
import com.iamberry.rst.core.cm.CustomerInfo;
|
|
|
-import com.iamberry.rst.core.customer.BillingInfo;
|
|
|
-import com.iamberry.rst.core.customer.CustomerBasicInfo;
|
|
|
-import com.iamberry.rst.core.customer.DockedContactInfo;
|
|
|
-import com.iamberry.rst.core.customer.TicketOpeningInfo;
|
|
|
+import com.iamberry.rst.core.customer.*;
|
|
|
import com.iamberry.rst.core.page.PageRequest;
|
|
|
import com.iamberry.rst.core.page.PagedResult;
|
|
|
import com.iamberry.rst.core.sys.Admin;
|
|
@@ -26,6 +23,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
@@ -113,6 +111,11 @@ public class CustomerBasicController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 查询客户详情
|
|
|
+ * @param request
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@ResponseBody
|
|
|
@RequiresPermissions("customerBasic:select:customerBasic")
|
|
|
@RequestMapping("/customer_Basic_Detail")
|
|
@@ -138,11 +141,51 @@ public class CustomerBasicController {
|
|
|
TicketOpeningInfo ticketOpeningInfo = new TicketOpeningInfo();
|
|
|
ticketOpeningInfo.setCustomerId(Integer.valueOf(customerId));
|
|
|
ticketOpeningInfo = customerBasicService.getOpeningInfo(ticketOpeningInfo);
|
|
|
+ /*渠道销售信息*/
|
|
|
+ ChannelSaleInfo channelSaleInfo = new ChannelSaleInfo();
|
|
|
+ channelSaleInfo.setCustomerId(Integer.valueOf(customerId));
|
|
|
+ List<ChannelSaleInfo> listChannelSaleInfo = customerBasicService.listChannelSaleInfo(channelSaleInfo);
|
|
|
+ //渠道销售信息封装
|
|
|
+ List<ChannelDivisionInfo> listChannelDivisionInfo = new ArrayList<ChannelDivisionInfo>();
|
|
|
+ for (int i=0;i<listChannelSaleInfo.size();i++){
|
|
|
+ boolean isContinue = true;
|
|
|
+ if(listChannelDivisionInfo.size() > 0){
|
|
|
+ for(ChannelDivisionInfo channelDivisionInfo : listChannelDivisionInfo){
|
|
|
+ List<ChannelSaleInfo> listChannel = channelDivisionInfo.getListChannelSaleInfo();
|
|
|
+ for (ChannelSaleInfo Info : listChannel){
|
|
|
+ if(Info.getChannelDivisionId().intValue() == listChannelSaleInfo.get(i).getChannelDivisionId().intValue()
|
|
|
+ && Info.getChannelName().equals(listChannelSaleInfo.get(i).getChannelName())){
|
|
|
+ isContinue = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(!isContinue){
|
|
|
+ continue;//数据已保存不需要再循环
|
|
|
+ }
|
|
|
+ ChannelDivisionInfo channelDivisionInfo = new ChannelDivisionInfo();
|
|
|
+ channelDivisionInfo.setChannelCategory(listChannelSaleInfo.get(i).getChannelCategory());
|
|
|
+ channelDivisionInfo.setChannelType(listChannelSaleInfo.get(i).getChannelType());
|
|
|
+ channelDivisionInfo.setChannelName(listChannelSaleInfo.get(i).getChannelName());
|
|
|
+ List<ChannelSaleInfo> listChannelSale = new ArrayList<ChannelSaleInfo>();
|
|
|
+ for (int j=0;j<listChannelSaleInfo.size();j++){
|
|
|
+ if(listChannelSaleInfo.get(i).getChannelDivisionId().intValue() == listChannelSaleInfo.get(j).getChannelDivisionId().intValue()
|
|
|
+ && listChannelSaleInfo.get(i).getChannelName().equals(listChannelSaleInfo.get(j).getChannelName())){
|
|
|
+ listChannelSale.add(listChannelSaleInfo.get(j));
|
|
|
+ }
|
|
|
+ if(j == listChannelSaleInfo.size()-1){
|
|
|
+ channelDivisionInfo.setListChannelSaleInfo(listChannelSale);
|
|
|
+ }
|
|
|
|
|
|
+ }
|
|
|
+ listChannelDivisionInfo.add(channelDivisionInfo);
|
|
|
+ }
|
|
|
mv.addObject("customerBasicInfo",customerBasicInfo);
|
|
|
mv.addObject("listDockedContactInfo",listDockedContactInfo);
|
|
|
mv.addObject("billingInfo",billingInfo);
|
|
|
mv.addObject("ticketOpeningInfo",ticketOpeningInfo);
|
|
|
+ mv.addObject("listChannelDivisionInfo",listChannelDivisionInfo);
|
|
|
return mv;
|
|
|
}
|
|
|
}
|