|
@@ -1,5 +1,7 @@
|
|
|
package com.fs.hisStore.controller;
|
|
package com.fs.hisStore.controller;
|
|
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.fs.common.annotation.Log;
|
|
import com.fs.common.annotation.Log;
|
|
|
import com.fs.common.core.controller.BaseController;
|
|
import com.fs.common.core.controller.BaseController;
|
|
|
import com.fs.common.core.domain.AjaxResult;
|
|
import com.fs.common.core.domain.AjaxResult;
|
|
@@ -14,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.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;
|
|
|
import com.fs.hisStore.param.FsStoreAfterSalesCancelParam;
|
|
import com.fs.hisStore.param.FsStoreAfterSalesCancelParam;
|
|
@@ -25,7 +28,9 @@ import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
import java.text.ParseException;
|
|
import java.text.ParseException;
|
|
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
+import java.util.Map;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 售后记录Controller
|
|
* 售后记录Controller
|
|
@@ -53,6 +58,10 @@ public class FsStoreAfterSalesScrmController extends BaseController
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private TokenService tokenService;
|
|
private TokenService tokenService;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private FsStoreVerifyCodeScrmMapper fsStoreVerifyCodeService;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 查询售后记录列表
|
|
* 查询售后记录列表
|
|
|
*/
|
|
*/
|
|
@@ -106,9 +115,31 @@ public class FsStoreAfterSalesScrmController extends BaseController
|
|
|
statusMap.setStoreAfterSalesId(id);
|
|
statusMap.setStoreAfterSalesId(id);
|
|
|
List<FsStoreAfterSalesStatusScrm> logs=storeAfterSalesStatusService.selectFsStoreAfterSalesStatusList(statusMap);
|
|
List<FsStoreAfterSalesStatusScrm> logs=storeAfterSalesStatusService.selectFsStoreAfterSalesStatusList(statusMap);
|
|
|
FsUser user=userService.selectFsUserById(afterSales.getUserId());
|
|
FsUser user=userService.selectFsUserById(afterSales.getUserId());
|
|
|
- user.setPhone(ParseUtils.parsePhone(user.getPhone()));
|
|
|
|
|
|
|
+// user.setPhone(ParseUtils.parsePhone(user.getPhone()));
|
|
|
FsStoreOrderScrm order=fsStoreOrderService.selectFsStoreOrderByOrderCode(afterSales.getOrderCode());
|
|
FsStoreOrderScrm order=fsStoreOrderService.selectFsStoreOrderByOrderCode(afterSales.getOrderCode());
|
|
|
FsStoreScrm storeScrm = storeScrmService.selectFsStoreByStoreId(order.getStoreId());
|
|
FsStoreScrm storeScrm = storeScrmService.selectFsStoreByStoreId(order.getStoreId());
|
|
|
|
|
+
|
|
|
|
|
+ //获取溯源码相关数据
|
|
|
|
|
+ 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);
|
|
|
}
|
|
}
|
|
|
|
|
|