|
@@ -4,13 +4,19 @@ import java.util.Date;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
+import com.pj.api.client.admin.AdminInterface;
|
|
|
|
+import com.pj.common.core.exception.ServiceException;
|
|
import com.pj.current.dto.APPLoginUserInfo;
|
|
import com.pj.current.dto.APPLoginUserInfo;
|
|
import com.pj.current.satoken.StpAPPUserUtil;
|
|
import com.pj.current.satoken.StpAPPUserUtil;
|
|
|
|
+import com.pj.enummj.DeleteStatus;
|
|
|
|
+import com.pj.enummj.UserType;
|
|
import com.pj.tb_order.TbOrder;
|
|
import com.pj.tb_order.TbOrder;
|
|
import com.pj.tb_order.TbOrderMapper;
|
|
import com.pj.tb_order.TbOrderMapper;
|
|
import com.pj.tb_order.TbOrderService;
|
|
import com.pj.tb_order.TbOrderService;
|
|
import com.pj.tb_order_after_sale.param.AfterSaleParam;
|
|
import com.pj.tb_order_after_sale.param.AfterSaleParam;
|
|
|
|
+import com.pj.tb_order_after_sale.param.TbOrderAfterSaleParam;
|
|
import com.pj.utils.so.SoMap;
|
|
import com.pj.utils.so.SoMap;
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -33,6 +39,9 @@ public class TbOrderAfterSaleService extends ServiceImpl<TbOrderAfterSaleMapper,
|
|
/** 订单表 */
|
|
/** 订单表 */
|
|
@Autowired
|
|
@Autowired
|
|
private TbOrderService tbOrderService;
|
|
private TbOrderService tbOrderService;
|
|
|
|
+ /** 一级市场订单表 */
|
|
|
|
+ @Autowired
|
|
|
|
+ private TbOrderMapper tbOrderMapper;
|
|
|
|
|
|
/** 增 */
|
|
/** 增 */
|
|
void add(TbOrderAfterSale t){
|
|
void add(TbOrderAfterSale t){
|
|
@@ -60,10 +69,30 @@ public class TbOrderAfterSaleService extends ServiceImpl<TbOrderAfterSaleMapper,
|
|
return tbOrderAfterSaleMapper.getList(so);
|
|
return tbOrderAfterSaleMapper.getList(so);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * app端:查集合 - 根据条件(参数为空时代表忽略指定条件
|
|
|
|
+ * @param soMap
|
|
|
|
+ * @param afterSaleStatus 可根据售后状态进行查询
|
|
|
|
+ * @param keyword 可根据关键字进行查询
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ List<TbOrderAfterSale> getAppList(SoMap soMap,Integer afterSaleStatus,String keyword) {
|
|
|
|
+ //获取当前登陆人
|
|
|
|
+ APPLoginUserInfo appLoginInfo = StpAPPUserUtil.getAPPLoginInfo();
|
|
|
|
+ if(appLoginInfo == null || appLoginInfo.getLoginId() == null)
|
|
|
|
+ throw new ServiceException("当前登录用户信息已失效!");
|
|
|
|
+ //设置当前人的查看信息
|
|
|
|
+ soMap.set("apply_type",afterSaleStatus);
|
|
|
|
+ soMap.set("keyword",keyword);
|
|
|
|
+ soMap.set("sale_main_id",appLoginInfo.getLoginId());
|
|
|
|
+ soMap.set("delete_status", DeleteStatus.DELETE_STATUS_ON.getCode());
|
|
|
|
+ soMap.set("sortType",5);
|
|
|
|
+ return tbOrderAfterSaleMapper.getList(soMap);
|
|
|
|
+ }
|
|
|
|
+
|
|
/** app查看个人订单 */
|
|
/** app查看个人订单 */
|
|
List<TbOrder> selectSelfOrders(SoMap soMap){
|
|
List<TbOrder> selectSelfOrders(SoMap soMap){
|
|
//下面调用已获取登陆人信息
|
|
//下面调用已获取登陆人信息
|
|
-
|
|
|
|
List<TbOrder> tbOrderList = tbOrderService.selectSelfOrders(soMap);
|
|
List<TbOrder> tbOrderList = tbOrderService.selectSelfOrders(soMap);
|
|
return tbOrderList;
|
|
return tbOrderList;
|
|
}
|
|
}
|
|
@@ -81,4 +110,35 @@ public class TbOrderAfterSaleService extends ServiceImpl<TbOrderAfterSaleMapper,
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 查看并处理边民退单、退款请求(确认退款)
|
|
|
|
+ */
|
|
|
|
+ public void disposeOrders(TbOrderAfterSaleParam tbOrderAfterSaleParam){
|
|
|
|
+ //获取当前登陆人
|
|
|
|
+ APPLoginUserInfo appLoginInfo = StpAPPUserUtil.getAPPLoginInfo();
|
|
|
|
+ if(appLoginInfo == null || appLoginInfo.getLoginId() == null)
|
|
|
|
+ throw new RuntimeException("当前登录账号信息已失效!");
|
|
|
|
+ //判断当前用户是否为商户
|
|
|
|
+ if(!appLoginInfo.getUserType().equals(UserType.USER_TYPE_ENTERPRISE.getCode().toString()))
|
|
|
|
+ throw new ServiceException("您当前身份不是商户!");
|
|
|
|
+ //保存售后结果
|
|
|
|
+ TbOrderAfterSale tbOrderAfterSale = new TbOrderAfterSale();
|
|
|
|
+ BeanUtils.copyProperties(tbOrderAfterSaleParam,tbOrderAfterSale);
|
|
|
|
+ int updateById = tbOrderAfterSaleMapper.updateById(tbOrderAfterSale);
|
|
|
|
+ if(updateById != 1)
|
|
|
|
+ throw new RuntimeException("售后结果修改失败!");
|
|
|
|
+ //获取商家处理结果
|
|
|
|
+ Integer result = tbOrderAfterSaleParam.getResult();
|
|
|
|
+ if(result == 1){
|
|
|
|
+ //商家同意,开始执行退货退款
|
|
|
|
+ //todo: 解冻互市组民的资金
|
|
|
|
+
|
|
|
|
+ }else {
|
|
|
|
+ //商家不同意,驳回, todo: 给互市组组长发送推送提示
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|