|
@@ -20,10 +20,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
|
|
|
|
@Service
|
|
@@ -80,7 +77,6 @@ public class CustomerServiceImpl implements CustomerService {
|
|
|
@Autowired
|
|
|
private RelationOrderService relationOrderService;
|
|
|
|
|
|
-
|
|
|
@Override
|
|
|
public CustomerInfo getCustomerInfo(Integer customerId) {
|
|
|
return customerInfoMapper.getCustomerInfo(customerId);
|
|
@@ -1295,92 +1291,37 @@ public class CustomerServiceImpl implements CustomerService {
|
|
|
PageHelper.startPage(pageNO, pageSize, isTotalNum);
|
|
|
//查询客诉列表
|
|
|
List<CustomerInfo> customerList = customerInfoMapper.listCustomer(customerInfo);
|
|
|
- //查询售后维修集合
|
|
|
- Repair repairInfo = new Repair();
|
|
|
- repairInfo.setRepairState(1);
|
|
|
- List<Repair> repairList = repairMapper.listRepair(repairInfo);
|
|
|
- //查询售后退货集合
|
|
|
- BackGoods backGoodsInfo = new BackGoods();
|
|
|
- backGoodsInfo.setBackGoodsState(1);
|
|
|
- List<BackGoods> backGoodsList = backGoodsMapper.listBackGoods(backGoodsInfo);
|
|
|
- //查询售后无理由退货集合
|
|
|
- NoreasonBack noreasonBackInfo = new NoreasonBack();
|
|
|
- noreasonBackInfo.setNoreasonBackState(1);
|
|
|
- List<NoreasonBack> noreasonBackList = noreasonBackMapper.listNoreasonBack(noreasonBackInfo);
|
|
|
- //查询售后补发集合
|
|
|
- Reissue reissueInfo = new Reissue();
|
|
|
- reissueInfo.setReissueState(1);
|
|
|
- List<Reissue> reissueList = reissueMapper.listReissue(reissueInfo);
|
|
|
- //查询售后换新集合
|
|
|
- Renewed renewedInfo = new Renewed();
|
|
|
- renewedInfo.setRenewedState(1);
|
|
|
- List<Renewed> renewedList = renewedMapper.listRenewed(renewedInfo);
|
|
|
|
|
|
if (customerList != null && customerList.size() > 0) {
|
|
|
for (CustomerInfo customer : customerList) {
|
|
|
- switch (customer.getCustomerIsSolve().intValue()) {
|
|
|
- case 3: //换新
|
|
|
- for (Renewed renewed : renewedList) {
|
|
|
- if (renewed.getCustomerId().intValue() == customer.getCustomerId()) {
|
|
|
- customer.setBackStatus(renewed.getRenewedBackStatus());
|
|
|
- customer.setSendStatus(renewed.getRenewedSendStatus());
|
|
|
- customer.setSalesTime(renewed.getSalesPayTime());
|
|
|
- customer.setSendLogisticsNo(renewed.getRenewedSendLogisticsNo());
|
|
|
- customer.setSendLogisticsCompany(renewed.getRenewedSendLogisticsCompany());
|
|
|
- customer.setBackLogisticsNo(renewed.getRenewedBackLogisticsNo());
|
|
|
- customer.setBackLogisticsCompany(renewed.getRenewedBackLogisticsCompany());
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- break;
|
|
|
- case 4: //维修
|
|
|
- for (Repair repair : repairList) {
|
|
|
- if (repair.getCustomerId().intValue() == customer.getCustomerId()) {
|
|
|
- customer.setBackStatus(repair.getRepairBackStatus());
|
|
|
- customer.setSendStatus(repair.getRepairSendStatus());
|
|
|
- customer.setSalesTime(repair.getSalesPayTime());
|
|
|
- customer.setSendLogisticsNo(repair.getRepairSendLogisticsNo());
|
|
|
- customer.setSendLogisticsCompany(repair.getRepairSendLogisticsCompany());
|
|
|
- customer.setBackLogisticsNo(repair.getRepairBackLogisticsNo());
|
|
|
- customer.setBackLogisticsCompany(repair.getRepairBackLogisticsCompany());
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- break;
|
|
|
- case 5: //补发
|
|
|
- for (Reissue reissue : reissueList) {
|
|
|
- if (reissue.getCustomerId().intValue() == customer.getCustomerId()) {
|
|
|
- customer.setSendStatus(reissue.getReissueSendStatus());
|
|
|
- customer.setSalesTime(reissue.getSalesPayTime());
|
|
|
- customer.setSendLogisticsNo(reissue.getReissueSendLogisticsNo());
|
|
|
- customer.setSendLogisticsCompany(reissue.getReissueSendLogisticsCompany());
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- break;
|
|
|
- case 6: //退货
|
|
|
- for (BackGoods backGoods : backGoodsList) {
|
|
|
- if (backGoods.getCustomerId().intValue() == customer.getCustomerId()) {
|
|
|
- customer.setBackStatus(backGoods.getBackGoodsBackStatus());
|
|
|
- customer.setSalesTime(backGoods.getSalesPayTime());
|
|
|
- customer.setBackLogisticsNo(backGoods.getBackGoodsBackLogisticsNo());
|
|
|
- customer.setBackLogisticsCompany(backGoods.getBackGoodsBackLogisticsCompany());
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- break;
|
|
|
- case 7: //无理由退货
|
|
|
- for (NoreasonBack noreasonBack : noreasonBackList) {
|
|
|
- if (noreasonBack.getCustomerId().intValue() == customer.getCustomerId()) {
|
|
|
- customer.setBackStatus(noreasonBack.getNoreasonBackBackStatus());
|
|
|
- customer.setSalesTime(noreasonBack.getSalesPayTime());
|
|
|
- customer.setBackLogisticsNo(noreasonBack.getNoreasonBackBackLogisticsNo());
|
|
|
- customer.setBackLogisticsCompany(noreasonBack.getNoreasonBackBackLogisticsCompany());
|
|
|
- break;
|
|
|
+
|
|
|
+ CustomerCommon customerCommon = new CustomerCommon();
|
|
|
+ customerCommon.setCustomerId(customer.getCustomerId());
|
|
|
+ List<CustomerCommon> customerCommonList = customerCommonService.listCustomerCommon(customerCommon);
|
|
|
+ if(customerCommonList == null || customerCommonList.size() < 1){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ customerCommon = customerCommonList.get(0);
|
|
|
+ customer.setBackStatus(customerCommon.getRelationBackStatus());
|
|
|
+ customer.setSendStatus(customerCommon.getRelationSendStatus());
|
|
|
+ customer.setSendLogisticsNo(customerCommon.getRelationSendLogisticsNo());
|
|
|
+ customer.setSendLogisticsCompany(customerCommon.getRelationSendLogisticsCompany());
|
|
|
+ customer.setBackLogisticsNo(customerCommon.getRelationBackLogisticsNo());
|
|
|
+ customer.setBackLogisticsCompany(customerCommon.getRelationBackLogisticsCompany());
|
|
|
+ Date date = null;
|
|
|
+ List<SalesOrder> salesOrderList = customerCommon.getSalesOrderList();
|
|
|
+ if(salesOrderList != null && salesOrderList.size() > 0){
|
|
|
+ for (int k = 0;k<salesOrderList.size();k++){
|
|
|
+ SalesOrder so = salesOrderList.get(k);
|
|
|
+ List<SalesOrderItem> salesOrderItemList = so.getSalesOrderItemList();
|
|
|
+ for (SalesOrderItem soi:salesOrderItemList) {
|
|
|
+ if(1 == soi.getItemIsSource()){
|
|
|
+ date = so.getSalesPayTime();
|
|
|
}
|
|
|
}
|
|
|
- break;
|
|
|
+ }
|
|
|
}
|
|
|
+ customer.setSalesTime(date);
|
|
|
}
|
|
|
}
|
|
|
return PageUtil.getPage(customerList);
|
|
@@ -1476,22 +1417,24 @@ public class CustomerServiceImpl implements CustomerService {
|
|
|
relationOrder.setRelationType(customerCommon.getCustomerIsSolve());
|
|
|
relationOrder.setRelationId(customerCommon.getRelationId());
|
|
|
List<RelationOrder> relationOrderList = relationOrderService.getRelationOrderList(relationOrder);
|
|
|
- String[] salesIds = new String[relationOrderList.size()];
|
|
|
- for (int k=0; k<relationOrderList.size();k++){
|
|
|
- salesIds[k] = String.valueOf(relationOrderList.get(k).getSalesId());
|
|
|
- }
|
|
|
- SalesOrder so = new SalesOrder();
|
|
|
- so.setSalesIds(salesIds);
|
|
|
- List<SalesOrder> orderList = salesOrderMapper.listSalesOrder(so);
|
|
|
- if (orderList != null && orderList.size() > 0) {
|
|
|
- SalesOrder order = orderList.get(0);
|
|
|
- SalesOrderItem salesOrderItem = new SalesOrderItem();
|
|
|
- salesOrderItem.setItemOrderId(order.getSalesId());
|
|
|
- order.setSalesOrderItemList(salesOrderMapper.listSalesOrderItem(salesOrderItem));
|
|
|
- } else {
|
|
|
- map.put("orderList",null);
|
|
|
- }
|
|
|
- map.put("orderList",orderList);
|
|
|
+ if(relationOrderList != null && relationOrderList.size() > 0){
|
|
|
+ String[] salesIds = new String[relationOrderList.size()];
|
|
|
+ for (int k=0; k<relationOrderList.size();k++){
|
|
|
+ salesIds[k] = String.valueOf(relationOrderList.get(k).getSalesId());
|
|
|
+ }
|
|
|
+ SalesOrder so = new SalesOrder();
|
|
|
+ so.setSalesIds(salesIds);
|
|
|
+ List<SalesOrder> orderList = salesOrderMapper.listSalesOrder(so);
|
|
|
+ if (orderList != null && orderList.size() > 0) {
|
|
|
+ SalesOrder order = orderList.get(0);
|
|
|
+ SalesOrderItem salesOrderItem = new SalesOrderItem();
|
|
|
+ salesOrderItem.setItemOrderId(order.getSalesId());
|
|
|
+ order.setSalesOrderItemList(salesOrderMapper.listSalesOrderItem(salesOrderItem));
|
|
|
+ } else {
|
|
|
+ map.put("orderList",null);
|
|
|
+ }
|
|
|
+ map.put("orderList",orderList);
|
|
|
+ }
|
|
|
map.put("customerCommon",customerCommon);
|
|
|
return map;
|
|
|
}
|