|
@@ -16,6 +16,7 @@ import com.fs.framework.web.service.TokenService;
|
|
|
import com.fs.his.domain.FsUser;
|
|
import com.fs.his.domain.FsUser;
|
|
|
import com.fs.his.service.IFsUserService;
|
|
import com.fs.his.service.IFsUserService;
|
|
|
import com.fs.hisStore.domain.*;
|
|
import com.fs.hisStore.domain.*;
|
|
|
|
|
+import com.fs.hisStore.mapper.FsStoreOrderItemScrmMapper;
|
|
|
import com.fs.hisStore.mapper.FsStoreVerifyCodeScrmMapper;
|
|
import com.fs.hisStore.mapper.FsStoreVerifyCodeScrmMapper;
|
|
|
import com.fs.hisStore.param.FsStoreAfterSalesAudit1Param;
|
|
import com.fs.hisStore.param.FsStoreAfterSalesAudit1Param;
|
|
|
import com.fs.hisStore.param.FsStoreAfterSalesAudit2Param;
|
|
import com.fs.hisStore.param.FsStoreAfterSalesAudit2Param;
|
|
@@ -31,6 +32,7 @@ import java.text.ParseException;
|
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 售后记录Controller
|
|
* 售后记录Controller
|
|
@@ -62,6 +64,9 @@ public class FsStoreAfterSalesScrmController extends BaseController
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private FsStoreVerifyCodeScrmMapper fsStoreVerifyCodeService;
|
|
private FsStoreVerifyCodeScrmMapper fsStoreVerifyCodeService;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private FsStoreOrderItemScrmMapper fsStoreOrderItemMapper;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 查询售后记录列表
|
|
* 查询售后记录列表
|
|
|
*/
|
|
*/
|
|
@@ -124,27 +129,44 @@ public class FsStoreAfterSalesScrmController extends BaseController
|
|
|
}
|
|
}
|
|
|
afterSales.setVerifyCode(order.getVerifyCode() != null?order.getVerifyCode():null);
|
|
afterSales.setVerifyCode(order.getVerifyCode() != null?order.getVerifyCode():null);
|
|
|
afterSales.setBatchNumber(order.getBatchNumber() != null?order.getBatchNumber():null);
|
|
afterSales.setBatchNumber(order.getBatchNumber() != null?order.getBatchNumber():null);
|
|
|
- //获取溯源码相关数据
|
|
|
|
|
- List<FsStoreVerifyCodeScrm> verifyCodes = fsStoreVerifyCodeService.selectList(new LambdaQueryWrapper<FsStoreVerifyCodeScrm>().select(FsStoreVerifyCodeScrm::getVerifyCode,FsStoreVerifyCodeScrm::getProductId).eq(FsStoreVerifyCodeScrm::getOrderId, order.getId()));
|
|
|
|
|
- if(!verifyCodes.isEmpty()){
|
|
|
|
|
- Map<Long, String> verifyCodMap=new HashMap<>();
|
|
|
|
|
- for (FsStoreVerifyCodeScrm v : verifyCodes){
|
|
|
|
|
- if(verifyCodMap.containsKey(v.getProductId())){
|
|
|
|
|
- verifyCodMap.put(v.getProductId(),verifyCodMap.get(v.getProductId())+","+v.getVerifyCode());
|
|
|
|
|
- }else {
|
|
|
|
|
- verifyCodMap.put(v.getProductId(),v.getVerifyCode());
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
|
|
+ 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){
|
|
for (FsStoreAfterSalesItemScrm item : items){
|
|
|
- if(verifyCodMap.containsKey(item.getProductId())){
|
|
|
|
|
- JSONObject jsonObject = JSONObject.parseObject(item.getJsonInfo());
|
|
|
|
|
- jsonObject.put("verifyCods", verifyCodMap.get(item.getProductId()));
|
|
|
|
|
- item.setJsonInfo(jsonObject.toJSONString());
|
|
|
|
|
|
|
+ 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());
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+// //获取溯源码相关数据
|
|
|
|
|
+// List<FsStoreVerifyCodeScrm> verifyCodes = fsStoreVerifyCodeService.selectList(new LambdaQueryWrapper<FsStoreVerifyCodeScrm>().select(FsStoreVerifyCodeScrm::getVerifyCode,FsStoreVerifyCodeScrm::getProductId).eq(FsStoreVerifyCodeScrm::getOrderId, order.getId()));
|
|
|
|
|
+// if(!verifyCodes.isEmpty()){
|
|
|
|
|
+// Map<Long, String> verifyCodMap=new HashMap<>();
|
|
|
|
|
+// for (FsStoreVerifyCodeScrm v : verifyCodes){
|
|
|
|
|
+// if(verifyCodMap.containsKey(v.getProductId())){
|
|
|
|
|
+// verifyCodMap.put(v.getProductId(),verifyCodMap.get(v.getProductId())+","+v.getVerifyCode());
|
|
|
|
|
+// }else {
|
|
|
|
|
+// verifyCodMap.put(v.getProductId(),v.getVerifyCode());
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+// for (FsStoreAfterSalesItemScrm item : items){
|
|
|
|
|
+// if(verifyCodMap.containsKey(item.getProductId())){
|
|
|
|
|
+// JSONObject jsonObject = JSONObject.parseObject(item.getJsonInfo());
|
|
|
|
|
+// jsonObject.put("verifyCods", verifyCodMap.get(item.getProductId()));
|
|
|
|
|
+// item.setJsonInfo(jsonObject.toJSONString());
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+// }
|
|
|
return R.ok().put("afterSales",afterSales).put("items",items).put("logs",logs).put("user",user).put("order",order).put("store",storeScrm);
|
|
return R.ok().put("afterSales",afterSales).put("items",items).put("logs",logs).put("user",user).put("order",order).put("store",storeScrm);
|
|
|
}
|
|
}
|
|
|
|
|
|