diff --git a/cweb/src/main/java/com/cweb/config/AuthConfig.java b/cweb/src/main/java/com/cweb/config/AuthConfig.java index 017649c..e0c1458 100644 --- a/cweb/src/main/java/com/cweb/config/AuthConfig.java +++ b/cweb/src/main/java/com/cweb/config/AuthConfig.java @@ -89,6 +89,7 @@ public class AuthConfig implements WebMvcConfigurer { .excludePathPatterns("/goods/*") .excludePathPatterns("/cms/*") .excludePathPatterns("/common/*") + .excludePathPatterns("/fileUpload/*") ; } diff --git a/order/src/main/java/com/order/controller/OrderRefundController.java b/order/src/main/java/com/order/controller/OrderRefundController.java index 5d20a99..cd00b90 100644 --- a/order/src/main/java/com/order/controller/OrderRefundController.java +++ b/order/src/main/java/com/order/controller/OrderRefundController.java @@ -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 param = new HashMap<>(); - param.put("orderNo", orderNo); - param.put("orderChildNo", orderChildNo); - param.put("refundOrderNo", refundOrderNo); - return ResponseMsgUtil.success(orderRefundService.getRefundList(param)); + Map 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); diff --git a/service/src/main/java/com/hfkj/service/order/BsOrderRefundService.java b/service/src/main/java/com/hfkj/service/order/BsOrderRefundService.java index c7b7195..280e246 100644 --- a/service/src/main/java/com/hfkj/service/order/BsOrderRefundService.java +++ b/service/src/main/java/com/hfkj/service/order/BsOrderRefundService.java @@ -40,6 +40,12 @@ public interface BsOrderRefundService { */ BsOrderRefund tradeOrderChildRefund(String childOrderNo, Integer productCount, String remark); + /** + * 查询退款 + * @param refundOrderNo 退款单号 + * @return + */ + BsOrderRefund getRefund(String refundOrderNo); /** * 查询退款列表 * @param param diff --git a/service/src/main/java/com/hfkj/service/order/impl/BsOrderRefundServiceImpl.java b/service/src/main/java/com/hfkj/service/order/impl/BsOrderRefundServiceImpl.java index 0362152..11b193d 100644 --- a/service/src/main/java/com/hfkj/service/order/impl/BsOrderRefundServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/order/impl/BsOrderRefundServiceImpl.java @@ -189,6 +189,17 @@ public class BsOrderRefundServiceImpl implements BsOrderRefundService { } + @Override + public BsOrderRefund getRefund(String refundOrderNo) { + BsOrderRefundExample example = new BsOrderRefundExample(); + example.createCriteria().andRefundOrderNoEqualTo(refundOrderNo); + List list = orderRefundMapper.selectByExample(example); + if (!list.isEmpty()){ + return list.get(0); + } + return null; + } + @Override public List getRefundList(Map 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) { diff --git a/user/src/main/java/com/user/config/AuthConfig.java b/user/src/main/java/com/user/config/AuthConfig.java index ed64476..5441d5d 100644 --- a/user/src/main/java/com/user/config/AuthConfig.java +++ b/user/src/main/java/com/user/config/AuthConfig.java @@ -88,6 +88,7 @@ public class AuthConfig implements WebMvcConfigurer { .excludePathPatterns("/client/*") .excludePathPatterns("/sms/*") .excludePathPatterns("/secUser/login") + .excludePathPatterns("/secUser/loginOut") ; } diff --git a/user/src/main/java/com/user/controller/BsUserController.java b/user/src/main/java/com/user/controller/BsUserController.java index 5ed9f32..e6dfd64 100644 --- a/user/src/main/java/com/user/controller/BsUserController.java +++ b/user/src/main/java/com/user/controller/BsUserController.java @@ -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("退出成功"); diff --git a/user/src/main/java/com/user/controller/SecUserController.java b/user/src/main/java/com/user/controller/SecUserController.java index e7e6ff7..4157c7b 100644 --- a/user/src/main/java/com/user/controller/SecUserController.java +++ b/user/src/main/java/com/user/controller/SecUserController.java @@ -92,12 +92,12 @@ public class SecUserController { @ApiOperation(value = "退出登录") public ResponseData loginOut(HttpServletRequest request) { try { - SecUserSessionObject session = userCenter.getSessionModel(SecUserSessionObject.class); - if (session != null) { - userCenter.remove(request); - } else { - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "账户已退出登录"); - } + try { + SecUserSessionObject session = userCenter.getSessionModel(SecUserSessionObject.class); + if (session != null) { + userCenter.remove(request); + } + } catch (Exception e) {} return ResponseMsgUtil.success("退出成功"); } catch (Exception e) {