|
|
@@ -9,12 +9,15 @@ import com.fs.common.enums.BusinessType;
|
|
|
import com.fs.common.utils.StringUtils;
|
|
|
import com.fs.common.utils.poi.ExcelUtil;
|
|
|
import com.fs.his.vo.FsStoreAfterSalesExcelVO;
|
|
|
-import com.fs.his.vo.FsStoreAfterSalesListVO;
|
|
|
import com.fs.hisStore.domain.FsStoreAfterSalesItemScrm;
|
|
|
import com.fs.hisStore.domain.FsStoreAfterSalesScrm;
|
|
|
import com.fs.his.param.FsStoreAfterSalesParam;
|
|
|
+import com.fs.hisStore.domain.FsStoreOrderItemScrm;
|
|
|
+import com.fs.hisStore.domain.FsStoreOrderScrm;
|
|
|
+import com.fs.hisStore.mapper.FsStoreOrderItemScrmMapper;
|
|
|
import com.fs.hisStore.service.IFsStoreAfterSalesItemScrmService;
|
|
|
import com.fs.hisStore.service.IFsStoreAfterSalesScrmService;
|
|
|
+import com.fs.hisStore.service.IFsStoreOrderScrmService;
|
|
|
import com.fs.hisStore.utils.UserUtil;
|
|
|
import com.fs.hisStore.vo.FsStoreAfterSalesVO;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -22,6 +25,8 @@ import org.springframework.context.annotation.Lazy;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* 售后记录Controller
|
|
|
@@ -40,6 +45,12 @@ public class FsStoreAfterSalesScrmController extends BaseController
|
|
|
@Autowired
|
|
|
private IFsStoreAfterSalesItemScrmService afterSalesItemService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private FsStoreOrderItemScrmMapper fsStoreOrderItemMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IFsStoreOrderScrmService fsStoreOrderService;
|
|
|
+
|
|
|
/**
|
|
|
* 查询售后记录列表
|
|
|
*/
|
|
|
@@ -197,7 +208,31 @@ public class FsStoreAfterSalesScrmController extends BaseController
|
|
|
}
|
|
|
FsStoreAfterSalesItemScrm salesItemScrm=new FsStoreAfterSalesItemScrm();
|
|
|
salesItemScrm.setStoreAfterSalesId(id);
|
|
|
- return R.ok().put("data",afterSalesItemService.selectFsStoreAfterSalesItemList(salesItemScrm));
|
|
|
+ //查询售后信息
|
|
|
+ FsStoreAfterSalesScrm afterSales=fsStoreAfterSalesService.selectFsStoreAfterSalesById(id);
|
|
|
+ if(afterSales == null){
|
|
|
+ return R.error("操作失败,售后信息不存在!");
|
|
|
+ }
|
|
|
+ FsStoreOrderScrm order=fsStoreOrderService.selectFsStoreOrderByOrderCode(afterSales.getOrderCode());
|
|
|
+ List<FsStoreAfterSalesItemScrm> items = afterSalesItemService.selectFsStoreAfterSalesItemList(salesItemScrm);
|
|
|
+ if(!items.isEmpty()){
|
|
|
+ FsStoreOrderItemScrm fsStoreOrderItem=new FsStoreOrderItemScrm();
|
|
|
+ fsStoreOrderItem.setOrderId(order.getId());
|
|
|
+ List<FsStoreOrderItemScrm> fsStoreOrderItemScrmList = fsStoreOrderItemMapper.selectFsStoreOrderItemList(fsStoreOrderItem);
|
|
|
+ Map<Long,FsStoreOrderItemScrm> itemMap = fsStoreOrderItemScrmList.stream().collect(Collectors.toMap(i->i.getProductId(), item->item));
|
|
|
+ for (FsStoreAfterSalesItemScrm item : items){
|
|
|
+ if(itemMap.containsKey(item.getProductId())){
|
|
|
+ FsStoreOrderItemScrm itemScrm=itemMap.get(item.getProductId());
|
|
|
+ if(itemScrm.getVerifyCode() != null){
|
|
|
+ item.setVerifyCode(itemScrm.getVerifyCode());
|
|
|
+ }
|
|
|
+ if(itemScrm.getBatchNumber() != null){
|
|
|
+ item.setBatchNumber(itemScrm.getBatchNumber());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return R.ok().put("data",items);
|
|
|
}
|
|
|
|
|
|
|