From 54b53ab709a7b2dc9787e61cee3c3804cc9df847 Mon Sep 17 00:00:00 2001 From: yuanye <418471657@qq.com> Date: Fri, 12 Jul 2024 11:40:10 +0800 Subject: [PATCH 1/4] 1 --- .../java/com/order/controller/OrderRefundController.java | 1 + .../main/java/com/hfkj/qianzhu/channel/CinemaService.java | 4 ++-- .../com/hfkj/service/order/OrderRefundSuccessService.java | 8 ++++++-- .../hfkj/service/order/impl/BsOrderRefundServiceImpl.java | 1 + .../main/java/com/hfkj/service/user/BsUserService.java | 2 +- .../com/hfkj/service/user/impl/BsUserServiceImpl.java | 8 ++++---- .../main/java/com/user/controller/BsUserController.java | 4 ++-- 7 files changed, 17 insertions(+), 11 deletions(-) diff --git a/order/src/main/java/com/order/controller/OrderRefundController.java b/order/src/main/java/com/order/controller/OrderRefundController.java index 33490ac..86e0509 100644 --- a/order/src/main/java/com/order/controller/OrderRefundController.java +++ b/order/src/main/java/com/order/controller/OrderRefundController.java @@ -50,6 +50,7 @@ public class OrderRefundController { private BsOrderRefundService orderRefundService; @Resource private BsOrderChildService orderChildService; + @RequestMapping(value="/tradeOrder",method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "退款交易订单") diff --git a/service/src/main/java/com/hfkj/qianzhu/channel/CinemaService.java b/service/src/main/java/com/hfkj/qianzhu/channel/CinemaService.java index fbbdcd4..3c2f557 100644 --- a/service/src/main/java/com/hfkj/qianzhu/channel/CinemaService.java +++ b/service/src/main/java/com/hfkj/qianzhu/channel/CinemaService.java @@ -238,7 +238,7 @@ public class CinemaService { if (object.getBoolean("success") && object.getInteger("code") == 10000) { return object; } else { - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, object.getInteger("code")); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, object); } } @@ -282,7 +282,7 @@ public class CinemaService { if (object.getBoolean("success") && object.getInteger("code") == 10000) { return object; } else { - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "查询失败!"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, object); } } diff --git a/service/src/main/java/com/hfkj/service/order/OrderRefundSuccessService.java b/service/src/main/java/com/hfkj/service/order/OrderRefundSuccessService.java index 1f8993e..d482024 100644 --- a/service/src/main/java/com/hfkj/service/order/OrderRefundSuccessService.java +++ b/service/src/main/java/com/hfkj/service/order/OrderRefundSuccessService.java @@ -47,7 +47,7 @@ public class OrderRefundSuccessService { cinema(orderChild); } } catch (Exception e) { - + throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR , e.getMessage()); } } @@ -60,14 +60,18 @@ public class OrderRefundSuccessService { if (orderCinema != null) { Map map = new HashMap<>(); map.put("orderNo", childOrder.getOrderNo()); - CinemaService.refundMovieOrder(map); + JSONObject object = CinemaService.refundMovieOrder(map); + System.out.println("========================================="); + System.out.println(object); orderCinema.setStatus(-5); + orderCinema.setExceptionStatus(false); bsOrderCinemaService.update(orderCinema); } } catch (Exception e) { orderCinema.setExceptionStatus(true); orderCinema.setExceptionMsg(e.getMessage()); bsOrderCinemaService.update(orderCinema); + throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR , e.getMessage()); } } 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 643e311..99f8aa4 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 @@ -161,6 +161,7 @@ public class BsOrderRefundServiceImpl implements BsOrderRefundService { if (order == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的交易订单"); } + // 创建退款订单 BsOrderRefund orderRefund = new BsOrderRefund(); orderRefund.setMerId(orderChild.getMerId()); diff --git a/service/src/main/java/com/hfkj/service/user/BsUserService.java b/service/src/main/java/com/hfkj/service/user/BsUserService.java index 1aad5f5..cb4c156 100644 --- a/service/src/main/java/com/hfkj/service/user/BsUserService.java +++ b/service/src/main/java/com/hfkj/service/user/BsUserService.java @@ -40,7 +40,7 @@ public interface BsUserService { * @param vFamilyOpenid 手机号 * @return */ - BsUser getUserByVFamilyOpenid(String vFamilyOpenid); + BsUser getUserByOutsideOpenid(String vFamilyOpenid); /** diff --git a/service/src/main/java/com/hfkj/service/user/impl/BsUserServiceImpl.java b/service/src/main/java/com/hfkj/service/user/impl/BsUserServiceImpl.java index 56100dd..6e32669 100644 --- a/service/src/main/java/com/hfkj/service/user/impl/BsUserServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/user/impl/BsUserServiceImpl.java @@ -79,10 +79,10 @@ public class BsUserServiceImpl implements BsUserService { } @Override - public BsUser getUserByVFamilyOpenid(String vFamilyOpenid) { + public BsUser getUserByOutsideOpenid(String outsideOpenid) { BsUserExample example = new BsUserExample(); example.createCriteria() - .andVFamilyOpenidEqualTo(vFamilyOpenid) + .andOutsideOpenidEqualTo(outsideOpenid) .andStatusNotEqualTo(UserStatusEnum.status0.getCode()); List list = userMapper.selectByExample(example); if (!list.isEmpty()) { @@ -145,7 +145,7 @@ public class BsUserServiceImpl implements BsUserService { public BsUser register(String outsideOpenid, Map other) { // 查询手机号 BsUser user = new BsUser(); - user.setvFamilyOpenid(outsideOpenid); + user.setOutsideOpenid(outsideOpenid); user.setIntegral(0L); user.setWxMaOpenid(MapUtils.getString(other, "maOpenId")); user.setWxMpOpenid(MapUtils.getString(other, "mpOpenId")); @@ -186,7 +186,7 @@ public class BsUserServiceImpl implements BsUserService { @Override public SessionObject login(UserLoginPlatform platform, UserLoginType loginType, String outsideOpenid, Map other) throws Exception { - BsUser user = getUserByVFamilyOpenid(outsideOpenid); + BsUser user = getUserByOutsideOpenid(outsideOpenid); if (user == null ) { user = register(outsideOpenid, other); } diff --git a/user/src/main/java/com/user/controller/BsUserController.java b/user/src/main/java/com/user/controller/BsUserController.java index 68ea932..b5fe69e 100644 --- a/user/src/main/java/com/user/controller/BsUserController.java +++ b/user/src/main/java/com/user/controller/BsUserController.java @@ -130,7 +130,7 @@ public class BsUserController { log.error("LoginController --> phone() error!", "请求参数校验失败"); throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); } - String vFamilyOpenid = body.getString("vFamilyOpenid"); + String outsideOpenid = body.getString("outsideOpenid"); // 客户端 UserLoginPlatform platform = UserLoginPlatform.getDataByType(body.getString("platform")); @@ -149,7 +149,7 @@ public class BsUserController { if (body.getString("type").equals(UserLoginType.V_FAMILY_OPENID.getCode())) { Map other = new HashMap<>(); - return ResponseMsgUtil.success(userService.login(platform, loginType, vFamilyOpenid, other)); + return ResponseMsgUtil.success(userService.login(platform, loginType, outsideOpenid, other)); } throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "登录失败"); From e6464af03071c5ca8072360d97dc03a3bfc0330d Mon Sep 17 00:00:00 2001 From: yuanye <418471657@qq.com> Date: Fri, 12 Jul 2024 11:51:13 +0800 Subject: [PATCH 2/4] 1 --- .../com/hfkj/service/user/impl/BsUserServiceImpl.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/service/src/main/java/com/hfkj/service/user/impl/BsUserServiceImpl.java b/service/src/main/java/com/hfkj/service/user/impl/BsUserServiceImpl.java index 6e32669..42d399d 100644 --- a/service/src/main/java/com/hfkj/service/user/impl/BsUserServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/user/impl/BsUserServiceImpl.java @@ -129,15 +129,13 @@ public class BsUserServiceImpl implements BsUserService { } BsUser user = new BsUser(); user.setPhone(phone); + user.setName("嗨用户"); user.setPassword(password); user.setIntegral(0L); user.setWxMaOpenid(MapUtils.getString(other, "maOpenId")); user.setWxMpOpenid(MapUtils.getString(other, "mpOpenId")); user.setStatus(UserStatusEnum.status1.getCode()); editData(user); - - user.setName("用户"+user.getId()); - editData(user); return user; } @@ -146,14 +144,12 @@ public class BsUserServiceImpl implements BsUserService { // 查询手机号 BsUser user = new BsUser(); user.setOutsideOpenid(outsideOpenid); + user.setName("嗨用户"); user.setIntegral(0L); user.setWxMaOpenid(MapUtils.getString(other, "maOpenId")); user.setWxMpOpenid(MapUtils.getString(other, "mpOpenId")); user.setStatus(UserStatusEnum.status1.getCode()); editData(user); - - user.setName("用户"+user.getId()); - editData(user); return user; } From d6e31ddfab3b50833d729e32d3b8052a9e4af0e1 Mon Sep 17 00:00:00 2001 From: yuanye <418471657@qq.com> Date: Sat, 13 Jul 2024 15:51:28 +0800 Subject: [PATCH 3/4] 1 --- .../controller/business/BsOrderCinemaController.java | 8 ++++++++ .../service/goods/impl/BsOrderCinemaServiceImpl.java | 4 +--- .../com/hfkj/service/order/OrderPaySuccessService.java | 6 +++++- .../hfkj/service/order/OrderRefundSuccessService.java | 10 ++++------ .../hfkj/service/order/impl/BsOrderServiceImpl.java | 1 + .../java/com/hfkj/service/pay/huift/TradeService.java | 1 - .../com/hfkj/service/user/impl/BsUserServiceImpl.java | 9 +++++++++ .../com/hfkj/sysenum/order/OrderCinemaStatusEnum.java | 9 +++++++-- .../java/com/user/controller/BsUserController.java | 8 ++------ 9 files changed, 37 insertions(+), 19 deletions(-) diff --git a/order/src/main/java/com/order/controller/business/BsOrderCinemaController.java b/order/src/main/java/com/order/controller/business/BsOrderCinemaController.java index 559c3c9..56a478f 100644 --- a/order/src/main/java/com/order/controller/business/BsOrderCinemaController.java +++ b/order/src/main/java/com/order/controller/business/BsOrderCinemaController.java @@ -24,6 +24,7 @@ import org.springframework.web.bind.annotation.ResponseBody; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; +import java.util.Date; import java.util.HashMap; import java.util.Map; @@ -97,6 +98,13 @@ public class BsOrderCinemaController { map.put("orderNo" , bsOrderCinema.getChannelOrderNo()); JSONObject object = CinemaService.getByOrderNo(map); + if (object != null) { + bsOrderCinema.setStatus(object.getInteger("status")); + bsOrderCinema.setUpdateTime(new Date()); + bsOrderCinemaService.update(bsOrderCinema); + } + + return ResponseMsgUtil.success(object); } catch (Exception e) { diff --git a/service/src/main/java/com/hfkj/service/goods/impl/BsOrderCinemaServiceImpl.java b/service/src/main/java/com/hfkj/service/goods/impl/BsOrderCinemaServiceImpl.java index 4e51a07..56b59af 100644 --- a/service/src/main/java/com/hfkj/service/goods/impl/BsOrderCinemaServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/goods/impl/BsOrderCinemaServiceImpl.java @@ -100,10 +100,8 @@ public class BsOrderCinemaServiceImpl implements BsOrderCinemaService { } if (MapUtils.getInteger(map, "status") != null) { criteria.andStatusEqualTo(MapUtils.getInteger(map, "status")); - } else { - criteria.andStatusNotEqualTo(0); } - example.setOrderByClause("create_time desc"); + example.setOrderByClause("exception_status desc"); return bsOrderCinemaMapper.selectByExample(example); } } diff --git a/service/src/main/java/com/hfkj/service/order/OrderPaySuccessService.java b/service/src/main/java/com/hfkj/service/order/OrderPaySuccessService.java index 3b44acc..d65f357 100644 --- a/service/src/main/java/com/hfkj/service/order/OrderPaySuccessService.java +++ b/service/src/main/java/com/hfkj/service/order/OrderPaySuccessService.java @@ -24,6 +24,7 @@ import com.hfkj.service.goods.impl.GoodsSpecsServiceImpl; import com.hfkj.service.hlt.HuiLianTongUnionCardService; import com.hfkj.sysenum.GoodsVpdSourceEnum; import com.hfkj.sysenum.order.OrderChildProductTypeEnum; +import com.hfkj.sysenum.order.OrderCinemaStatusEnum; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; @@ -264,9 +265,12 @@ public class OrderPaySuccessService { orderCinema.setPaySerialNo(order.getPaySerialNo()); orderCinema.setPayTime(order.getPayTime()); orderCinema.setUpdateTime(new Date()); - orderCinema.setStatus(1); + orderCinema.setStatus(OrderCinemaStatusEnum.status5.getCode()); } catch (Exception e) { + if (orderCinema == null) { + orderCinema = new BsOrderCinema(); + } orderCinema.setExceptionStatus(true); orderCinema.setExceptionMsg(e.getMessage()); } finally { diff --git a/service/src/main/java/com/hfkj/service/order/OrderRefundSuccessService.java b/service/src/main/java/com/hfkj/service/order/OrderRefundSuccessService.java index d482024..cb69e69 100644 --- a/service/src/main/java/com/hfkj/service/order/OrderRefundSuccessService.java +++ b/service/src/main/java/com/hfkj/service/order/OrderRefundSuccessService.java @@ -47,7 +47,8 @@ public class OrderRefundSuccessService { cinema(orderChild); } } catch (Exception e) { - throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR , e.getMessage()); + System.out.println("========================================="); + System.out.println(e.getMessage()); } } @@ -60,18 +61,15 @@ public class OrderRefundSuccessService { if (orderCinema != null) { Map map = new HashMap<>(); map.put("orderNo", childOrder.getOrderNo()); - JSONObject object = CinemaService.refundMovieOrder(map); - System.out.println("========================================="); - System.out.println(object); + CinemaService.refundMovieOrder(map); orderCinema.setStatus(-5); orderCinema.setExceptionStatus(false); - bsOrderCinemaService.update(orderCinema); } } catch (Exception e) { orderCinema.setExceptionStatus(true); orderCinema.setExceptionMsg(e.getMessage()); + } finally { bsOrderCinemaService.update(orderCinema); - throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR , e.getMessage()); } } diff --git a/service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java b/service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java index 8a9edb8..cb93047 100644 --- a/service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java @@ -504,6 +504,7 @@ public class BsOrderServiceImpl implements BsOrderService { JSONObject object = CinemaService.getByOrderNo(map); if (object != null && object.getJSONObject("data") != null) { orderModel.setBusiness(object.getJSONObject("data")); + bsOrderCinema.setUpdateTime(new Date()); bsOrderCinema.setStatus(object.getJSONObject("data").getInteger("status")); } diff --git a/service/src/main/java/com/hfkj/service/pay/huift/TradeService.java b/service/src/main/java/com/hfkj/service/pay/huift/TradeService.java index 45b471e..0ed02e8 100644 --- a/service/src/main/java/com/hfkj/service/pay/huift/TradeService.java +++ b/service/src/main/java/com/hfkj/service/pay/huift/TradeService.java @@ -41,7 +41,6 @@ public class TradeService { param.put("shopCode", HuiftConfig.shopcode); param.put("outTradeNo", order.getOrderNo()); param.put("transAmt", order.getPayRealPrice().multiply(new BigDecimal("100")).intValue()); - param.put("mobileNbr", order.getUserPhone()); // 用户标识 param.put("callbackUrl", CommonSysConst.getSysConfig().getDomainName() + "/order/payNotify/huiftPay"); // param.put("remark", ""); // 备注 // param.put("outAppId", ""); diff --git a/service/src/main/java/com/hfkj/service/user/impl/BsUserServiceImpl.java b/service/src/main/java/com/hfkj/service/user/impl/BsUserServiceImpl.java index 42d399d..595a08b 100644 --- a/service/src/main/java/com/hfkj/service/user/impl/BsUserServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/user/impl/BsUserServiceImpl.java @@ -191,6 +191,15 @@ public class BsUserServiceImpl implements BsUserService { UserSessionObject session = new UserSessionObject(); session.setUser(user); + // 查询汇联通工会卡 + List hltCardList = userCardService.getCardList(user.getId(), UserCardTypeEnum.type1); + if (hltCardList.isEmpty()) { + session.setHltCardBind(false); + } else { + session.setHltCardBind(true); + session.setHltCard(hltCardList.get(0)); + } + SessionObject sessionObject = new SessionObject(token(user), session); userCenter.save(sessionObject); // 异步记录登录信息 diff --git a/service/src/main/java/com/hfkj/sysenum/order/OrderCinemaStatusEnum.java b/service/src/main/java/com/hfkj/sysenum/order/OrderCinemaStatusEnum.java index cacb2a9..379bcb7 100644 --- a/service/src/main/java/com/hfkj/sysenum/order/OrderCinemaStatusEnum.java +++ b/service/src/main/java/com/hfkj/sysenum/order/OrderCinemaStatusEnum.java @@ -12,9 +12,9 @@ import lombok.Getter; public enum OrderCinemaStatusEnum { /** - * 待付款 + * 未上送 */ - status0(0, "待付款"), + status0(0, "未上送"), /** * 待出票 @@ -36,6 +36,11 @@ public enum OrderCinemaStatusEnum { */ statusNegative5(-5, "已取消"), + /** + * 代付款 + */ + status20(20, "代付款"), + ; private final int code; diff --git a/user/src/main/java/com/user/controller/BsUserController.java b/user/src/main/java/com/user/controller/BsUserController.java index b5fe69e..24706ec 100644 --- a/user/src/main/java/com/user/controller/BsUserController.java +++ b/user/src/main/java/com/user/controller/BsUserController.java @@ -146,12 +146,8 @@ public class BsUserController { } // 账户密码登录 - if (body.getString("type").equals(UserLoginType.V_FAMILY_OPENID.getCode())) { - - Map other = new HashMap<>(); - return ResponseMsgUtil.success(userService.login(platform, loginType, outsideOpenid, other)); - } - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "登录失败"); + Map other = new HashMap<>(); + return ResponseMsgUtil.success(userService.login(platform, loginType, outsideOpenid, other)); } catch (Exception e) { log.error("LoginController --> phone() error!", e); From 9287e4d542f17cc17e233c499a061c5035cbdc6f Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Mon, 15 Jul 2024 09:48:39 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/hfkj/service/pay/huift/TradeService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/src/main/java/com/hfkj/service/pay/huift/TradeService.java b/service/src/main/java/com/hfkj/service/pay/huift/TradeService.java index 45b471e..7f6f844 100644 --- a/service/src/main/java/com/hfkj/service/pay/huift/TradeService.java +++ b/service/src/main/java/com/hfkj/service/pay/huift/TradeService.java @@ -45,7 +45,7 @@ public class TradeService { param.put("callbackUrl", CommonSysConst.getSysConfig().getDomainName() + "/order/payNotify/huiftPay"); // param.put("remark", ""); // 备注 // param.put("outAppId", ""); - param.put("outRedirectPath", CommonSysConst.getSysConfig().getDomainName()+"/phg/#/pages/user/order_list/order_list?tbIndex=-1"); + param.put("outRedirectPath", CommonSysConst.getSysConfig().getDomainName()+"/cweb/#/order/order/orderList"); param.put("sign", HuiftConfig.md5Encode(HuiftConfig.paramSort(param, HuiftConfig.signSecret).getBytes()).toLowerCase()); JSONObject response = HttpsUtils.doPost(HuiftConfig.reqUrl + "/hfq/v1/thirdPay/thirdPreOrder", JSONObject.toJSONString(param)); if (response.getString("status").equals("ok")) {