提交代码

master
胡锐 6 months ago committed by yuanye
parent 23c9fc1033
commit 21d9ee13e8
  1. 1
      cweb/src/main/java/com/cweb/config/AuthConfig.java
  2. 29
      order/src/main/java/com/order/controller/OrderRefundController.java
  3. 6
      service/src/main/java/com/hfkj/service/order/BsOrderRefundService.java
  4. 21
      service/src/main/java/com/hfkj/service/order/impl/BsOrderRefundServiceImpl.java
  5. 1
      user/src/main/java/com/user/config/AuthConfig.java
  6. 2
      user/src/main/java/com/user/controller/BsUserController.java
  7. 4
      user/src/main/java/com/user/controller/SecUserController.java

@ -89,6 +89,7 @@ public class AuthConfig implements WebMvcConfigurer {
.excludePathPatterns("/goods/*")
.excludePathPatterns("/cms/*")
.excludePathPatterns("/common/*")
.excludePathPatterns("/fileUpload/*")
;
}

@ -13,6 +13,7 @@ import com.hfkj.model.ResponseData;
import com.hfkj.model.UserSessionObject;
import com.hfkj.model.order.OrderChildModel;
import com.hfkj.model.order.OrderModel;
import com.hfkj.service.order.BsOrderChildService;
import com.hfkj.service.order.BsOrderRefundService;
import com.hfkj.service.order.BsOrderService;
import com.hfkj.sysenum.UserStatusEnum;
@ -27,6 +28,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
@ -44,7 +46,8 @@ public class OrderRefundController {
private UserCenter userCenter;
@Resource
private BsOrderRefundService orderRefundService;
@Resource
private BsOrderChildService orderChildService;
@RequestMapping(value="/tradeOrder",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "退款交易订单")
@ -98,24 +101,24 @@ public class OrderRefundController {
}
}
@RequestMapping(value="/queryOrderRefund",method = RequestMethod.GET)
@RequestMapping(value="/queryRefund",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询退款订单")
public ResponseData queryOrderRefund(@RequestParam(value = "orderNo" , required = false) String orderNo,
@RequestParam(value = "orderChildNo" , required = false) String orderChildNo,
@RequestParam(value = "refundOrderNo" , required = false) String refundOrderNo) {
public ResponseData queryRefund(@RequestParam(value = "refundOrderNo" , required = false) String refundOrderNo) {
try {
if (StringUtils.isBlank(orderNo)
&& StringUtils.isBlank(orderChildNo)
&& StringUtils.isBlank(refundOrderNo)) {
if (StringUtils.isBlank(refundOrderNo)) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
// 查询退款
BsOrderRefund refund = orderRefundService.getRefund(refundOrderNo);
if (refund == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的退款");
}
Map<String,Object> param = new HashMap<>();
param.put("orderNo", orderNo);
param.put("orderChildNo", orderChildNo);
param.put("refundOrderNo", refundOrderNo);
return ResponseMsgUtil.success(orderRefundService.getRefundList(param));
Map<String,Object> map = new HashMap<>();
map.put("refund", refund);
map.put("orderChild", orderChildService.getDetail(refund.getOrderChildNo()));
return ResponseMsgUtil.success(map);
} catch (Exception e) {
log.error("error!",e);

@ -40,6 +40,12 @@ public interface BsOrderRefundService {
*/
BsOrderRefund tradeOrderChildRefund(String childOrderNo, Integer productCount, String remark);
/**
* 查询退款
* @param refundOrderNo 退款单号
* @return
*/
BsOrderRefund getRefund(String refundOrderNo);
/**
* 查询退款列表
* @param param

@ -189,6 +189,17 @@ public class BsOrderRefundServiceImpl implements BsOrderRefundService {
}
@Override
public BsOrderRefund getRefund(String refundOrderNo) {
BsOrderRefundExample example = new BsOrderRefundExample();
example.createCriteria().andRefundOrderNoEqualTo(refundOrderNo);
List<BsOrderRefund> list = orderRefundMapper.selectByExample(example);
if (!list.isEmpty()){
return list.get(0);
}
return null;
}
@Override
public List<BsOrderRefund> getRefundList(Map<String, Object> param) {
BsOrderRefundExample example = new BsOrderRefundExample();
@ -199,15 +210,19 @@ public class BsOrderRefundServiceImpl implements BsOrderRefundService {
}
if (StringUtils.isNotBlank(MapUtils.getString(param, "orderNo"))) {
criteria.andOrderNoEqualTo(MapUtils.getString(param, "orderNo"));
criteria.andOrderNoLike("%"+MapUtils.getString(param, "orderNo")+"%");
}
if (StringUtils.isNotBlank(MapUtils.getString(param, "orderChildNo"))) {
criteria.andOrderNoEqualTo(MapUtils.getString(param, "orderChildNo"));
criteria.andOrderChildNoLike("%"+MapUtils.getString(param, "orderChildNo")+"%");
}
if (StringUtils.isNotBlank(MapUtils.getString(param, "refundOrderNo"))) {
criteria.andOrderNoEqualTo(MapUtils.getString(param, "refundOrderNo"));
criteria.andRefundOrderNoLike("%"+MapUtils.getString(param, "refundOrderNo")+"%");
}
if (MapUtils.getInteger(param, "refundStatus") != null) {
criteria.andRefundStatusEqualTo(MapUtils.getInteger(param, "refundStatus"));
}
if (MapUtils.getLong(param, "createTimeS") != null) {

@ -88,6 +88,7 @@ public class AuthConfig implements WebMvcConfigurer {
.excludePathPatterns("/client/*")
.excludePathPatterns("/sms/*")
.excludePathPatterns("/secUser/login")
.excludePathPatterns("/secUser/loginOut")
;
}

@ -202,8 +202,6 @@ public class BsUserController {
SecUserSessionObject session = userCenter.getSessionModel(SecUserSessionObject.class);
if (session != null) {
userCenter.remove(request);
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.ACCOUNT_LOGIN_NOT, "");
}
return ResponseMsgUtil.success("退出成功");

@ -91,13 +91,13 @@ public class SecUserController {
@ResponseBody
@ApiOperation(value = "退出登录")
public ResponseData loginOut(HttpServletRequest request) {
try {
try {
SecUserSessionObject session = userCenter.getSessionModel(SecUserSessionObject.class);
if (session != null) {
userCenter.remove(request);
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "账户已退出登录");
}
} catch (Exception e) {}
return ResponseMsgUtil.success("退出成功");
} catch (Exception e) {

Loading…
Cancel
Save