Commit d12bab8f9cbdaf81186c07ef327eceed35019ed9
1 parent
c2b3929b
feat hourbuy init
Showing
36 changed files
with
1173 additions
and
81 deletions
cashier-mall/src/main/java/com/diligrp/cashier/mall/api/RtMallOrderApi.java
| @@ -3,7 +3,9 @@ package com.diligrp.cashier.mall.api; | @@ -3,7 +3,9 @@ package com.diligrp.cashier.mall.api; | ||
| 3 | import com.diligrp.cashier.mall.domain.rtmall.RtMarkMessage; | 3 | import com.diligrp.cashier.mall.domain.rtmall.RtMarkMessage; |
| 4 | import com.diligrp.cashier.mall.domain.rtmall.co.OrderCO; | 4 | import com.diligrp.cashier.mall.domain.rtmall.co.OrderCO; |
| 5 | import com.diligrp.cashier.mall.domain.rtmall.co.OrderInfoCO; | 5 | import com.diligrp.cashier.mall.domain.rtmall.co.OrderInfoCO; |
| 6 | +import com.diligrp.cashier.mall.domain.rtmall.co.OrderStatusCallbackCO; | ||
| 6 | import com.diligrp.cashier.mall.domain.rtmall.vo.OrderPaymentVO; | 7 | import com.diligrp.cashier.mall.domain.rtmall.vo.OrderPaymentVO; |
| 8 | +import com.diligrp.cashier.mall.domain.rtmall.vo.OrderStatusCallbackVO; | ||
| 7 | import com.diligrp.cashier.mall.domain.rtmall.vo.OrderSuccessVO; | 9 | import com.diligrp.cashier.mall.domain.rtmall.vo.OrderSuccessVO; |
| 8 | import com.diligrp.cashier.mall.service.biz.MallBizOrderService; | 10 | import com.diligrp.cashier.mall.service.biz.MallBizOrderService; |
| 9 | import com.diligrp.cashier.mall.sign.RtMallSign; | 11 | import com.diligrp.cashier.mall.sign.RtMallSign; |
| @@ -67,12 +69,15 @@ public class RtMallOrderApi { | @@ -67,12 +69,15 @@ public class RtMallOrderApi { | ||
| 67 | /** | 69 | /** |
| 68 | * statusCallback | 70 | * statusCallback |
| 69 | * @see https://shopex.yuque.com/hl0rrx/vlp0m4/nkwt5yrhdfzoy78s?singleDoc#oJ2JC | 71 | * @see https://shopex.yuque.com/hl0rrx/vlp0m4/nkwt5yrhdfzoy78s?singleDoc#oJ2JC |
| 70 | - * 查询订单状态 | 72 | + * 订单状态回调 |
| 71 | */ | 73 | */ |
| 72 | @PostMapping("/order/v1/status/callback") | 74 | @PostMapping("/order/v1/status/callback") |
| 73 | @ParamLogPrint(outPrint = true) | 75 | @ParamLogPrint(outPrint = true) |
| 74 | @Sign(sign = RtMallSign.class) | 76 | @Sign(sign = RtMallSign.class) |
| 75 | - public RtMarkMessage<?> statusCallback(@Valid @RequestBody Object req) { | ||
| 76 | - return RtMarkMessage.success(); | 77 | + @RepeatSubmit(prefix = "status_callback:", value = "#req['order_id']", duplicationSubmit = SpelDuplicationSubmit.class) |
| 78 | + public RtMarkMessage<OrderStatusCallbackVO> statusCallback(@Valid @RequestBody Object req) { | ||
| 79 | + OrderStatusCallbackCO orderStatusCallback = JsonUtils.convertValue(req, OrderStatusCallbackCO.class); | ||
| 80 | + RtMallValidateUtils.valid(orderStatusCallback); | ||
| 81 | + return RtMarkMessage.success(mallBizOrderService.statusCallback(orderStatusCallback)); | ||
| 77 | } | 82 | } |
| 78 | } | 83 | } |
cashier-mall/src/main/java/com/diligrp/cashier/mall/api/RtMallOrderRefundApi.java
| @@ -2,8 +2,9 @@ package com.diligrp.cashier.mall.api; | @@ -2,8 +2,9 @@ package com.diligrp.cashier.mall.api; | ||
| 2 | 2 | ||
| 3 | import com.diligrp.cashier.mall.domain.rtmall.RtMarkMessage; | 3 | import com.diligrp.cashier.mall.domain.rtmall.RtMarkMessage; |
| 4 | import com.diligrp.cashier.mall.domain.rtmall.co.OrderCO; | 4 | import com.diligrp.cashier.mall.domain.rtmall.co.OrderCO; |
| 5 | -import com.diligrp.cashier.mall.domain.rtmall.vo.OrderSuccessVO; | ||
| 6 | -import com.diligrp.cashier.mall.service.biz.MallBizOrderService; | 5 | +import com.diligrp.cashier.mall.domain.rtmall.co.RefundCO; |
| 6 | +import com.diligrp.cashier.mall.domain.rtmall.vo.RefundSuccessVO; | ||
| 7 | +import com.diligrp.cashier.mall.service.biz.MallBizRefundService; | ||
| 7 | import com.diligrp.cashier.mall.sign.RtMallSign; | 8 | import com.diligrp.cashier.mall.sign.RtMallSign; |
| 8 | import com.diligrp.cashier.mall.util.RtMallValidateUtils; | 9 | import com.diligrp.cashier.mall.util.RtMallValidateUtils; |
| 9 | import com.diligrp.cashier.shared.annotation.ParamLogPrint; | 10 | import com.diligrp.cashier.shared.annotation.ParamLogPrint; |
| @@ -30,27 +31,27 @@ import org.springframework.web.bind.annotation.RestController; | @@ -30,27 +31,27 @@ import org.springframework.web.bind.annotation.RestController; | ||
| 30 | @Validated | 31 | @Validated |
| 31 | public class RtMallOrderRefundApi { | 32 | public class RtMallOrderRefundApi { |
| 32 | @Resource | 33 | @Resource |
| 33 | - private MallBizOrderService mallBizOrderService; | 34 | + private MallBizRefundService mallBizRefundService; |
| 34 | 35 | ||
| 35 | /** | 36 | /** |
| 36 | - * createOrder | 37 | + * refund |
| 37 | * @see https://shopex.yuque.com/hl0rrx/vlp0m4/nkwt5yrhdfzoy78s?singleDoc#oJ2JC | 38 | * @see https://shopex.yuque.com/hl0rrx/vlp0m4/nkwt5yrhdfzoy78s?singleDoc#oJ2JC |
| 38 | - * 创建订单接口 | 39 | + * 申请退款接口 |
| 39 | */ | 40 | */ |
| 40 | @PostMapping("/refund/v1") | 41 | @PostMapping("/refund/v1") |
| 41 | @ParamLogPrint(outPrint = true) | 42 | @ParamLogPrint(outPrint = true) |
| 42 | @Sign(sign = RtMallSign.class) | 43 | @Sign(sign = RtMallSign.class) |
| 43 | - @RepeatSubmit(prefix = "order_sync:", value = "#req['order_id']", duplicationSubmit = SpelDuplicationSubmit.class) | ||
| 44 | - public RtMarkMessage<OrderSuccessVO> refund(@Valid @RequestBody Object req) { | ||
| 45 | - OrderCO orderCo = JsonUtils.convertValue(req, OrderCO.class); | ||
| 46 | - RtMallValidateUtils.valid(orderCo); | ||
| 47 | - return RtMarkMessage.success(mallBizOrderService.createOrder(orderCo)); | 44 | + @RepeatSubmit(prefix = "refund:", value = "#req['order_id']", duplicationSubmit = SpelDuplicationSubmit.class) |
| 45 | + public RtMarkMessage<RefundSuccessVO> refund(@Valid @RequestBody Object req) { | ||
| 46 | + RefundCO refundCo = JsonUtils.convertValue(req, RefundCO.class); | ||
| 47 | + RtMallValidateUtils.valid(refundCo); | ||
| 48 | + return RtMarkMessage.success(mallBizRefundService.refund(refundCo)); | ||
| 48 | } | 49 | } |
| 49 | 50 | ||
| 50 | /** | 51 | /** |
| 51 | * info | 52 | * info |
| 52 | * @see https://shopex.yuque.com/hl0rrx/vlp0m4/nkwt5yrhdfzoy78s?singleDoc#oJ2JC | 53 | * @see https://shopex.yuque.com/hl0rrx/vlp0m4/nkwt5yrhdfzoy78s?singleDoc#oJ2JC |
| 53 | - * 查询订单状态 | 54 | + * 查询退款状态 |
| 54 | */ | 55 | */ |
| 55 | @PostMapping("/refund/v1/info") | 56 | @PostMapping("/refund/v1/info") |
| 56 | @ParamLogPrint(outPrint = true) | 57 | @ParamLogPrint(outPrint = true) |
cashier-mall/src/main/java/com/diligrp/cashier/mall/context/MallInitializeContext.java
| @@ -2,7 +2,7 @@ package com.diligrp.cashier.mall.context; | @@ -2,7 +2,7 @@ package com.diligrp.cashier.mall.context; | ||
| 2 | 2 | ||
| 3 | import com.diligrp.cashier.mall.exception.MallException; | 3 | import com.diligrp.cashier.mall.exception.MallException; |
| 4 | import com.diligrp.cashier.mall.service.paychannel.AbstractPayChannel; | 4 | import com.diligrp.cashier.mall.service.paychannel.AbstractPayChannel; |
| 5 | -import com.diligrp.cashier.mall.service.sourcechannel.AbstractChannel; | 5 | +import com.diligrp.cashier.mall.service.sourcechannel.AbstractSourceChannel; |
| 6 | import com.diligrp.cashier.shared.util.SpringContextUtils; | 6 | import com.diligrp.cashier.shared.util.SpringContextUtils; |
| 7 | import com.google.common.collect.Maps; | 7 | import com.google.common.collect.Maps; |
| 8 | import org.slf4j.Logger; | 8 | import org.slf4j.Logger; |
| @@ -23,7 +23,7 @@ import java.util.Optional; | @@ -23,7 +23,7 @@ import java.util.Optional; | ||
| 23 | @Component | 23 | @Component |
| 24 | public class MallInitializeContext implements InitializingBean, DisposableBean { | 24 | public class MallInitializeContext implements InitializingBean, DisposableBean { |
| 25 | private static final Logger log = LoggerFactory.getLogger(MallInitializeContext.class); | 25 | private static final Logger log = LoggerFactory.getLogger(MallInitializeContext.class); |
| 26 | - public static Map<Integer, AbstractChannel> SOURCE_CHANNEL_MAP = Maps.newConcurrentMap(); | 26 | + public static Map<Integer, AbstractSourceChannel> SOURCE_CHANNEL_MAP = Maps.newConcurrentMap(); |
| 27 | public static Map<Integer, AbstractPayChannel> PAY_CHANNEL_MAP = Maps.newConcurrentMap(); | 27 | public static Map<Integer, AbstractPayChannel> PAY_CHANNEL_MAP = Maps.newConcurrentMap(); |
| 28 | 28 | ||
| 29 | /** | 29 | /** |
| @@ -31,7 +31,7 @@ public class MallInitializeContext implements InitializingBean, DisposableBean { | @@ -31,7 +31,7 @@ public class MallInitializeContext implements InitializingBean, DisposableBean { | ||
| 31 | */ | 31 | */ |
| 32 | @Override | 32 | @Override |
| 33 | public void afterPropertiesSet() throws Exception { | 33 | public void afterPropertiesSet() throws Exception { |
| 34 | - SpringContextUtils.getBeanOfTpe(AbstractChannel.class).forEach((key, value) -> { | 34 | + SpringContextUtils.getBeanOfTpe(AbstractSourceChannel.class).forEach((key, value) -> { |
| 35 | SOURCE_CHANNEL_MAP.put(value.source(), value); | 35 | SOURCE_CHANNEL_MAP.put(value.source(), value); |
| 36 | }); | 36 | }); |
| 37 | 37 | ||
| @@ -51,7 +51,7 @@ public class MallInitializeContext implements InitializingBean, DisposableBean { | @@ -51,7 +51,7 @@ public class MallInitializeContext implements InitializingBean, DisposableBean { | ||
| 51 | /** | 51 | /** |
| 52 | * getByType | 52 | * getByType |
| 53 | */ | 53 | */ |
| 54 | - public static AbstractChannel getBySource(Integer source) { | 54 | + public static AbstractSourceChannel getBySource(Integer source) { |
| 55 | return Optional.ofNullable(SOURCE_CHANNEL_MAP.get(source)).orElseThrow(() -> new MallException("不支持该渠道!")); | 55 | return Optional.ofNullable(SOURCE_CHANNEL_MAP.get(source)).orElseThrow(() -> new MallException("不支持该渠道!")); |
| 56 | } | 56 | } |
| 57 | 57 |
cashier-mall/src/main/java/com/diligrp/cashier/mall/dao/MallBizOrderDao.java
| @@ -3,6 +3,7 @@ package com.diligrp.cashier.mall.dao; | @@ -3,6 +3,7 @@ package com.diligrp.cashier.mall.dao; | ||
| 3 | 3 | ||
| 4 | import com.diligrp.cashier.mall.model.MallBizOrder; | 4 | import com.diligrp.cashier.mall.model.MallBizOrder; |
| 5 | import com.diligrp.cashier.shared.mybatis.MybatisMapperSupport; | 5 | import com.diligrp.cashier.shared.mybatis.MybatisMapperSupport; |
| 6 | +import org.apache.ibatis.annotations.Param; | ||
| 6 | 7 | ||
| 7 | /** | 8 | /** |
| 8 | * MallBizOrderDao | 9 | * MallBizOrderDao |
| @@ -21,4 +22,8 @@ public interface MallBizOrderDao extends MybatisMapperSupport { | @@ -21,4 +22,8 @@ public interface MallBizOrderDao extends MybatisMapperSupport { | ||
| 21 | int updateByPrimaryKeySelective(MallBizOrder record); | 22 | int updateByPrimaryKeySelective(MallBizOrder record); |
| 22 | 23 | ||
| 23 | int updateByPrimaryKey(MallBizOrder record); | 24 | int updateByPrimaryKey(MallBizOrder record); |
| 25 | + | ||
| 26 | + int update(MallBizOrder mallBizOrder); | ||
| 27 | + | ||
| 28 | + MallBizOrder getByOrderId(@Param("orderId") String orderId); | ||
| 24 | } | 29 | } |
cashier-mall/src/main/java/com/diligrp/cashier/mall/dao/MallBizPaymentDao.java
| @@ -20,4 +20,6 @@ public interface MallBizPaymentDao extends MybatisMapperSupport { | @@ -20,4 +20,6 @@ public interface MallBizPaymentDao extends MybatisMapperSupport { | ||
| 20 | int updateByPrimaryKeySelective(MallBizPayment record); | 20 | int updateByPrimaryKeySelective(MallBizPayment record); |
| 21 | 21 | ||
| 22 | int updateByPrimaryKey(MallBizPayment record); | 22 | int updateByPrimaryKey(MallBizPayment record); |
| 23 | + | ||
| 24 | + MallBizPayment getMallBizPayment(MallBizPayment mallBizPayment); | ||
| 23 | } | 25 | } |
cashier-mall/src/main/java/com/diligrp/cashier/mall/dao/MallBizRefundDao.java
0 → 100644
| 1 | +package com.diligrp.cashier.mall.dao; | ||
| 2 | + | ||
| 3 | + | ||
| 4 | +import com.diligrp.cashier.mall.model.MallBizRefund; | ||
| 5 | +import com.diligrp.cashier.shared.mybatis.MybatisMapperSupport; | ||
| 6 | + | ||
| 7 | +public interface MallBizRefundDao extends MybatisMapperSupport { | ||
| 8 | + int deleteByPrimaryKey(Long id); | ||
| 9 | + | ||
| 10 | + int insert(MallBizRefund record); | ||
| 11 | + | ||
| 12 | + int insertSelective(MallBizRefund record); | ||
| 13 | + | ||
| 14 | + MallBizRefund selectByPrimaryKey(Long id); | ||
| 15 | + | ||
| 16 | + int updateByPrimaryKeySelective(MallBizRefund record); | ||
| 17 | + | ||
| 18 | + int updateByPrimaryKey(MallBizRefund record); | ||
| 19 | +} |
cashier-mall/src/main/java/com/diligrp/cashier/mall/dao/MallBizRefundItemDao.java
| @@ -3,6 +3,9 @@ package com.diligrp.cashier.mall.dao; | @@ -3,6 +3,9 @@ package com.diligrp.cashier.mall.dao; | ||
| 3 | 3 | ||
| 4 | import com.diligrp.cashier.mall.model.MallBizRefundItem; | 4 | import com.diligrp.cashier.mall.model.MallBizRefundItem; |
| 5 | import com.diligrp.cashier.shared.mybatis.MybatisMapperSupport; | 5 | import com.diligrp.cashier.shared.mybatis.MybatisMapperSupport; |
| 6 | +import org.apache.ibatis.annotations.Param; | ||
| 7 | + | ||
| 8 | +import java.util.List; | ||
| 6 | 9 | ||
| 7 | /** | 10 | /** |
| 8 | * MallBizRefundItemDao | 11 | * MallBizRefundItemDao |
| @@ -21,4 +24,6 @@ public interface MallBizRefundItemDao extends MybatisMapperSupport { | @@ -21,4 +24,6 @@ public interface MallBizRefundItemDao extends MybatisMapperSupport { | ||
| 21 | int updateByPrimaryKeySelective(MallBizRefundItem record); | 24 | int updateByPrimaryKeySelective(MallBizRefundItem record); |
| 22 | 25 | ||
| 23 | int updateByPrimaryKey(MallBizRefundItem record); | 26 | int updateByPrimaryKey(MallBizRefundItem record); |
| 27 | + | ||
| 28 | + void batchInsert(@Param("list") List<MallBizRefundItem> items); | ||
| 24 | } | 29 | } |
cashier-mall/src/main/java/com/diligrp/cashier/mall/domain/rtmall/co/OrderStatusCallbackCO.java
0 → 100644
| 1 | +package com.diligrp.cashier.mall.domain.rtmall.co; | ||
| 2 | + | ||
| 3 | +import com.diligrp.cashier.mall.domain.rtmall.RtMarkBaseCO; | ||
| 4 | +import jakarta.validation.constraints.NotBlank; | ||
| 5 | + | ||
| 6 | +/** | ||
| 7 | + * @ClassName OrderStatusCallbackCO.java | ||
| 8 | + * @author dengwei | ||
| 9 | + * @version 1.0.0 | ||
| 10 | + * @Description OrderStatusCallbackCO | ||
| 11 | + * 订单状态回调 | ||
| 12 | + */ | ||
| 13 | +public class OrderStatusCallbackCO extends RtMarkBaseCO { | ||
| 14 | + /** | ||
| 15 | + * 订单ID | ||
| 16 | + */ | ||
| 17 | + @NotBlank(message = "order_id is required") | ||
| 18 | + private String orderId; | ||
| 19 | + | ||
| 20 | + /** | ||
| 21 | + * 会员编号 | ||
| 22 | + */ | ||
| 23 | + @NotBlank(message = "user_code is required") | ||
| 24 | + private String userCode; | ||
| 25 | + | ||
| 26 | + /** | ||
| 27 | + * 公司编码 | ||
| 28 | + */ | ||
| 29 | + private String companyCode; | ||
| 30 | + | ||
| 31 | + /** | ||
| 32 | + * 订单状态 | ||
| 33 | + */ | ||
| 34 | + @NotBlank(message = "order_status is required") | ||
| 35 | + private String orderStatus; | ||
| 36 | + | ||
| 37 | + public String getOrderId() { | ||
| 38 | + return orderId; | ||
| 39 | + } | ||
| 40 | + | ||
| 41 | + public void setOrderId(String orderId) { | ||
| 42 | + this.orderId = orderId; | ||
| 43 | + } | ||
| 44 | + | ||
| 45 | + public String getUserCode() { | ||
| 46 | + return userCode; | ||
| 47 | + } | ||
| 48 | + | ||
| 49 | + public void setUserCode(String userCode) { | ||
| 50 | + this.userCode = userCode; | ||
| 51 | + } | ||
| 52 | + | ||
| 53 | + public String getCompanyCode() { | ||
| 54 | + return companyCode; | ||
| 55 | + } | ||
| 56 | + | ||
| 57 | + public void setCompanyCode(String companyCode) { | ||
| 58 | + this.companyCode = companyCode; | ||
| 59 | + } | ||
| 60 | + | ||
| 61 | + public String getOrderStatus() { | ||
| 62 | + return orderStatus; | ||
| 63 | + } | ||
| 64 | + | ||
| 65 | + public void setOrderStatus(String orderStatus) { | ||
| 66 | + this.orderStatus = orderStatus; | ||
| 67 | + } | ||
| 68 | +} |
cashier-mall/src/main/java/com/diligrp/cashier/mall/domain/rtmall/co/RefundCO.java
0 → 100644
| 1 | +package com.diligrp.cashier.mall.domain.rtmall.co; | ||
| 2 | + | ||
| 3 | +import com.diligrp.cashier.mall.domain.rtmall.RtMarkBaseCO; | ||
| 4 | +import jakarta.validation.Valid; | ||
| 5 | +import jakarta.validation.constraints.NotBlank; | ||
| 6 | +import jakarta.validation.constraints.NotNull; | ||
| 7 | + | ||
| 8 | +import java.util.List; | ||
| 9 | + | ||
| 10 | +/** | ||
| 11 | + * @ClassName RefundCO.java | ||
| 12 | + * @author dengwei | ||
| 13 | + * @version 1.0.0 | ||
| 14 | + * @Description RefundCO | ||
| 15 | + */ | ||
| 16 | +public class RefundCO extends RtMarkBaseCO { | ||
| 17 | + /** | ||
| 18 | + * 订单ID | ||
| 19 | + */ | ||
| 20 | + @NotBlank(message = "order id is required") | ||
| 21 | + private String orderId; | ||
| 22 | + | ||
| 23 | + /** | ||
| 24 | + * 业务侧退款单号 | ||
| 25 | + */ | ||
| 26 | + @NotBlank(message = "refund bn is required") | ||
| 27 | + private String refundBn; | ||
| 28 | + | ||
| 29 | + /** | ||
| 30 | + * 用户ID | ||
| 31 | + */ | ||
| 32 | + @NotBlank(message = "user code is required") | ||
| 33 | + private String userCode; | ||
| 34 | + | ||
| 35 | + /** | ||
| 36 | + * 退款金额 | ||
| 37 | + */ | ||
| 38 | + @NotNull(message = "refund fee is required") | ||
| 39 | + private Long refundFee; | ||
| 40 | + | ||
| 41 | + /** | ||
| 42 | + * 公司ID | ||
| 43 | + */ | ||
| 44 | + private String companyCode; | ||
| 45 | + | ||
| 46 | + /** | ||
| 47 | + * 退款商品列表 | ||
| 48 | + */ | ||
| 49 | + @Valid | ||
| 50 | + private List<RefundItemCO> returnItemList; | ||
| 51 | + | ||
| 52 | + public String getOrderId() { | ||
| 53 | + return orderId; | ||
| 54 | + } | ||
| 55 | + | ||
| 56 | + public void setOrderId(String orderId) { | ||
| 57 | + this.orderId = orderId; | ||
| 58 | + } | ||
| 59 | + | ||
| 60 | + public String getRefundBn() { | ||
| 61 | + return refundBn; | ||
| 62 | + } | ||
| 63 | + | ||
| 64 | + public void setRefundBn(String refundBn) { | ||
| 65 | + this.refundBn = refundBn; | ||
| 66 | + } | ||
| 67 | + | ||
| 68 | + public String getUserCode() { | ||
| 69 | + return userCode; | ||
| 70 | + } | ||
| 71 | + | ||
| 72 | + public void setUserCode(String userCode) { | ||
| 73 | + this.userCode = userCode; | ||
| 74 | + } | ||
| 75 | + | ||
| 76 | + public Long getRefundFee() { | ||
| 77 | + return refundFee; | ||
| 78 | + } | ||
| 79 | + | ||
| 80 | + public void setRefundFee(Long refundFee) { | ||
| 81 | + this.refundFee = refundFee; | ||
| 82 | + } | ||
| 83 | + | ||
| 84 | + public String getCompanyCode() { | ||
| 85 | + return companyCode; | ||
| 86 | + } | ||
| 87 | + | ||
| 88 | + public void setCompanyCode(String companyCode) { | ||
| 89 | + this.companyCode = companyCode; | ||
| 90 | + } | ||
| 91 | + | ||
| 92 | + public List<RefundItemCO> getReturnItemList() { | ||
| 93 | + return returnItemList; | ||
| 94 | + } | ||
| 95 | + | ||
| 96 | + public void setReturnItemList(List<RefundItemCO> returnItemList) { | ||
| 97 | + this.returnItemList = returnItemList; | ||
| 98 | + } | ||
| 99 | +} |
cashier-mall/src/main/java/com/diligrp/cashier/mall/domain/rtmall/co/RefundItemCO.java
0 → 100644
| 1 | +package com.diligrp.cashier.mall.domain.rtmall.co; | ||
| 2 | + | ||
| 3 | +import com.fasterxml.jackson.databind.PropertyNamingStrategies; | ||
| 4 | +import com.fasterxml.jackson.databind.annotation.JsonNaming; | ||
| 5 | +import jakarta.validation.constraints.NotBlank; | ||
| 6 | +import jakarta.validation.constraints.NotNull; | ||
| 7 | + | ||
| 8 | +/** | ||
| 9 | + * @ClassName RefundItemCO.java | ||
| 10 | + * @author dengwei | ||
| 11 | + * @version 1.0.0 | ||
| 12 | + * @Description RefundItemCO | ||
| 13 | + */ | ||
| 14 | +@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) | ||
| 15 | +public class RefundItemCO { | ||
| 16 | + @NotNull(message = "num is required") | ||
| 17 | + private Integer num; | ||
| 18 | + | ||
| 19 | + @NotNull(message = "refund_fee is required") | ||
| 20 | + private Long refundFee; | ||
| 21 | + | ||
| 22 | + @NotBlank(message = "item_bn is required") | ||
| 23 | + private String itemBn; | ||
| 24 | + | ||
| 25 | + @NotBlank(message = "item_name is required") | ||
| 26 | + private String itemName; | ||
| 27 | + | ||
| 28 | + @NotNull(message = "sub_order_id is required") | ||
| 29 | + private Long subOrderId; | ||
| 30 | + | ||
| 31 | + public Integer getNum() { | ||
| 32 | + return num; | ||
| 33 | + } | ||
| 34 | + | ||
| 35 | + public void setNum(Integer num) { | ||
| 36 | + this.num = num; | ||
| 37 | + } | ||
| 38 | + | ||
| 39 | + public Long getRefundFee() { | ||
| 40 | + return refundFee; | ||
| 41 | + } | ||
| 42 | + | ||
| 43 | + public void setRefundFee(Long refundFee) { | ||
| 44 | + this.refundFee = refundFee; | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + public String getItemBn() { | ||
| 48 | + return itemBn; | ||
| 49 | + } | ||
| 50 | + | ||
| 51 | + public void setItemBn(String itemBn) { | ||
| 52 | + this.itemBn = itemBn; | ||
| 53 | + } | ||
| 54 | + | ||
| 55 | + public String getItemName() { | ||
| 56 | + return itemName; | ||
| 57 | + } | ||
| 58 | + | ||
| 59 | + public void setItemName(String itemName) { | ||
| 60 | + this.itemName = itemName; | ||
| 61 | + } | ||
| 62 | + | ||
| 63 | + public Long getSubOrderId() { | ||
| 64 | + return subOrderId; | ||
| 65 | + } | ||
| 66 | + | ||
| 67 | + public void setSubOrderId(Long subOrderId) { | ||
| 68 | + this.subOrderId = subOrderId; | ||
| 69 | + } | ||
| 70 | +} |
cashier-mall/src/main/java/com/diligrp/cashier/mall/domain/rtmall/dto/package-info.java
0 → 100644
cashier-mall/src/main/java/com/diligrp/cashier/mall/domain/rtmall/vo/OrderPaymentVO.java
| 1 | package com.diligrp.cashier.mall.domain.rtmall.vo; | 1 | package com.diligrp.cashier.mall.domain.rtmall.vo; |
| 2 | 2 | ||
| 3 | +import com.diligrp.cashier.shared.jackson.serialization.DateToSecondSerializer; | ||
| 3 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; | 4 | import com.fasterxml.jackson.databind.PropertyNamingStrategies; |
| 4 | import com.fasterxml.jackson.databind.annotation.JsonNaming; | 5 | import com.fasterxml.jackson.databind.annotation.JsonNaming; |
| 6 | +import com.fasterxml.jackson.databind.annotation.JsonSerialize; | ||
| 7 | + | ||
| 8 | +import java.time.LocalDateTime; | ||
| 5 | 9 | ||
| 6 | /** | 10 | /** |
| 7 | * @ClassName OrderPaymentVO.java | 11 | * @ClassName OrderPaymentVO.java |
| @@ -20,17 +24,18 @@ public class OrderPaymentVO { | @@ -20,17 +24,18 @@ public class OrderPaymentVO { | ||
| 20 | * 支付状态, 0:待支付,1:支付成功 | 24 | * 支付状态, 0:待支付,1:支付成功 |
| 21 | * @see com.diligrp.cashier.mall.type.PayState | 25 | * @see com.diligrp.cashier.mall.type.PayState |
| 22 | */ | 26 | */ |
| 23 | - private String payStatus; | 27 | + private Integer payStatus; |
| 24 | 28 | ||
| 25 | /** | 29 | /** |
| 26 | * 支付金额,单位分 | 30 | * 支付金额,单位分 |
| 27 | */ | 31 | */ |
| 28 | - private String payFee; | 32 | + private Long payFee; |
| 29 | 33 | ||
| 30 | /** | 34 | /** |
| 31 | * 支付时间 | 35 | * 支付时间 |
| 32 | */ | 36 | */ |
| 33 | - private Long payTime; | 37 | + @JsonSerialize(using = DateToSecondSerializer.class) |
| 38 | + private LocalDateTime payTime; | ||
| 34 | 39 | ||
| 35 | /** | 40 | /** |
| 36 | * 支付流水号(可为空, 支付成功时必传) | 41 | * 支付流水号(可为空, 支付成功时必传) |
| @@ -45,30 +50,31 @@ public class OrderPaymentVO { | @@ -45,30 +50,31 @@ public class OrderPaymentVO { | ||
| 45 | this.outTradeNo = outTradeNo; | 50 | this.outTradeNo = outTradeNo; |
| 46 | } | 51 | } |
| 47 | 52 | ||
| 48 | - public String getPayStatus() { | 53 | + public Integer getPayStatus() { |
| 49 | return payStatus; | 54 | return payStatus; |
| 50 | } | 55 | } |
| 51 | 56 | ||
| 52 | - public void setPayStatus(String payStatus) { | 57 | + public void setPayStatus(Integer payStatus) { |
| 53 | this.payStatus = payStatus; | 58 | this.payStatus = payStatus; |
| 54 | } | 59 | } |
| 55 | 60 | ||
| 56 | - public String getPayFee() { | 61 | + public Long getPayFee() { |
| 57 | return payFee; | 62 | return payFee; |
| 58 | } | 63 | } |
| 59 | 64 | ||
| 60 | - public void setPayFee(String payFee) { | 65 | + public void setPayFee(Long payFee) { |
| 61 | this.payFee = payFee; | 66 | this.payFee = payFee; |
| 62 | } | 67 | } |
| 63 | 68 | ||
| 64 | - public Long getPayTime() { | 69 | + public LocalDateTime getPayTime() { |
| 65 | return payTime; | 70 | return payTime; |
| 66 | } | 71 | } |
| 67 | 72 | ||
| 68 | - public void setPayTime(Long payTime) { | 73 | + public void setPayTime(LocalDateTime payTime) { |
| 69 | this.payTime = payTime; | 74 | this.payTime = payTime; |
| 70 | } | 75 | } |
| 71 | 76 | ||
| 77 | + | ||
| 72 | public String getTransactionId() { | 78 | public String getTransactionId() { |
| 73 | return transactionId; | 79 | return transactionId; |
| 74 | } | 80 | } |
cashier-mall/src/main/java/com/diligrp/cashier/mall/domain/rtmall/vo/OrderStatusCallbackVO.java
0 → 100644
| 1 | +package com.diligrp.cashier.mall.domain.rtmall.vo; | ||
| 2 | + | ||
| 3 | +import com.fasterxml.jackson.databind.PropertyNamingStrategies; | ||
| 4 | +import com.fasterxml.jackson.databind.annotation.JsonNaming; | ||
| 5 | + | ||
| 6 | +/** | ||
| 7 | + * @ClassName OrderStatusCallbackVO.java | ||
| 8 | + * @author dengwei | ||
| 9 | + * @version 1.0.0 | ||
| 10 | + * @Description OrderStatusCallbackVO | ||
| 11 | + */ | ||
| 12 | +@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) | ||
| 13 | +public class OrderStatusCallbackVO { | ||
| 14 | + /** | ||
| 15 | + * 商户支付单号 | ||
| 16 | + */ | ||
| 17 | + private String outTradeNo; | ||
| 18 | + | ||
| 19 | + public String getOutTradeNo() { | ||
| 20 | + return outTradeNo; | ||
| 21 | + } | ||
| 22 | + | ||
| 23 | + public void setOutTradeNo(String outTradeNo) { | ||
| 24 | + this.outTradeNo = outTradeNo; | ||
| 25 | + } | ||
| 26 | + | ||
| 27 | + public OrderStatusCallbackVO() { | ||
| 28 | + } | ||
| 29 | + | ||
| 30 | + public OrderStatusCallbackVO(String outTradeNo) { | ||
| 31 | + this.outTradeNo = outTradeNo; | ||
| 32 | + } | ||
| 33 | +} |
cashier-mall/src/main/java/com/diligrp/cashier/mall/domain/rtmall/vo/RefundSuccessVO.java
0 → 100644
| 1 | +package com.diligrp.cashier.mall.domain.rtmall.vo; | ||
| 2 | + | ||
| 3 | +import com.fasterxml.jackson.databind.PropertyNamingStrategies; | ||
| 4 | +import com.fasterxml.jackson.databind.annotation.JsonNaming; | ||
| 5 | + | ||
| 6 | +/** | ||
| 7 | + * @ClassName RefundSuccessVO.java | ||
| 8 | + * @author dengwei | ||
| 9 | + * @version 1.0.0 | ||
| 10 | + * @Description RefundSuccessVO | ||
| 11 | + */ | ||
| 12 | +@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) | ||
| 13 | +public class RefundSuccessVO { | ||
| 14 | + private String outTradeNo; | ||
| 15 | + private String outRefundNo; | ||
| 16 | + | ||
| 17 | + public RefundSuccessVO() { | ||
| 18 | + } | ||
| 19 | + | ||
| 20 | + public RefundSuccessVO(String outTradeNo, String outRefundNo) { | ||
| 21 | + this.outTradeNo = outTradeNo; | ||
| 22 | + this.outRefundNo = outRefundNo; | ||
| 23 | + } | ||
| 24 | + | ||
| 25 | + public String getOutTradeNo() { | ||
| 26 | + return outTradeNo; | ||
| 27 | + } | ||
| 28 | + | ||
| 29 | + public void setOutTradeNo(String outTradeNo) { | ||
| 30 | + this.outTradeNo = outTradeNo; | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | + public String getOutRefundNo() { | ||
| 34 | + return outRefundNo; | ||
| 35 | + } | ||
| 36 | + | ||
| 37 | + public void setOutRefundNo(String outRefundNo) { | ||
| 38 | + this.outRefundNo = outRefundNo; | ||
| 39 | + } | ||
| 40 | +} |
cashier-mall/src/main/java/com/diligrp/cashier/mall/model/MallBizOrder.java
| @@ -2,6 +2,7 @@ package com.diligrp.cashier.mall.model; | @@ -2,6 +2,7 @@ package com.diligrp.cashier.mall.model; | ||
| 2 | 2 | ||
| 3 | import com.diligrp.cashier.mall.domain.rtmall.co.AuthLoginCO; | 3 | import com.diligrp.cashier.mall.domain.rtmall.co.AuthLoginCO; |
| 4 | import com.diligrp.cashier.mall.domain.rtmall.co.OrderCO; | 4 | import com.diligrp.cashier.mall.domain.rtmall.co.OrderCO; |
| 5 | +import com.diligrp.cashier.mall.domain.rtmall.co.OrderStatusCallbackCO; | ||
| 5 | import com.diligrp.cashier.mall.type.OrderState; | 6 | import com.diligrp.cashier.mall.type.OrderState; |
| 6 | import com.diligrp.cashier.mall.type.RtmartState; | 7 | import com.diligrp.cashier.mall.type.RtmartState; |
| 7 | import com.diligrp.cashier.mall.util.MallSnowflakeKeyManager; | 8 | import com.diligrp.cashier.mall.util.MallSnowflakeKeyManager; |
| @@ -118,6 +119,11 @@ public class MallBizOrder extends BaseDO { | @@ -118,6 +119,11 @@ public class MallBizOrder extends BaseDO { | ||
| 118 | private Integer orderExpire; | 119 | private Integer orderExpire; |
| 119 | 120 | ||
| 120 | /** | 121 | /** |
| 122 | + * 修改人名称 | ||
| 123 | + */ | ||
| 124 | + private String modifierName; | ||
| 125 | + | ||
| 126 | + /** | ||
| 121 | * 订单地址信息 | 127 | * 订单地址信息 |
| 122 | */ | 128 | */ |
| 123 | private MallBizOrderAddress mallBizOrderAddress; | 129 | private MallBizOrderAddress mallBizOrderAddress; |
| @@ -268,6 +274,14 @@ public class MallBizOrder extends BaseDO { | @@ -268,6 +274,14 @@ public class MallBizOrder extends BaseDO { | ||
| 268 | this.orderExpire = orderExpire; | 274 | this.orderExpire = orderExpire; |
| 269 | } | 275 | } |
| 270 | 276 | ||
| 277 | + public String getModifierName() { | ||
| 278 | + return modifierName; | ||
| 279 | + } | ||
| 280 | + | ||
| 281 | + public void setModifierName(String modifierName) { | ||
| 282 | + this.modifierName = modifierName; | ||
| 283 | + } | ||
| 284 | + | ||
| 271 | public MallBizOrderAddress getMallBizOrderAddress() { | 285 | public MallBizOrderAddress getMallBizOrderAddress() { |
| 272 | return mallBizOrderAddress; | 286 | return mallBizOrderAddress; |
| 273 | } | 287 | } |
| @@ -327,4 +341,16 @@ public class MallBizOrder extends BaseDO { | @@ -327,4 +341,16 @@ public class MallBizOrder extends BaseDO { | ||
| 327 | }); | 341 | }); |
| 328 | return mallBizOrder; | 342 | return mallBizOrder; |
| 329 | } | 343 | } |
| 344 | + | ||
| 345 | + /** | ||
| 346 | + * ofUpdateState | ||
| 347 | + */ | ||
| 348 | + public MallBizOrder ofUpdateState(OrderStatusCallbackCO orderStatusCallback) { | ||
| 349 | + MallBizOrder update = new MallBizOrder(); | ||
| 350 | + update.setId(this.getId()); | ||
| 351 | + update.setState(OrderState.getCode(orderStatusCallback.getOrderStatus())); | ||
| 352 | + update.setModifierName(orderStatusCallback.getUserCode()); | ||
| 353 | + update.setVersion(this.getVersion()); | ||
| 354 | + return update; | ||
| 355 | + } | ||
| 330 | } | 356 | } |
cashier-mall/src/main/java/com/diligrp/cashier/mall/model/MallBizPayment.java
| 1 | package com.diligrp.cashier.mall.model; | 1 | package com.diligrp.cashier.mall.model; |
| 2 | 2 | ||
| 3 | import com.diligrp.cashier.mall.domain.rtmall.co.OrderCO; | 3 | import com.diligrp.cashier.mall.domain.rtmall.co.OrderCO; |
| 4 | +import com.diligrp.cashier.mall.domain.rtmall.vo.OrderPaymentVO; | ||
| 4 | import com.diligrp.cashier.mall.property.MallDynamicProperty; | 5 | import com.diligrp.cashier.mall.property.MallDynamicProperty; |
| 5 | import com.diligrp.cashier.mall.property.RtMallDynamicProperty; | 6 | import com.diligrp.cashier.mall.property.RtMallDynamicProperty; |
| 6 | import com.diligrp.cashier.mall.type.PayState; | 7 | import com.diligrp.cashier.mall.type.PayState; |
| @@ -103,6 +104,14 @@ public class MallBizPayment extends BaseDO { | @@ -103,6 +104,14 @@ public class MallBizPayment extends BaseDO { | ||
| 103 | */ | 104 | */ |
| 104 | private String paymentCallback; | 105 | private String paymentCallback; |
| 105 | 106 | ||
| 107 | + public MallBizPayment() { | ||
| 108 | + } | ||
| 109 | + | ||
| 110 | + public MallBizPayment(String orderId, String tradeId) { | ||
| 111 | + this.orderId = orderId; | ||
| 112 | + this.tradeId = tradeId; | ||
| 113 | + } | ||
| 114 | + | ||
| 106 | public static MallBizPayment of(final OrderCO orderCo, | 115 | public static MallBizPayment of(final OrderCO orderCo, |
| 107 | final MallBizOrder mallBizOrder) { | 116 | final MallBizOrder mallBizOrder) { |
| 108 | MallSnowflakeKeyManager snowflakeKeyManager = SpringContextUtils.getBean(MallSnowflakeKeyManager.class); | 117 | MallSnowflakeKeyManager snowflakeKeyManager = SpringContextUtils.getBean(MallSnowflakeKeyManager.class); |
| @@ -114,11 +123,12 @@ public class MallBizPayment extends BaseDO { | @@ -114,11 +123,12 @@ public class MallBizPayment extends BaseDO { | ||
| 114 | mallBizPayment.setOrderId(orderCo.getOrderId()); | 123 | mallBizPayment.setOrderId(orderCo.getOrderId()); |
| 115 | mallBizPayment.setTradeId(orderCo.getTradeId()); | 124 | mallBizPayment.setTradeId(orderCo.getTradeId()); |
| 116 | mallBizPayment.setPayFee(orderCo.getTotalAmount()); | 125 | mallBizPayment.setPayFee(orderCo.getTotalAmount()); |
| 126 | + mallBizPayment.setMchId(mallBizOrder.getMchId()); | ||
| 117 | 127 | ||
| 118 | // TODO 2025/12/29: 支付信息 | 128 | // TODO 2025/12/29: 支付信息 |
| 119 | mallBizPayment.setPayPaymentId("6666666666"); | 129 | mallBizPayment.setPayPaymentId("6666666666"); |
| 120 | String cashierUrl = SpringContextUtils.getBean(MallDynamicProperty.class).getUrl(); | 130 | String cashierUrl = SpringContextUtils.getBean(MallDynamicProperty.class).getUrl(); |
| 121 | - mallBizPayment.setCashierUrl(cashierUrl.concat("?payTradeNo=").concat(mallBizPayment.getPayTradeNo())); | 131 | + mallBizPayment.setCashierUrl(cashierUrl.concat("?outTradeNo=").concat(mallBizPayment.getPayTradeNo())); |
| 122 | 132 | ||
| 123 | RtMallDynamicProperty rtMallDynamicProperty = SpringContextUtils.getBean(RtMallDynamicProperty.class); | 133 | RtMallDynamicProperty rtMallDynamicProperty = SpringContextUtils.getBean(RtMallDynamicProperty.class); |
| 124 | RtMallDynamicProperty.AppSecretDynamicProperty property = rtMallDynamicProperty.getBySourceAndType(mallBizOrder.getSource(), mallBizOrder.getOrderType()); | 134 | RtMallDynamicProperty.AppSecretDynamicProperty property = rtMallDynamicProperty.getBySourceAndType(mallBizOrder.getSource(), mallBizOrder.getOrderType()); |
| @@ -261,4 +271,18 @@ public class MallBizPayment extends BaseDO { | @@ -261,4 +271,18 @@ public class MallBizPayment extends BaseDO { | ||
| 261 | public void setPaymentCallback(String paymentCallback) { | 271 | public void setPaymentCallback(String paymentCallback) { |
| 262 | this.paymentCallback = paymentCallback == null ? null : paymentCallback.trim(); | 272 | this.paymentCallback = paymentCallback == null ? null : paymentCallback.trim(); |
| 263 | } | 273 | } |
| 274 | + | ||
| 275 | + /** | ||
| 276 | + * ofOrderPaymentVO | ||
| 277 | + * | ||
| 278 | + */ | ||
| 279 | + public OrderPaymentVO ofOrderPaymentVO() { | ||
| 280 | + OrderPaymentVO orderPaymentVO = new OrderPaymentVO(); | ||
| 281 | + orderPaymentVO.setOutTradeNo(payTradeNo); | ||
| 282 | + orderPaymentVO.setPayStatus(payState); | ||
| 283 | + orderPaymentVO.setPayFee(payFee); | ||
| 284 | + orderPaymentVO.setPayTime(payTime); | ||
| 285 | + orderPaymentVO.setTransactionId(payPaymentId); | ||
| 286 | + return orderPaymentVO; | ||
| 287 | + } | ||
| 264 | } | 288 | } |
cashier-mall/src/main/java/com/diligrp/cashier/mall/model/MallBizRefund.java
| 1 | package com.diligrp.cashier.mall.model; | 1 | package com.diligrp.cashier.mall.model; |
| 2 | 2 | ||
| 3 | +import com.diligrp.cashier.mall.domain.rtmall.co.RefundCO; | ||
| 4 | +import com.diligrp.cashier.mall.property.RtMallDynamicProperty; | ||
| 3 | import com.diligrp.cashier.mall.type.RefundState; | 5 | import com.diligrp.cashier.mall.type.RefundState; |
| 6 | +import com.diligrp.cashier.mall.util.MallSnowflakeKeyManager; | ||
| 4 | import com.diligrp.cashier.shared.domain.BaseDO; | 7 | import com.diligrp.cashier.shared.domain.BaseDO; |
| 8 | +import com.diligrp.cashier.shared.util.SpringContextUtils; | ||
| 9 | +import com.diligrp.cashier.trade.type.SnowflakeKey; | ||
| 10 | +import org.springframework.beans.BeanUtils; | ||
| 5 | 11 | ||
| 6 | import java.time.LocalDateTime; | 12 | import java.time.LocalDateTime; |
| 13 | +import java.util.List; | ||
| 14 | +import java.util.Optional; | ||
| 7 | 15 | ||
| 8 | /** | 16 | /** |
| 9 | * MallBizRefund | 17 | * MallBizRefund |
| @@ -98,16 +106,26 @@ public class MallBizRefund extends BaseDO { | @@ -98,16 +106,26 @@ public class MallBizRefund extends BaseDO { | ||
| 98 | private String refundCallback; | 106 | private String refundCallback; |
| 99 | 107 | ||
| 100 | /** | 108 | /** |
| 109 | + * 创建人名称 | ||
| 110 | + */ | ||
| 111 | + private String createrName; | ||
| 112 | + | ||
| 113 | + /** | ||
| 101 | * 拒绝原因 | 114 | * 拒绝原因 |
| 102 | */ | 115 | */ |
| 103 | private String refuseReason; | 116 | private String refuseReason; |
| 104 | 117 | ||
| 118 | + /** | ||
| 119 | + * 退款商品列表 | ||
| 120 | + */ | ||
| 121 | + private List<MallBizRefundItem> refundItemList; | ||
| 122 | + | ||
| 105 | public String getRefundTradeNo() { | 123 | public String getRefundTradeNo() { |
| 106 | return refundTradeNo; | 124 | return refundTradeNo; |
| 107 | } | 125 | } |
| 108 | 126 | ||
| 109 | public void setRefundTradeNo(String refundTradeNo) { | 127 | public void setRefundTradeNo(String refundTradeNo) { |
| 110 | - this.refundTradeNo = refundTradeNo == null ? null : refundTradeNo.trim(); | 128 | + this.refundTradeNo = refundTradeNo; |
| 111 | } | 129 | } |
| 112 | 130 | ||
| 113 | public String getPayTradeNo() { | 131 | public String getPayTradeNo() { |
| @@ -115,7 +133,7 @@ public class MallBizRefund extends BaseDO { | @@ -115,7 +133,7 @@ public class MallBizRefund extends BaseDO { | ||
| 115 | } | 133 | } |
| 116 | 134 | ||
| 117 | public void setPayTradeNo(String payTradeNo) { | 135 | public void setPayTradeNo(String payTradeNo) { |
| 118 | - this.payTradeNo = payTradeNo == null ? null : payTradeNo.trim(); | 136 | + this.payTradeNo = payTradeNo; |
| 119 | } | 137 | } |
| 120 | 138 | ||
| 121 | public String getRefundBn() { | 139 | public String getRefundBn() { |
| @@ -123,7 +141,7 @@ public class MallBizRefund extends BaseDO { | @@ -123,7 +141,7 @@ public class MallBizRefund extends BaseDO { | ||
| 123 | } | 141 | } |
| 124 | 142 | ||
| 125 | public void setRefundBn(String refundBn) { | 143 | public void setRefundBn(String refundBn) { |
| 126 | - this.refundBn = refundBn == null ? null : refundBn.trim(); | 144 | + this.refundBn = refundBn; |
| 127 | } | 145 | } |
| 128 | 146 | ||
| 129 | public String getOrderId() { | 147 | public String getOrderId() { |
| @@ -131,7 +149,7 @@ public class MallBizRefund extends BaseDO { | @@ -131,7 +149,7 @@ public class MallBizRefund extends BaseDO { | ||
| 131 | } | 149 | } |
| 132 | 150 | ||
| 133 | public void setOrderId(String orderId) { | 151 | public void setOrderId(String orderId) { |
| 134 | - this.orderId = orderId == null ? null : orderId.trim(); | 152 | + this.orderId = orderId; |
| 135 | } | 153 | } |
| 136 | 154 | ||
| 137 | public String getTradeId() { | 155 | public String getTradeId() { |
| @@ -139,7 +157,7 @@ public class MallBizRefund extends BaseDO { | @@ -139,7 +157,7 @@ public class MallBizRefund extends BaseDO { | ||
| 139 | } | 157 | } |
| 140 | 158 | ||
| 141 | public void setTradeId(String tradeId) { | 159 | public void setTradeId(String tradeId) { |
| 142 | - this.tradeId = tradeId == null ? null : tradeId.trim(); | 160 | + this.tradeId = tradeId; |
| 143 | } | 161 | } |
| 144 | 162 | ||
| 145 | public String getRefundPaymentId() { | 163 | public String getRefundPaymentId() { |
| @@ -147,7 +165,7 @@ public class MallBizRefund extends BaseDO { | @@ -147,7 +165,7 @@ public class MallBizRefund extends BaseDO { | ||
| 147 | } | 165 | } |
| 148 | 166 | ||
| 149 | public void setRefundPaymentId(String refundPaymentId) { | 167 | public void setRefundPaymentId(String refundPaymentId) { |
| 150 | - this.refundPaymentId = refundPaymentId == null ? null : refundPaymentId.trim(); | 168 | + this.refundPaymentId = refundPaymentId; |
| 151 | } | 169 | } |
| 152 | 170 | ||
| 153 | public String getPayPaymentId() { | 171 | public String getPayPaymentId() { |
| @@ -155,7 +173,7 @@ public class MallBizRefund extends BaseDO { | @@ -155,7 +173,7 @@ public class MallBizRefund extends BaseDO { | ||
| 155 | } | 173 | } |
| 156 | 174 | ||
| 157 | public void setPayPaymentId(String payPaymentId) { | 175 | public void setPayPaymentId(String payPaymentId) { |
| 158 | - this.payPaymentId = payPaymentId == null ? null : payPaymentId.trim(); | 176 | + this.payPaymentId = payPaymentId; |
| 159 | } | 177 | } |
| 160 | 178 | ||
| 161 | public String getRefundCardNo() { | 179 | public String getRefundCardNo() { |
| @@ -163,7 +181,7 @@ public class MallBizRefund extends BaseDO { | @@ -163,7 +181,7 @@ public class MallBizRefund extends BaseDO { | ||
| 163 | } | 181 | } |
| 164 | 182 | ||
| 165 | public void setRefundCardNo(String refundCardNo) { | 183 | public void setRefundCardNo(String refundCardNo) { |
| 166 | - this.refundCardNo = refundCardNo == null ? null : refundCardNo.trim(); | 184 | + this.refundCardNo = refundCardNo; |
| 167 | } | 185 | } |
| 168 | 186 | ||
| 169 | public Long getRefundUserId() { | 187 | public Long getRefundUserId() { |
| @@ -179,7 +197,7 @@ public class MallBizRefund extends BaseDO { | @@ -179,7 +197,7 @@ public class MallBizRefund extends BaseDO { | ||
| 179 | } | 197 | } |
| 180 | 198 | ||
| 181 | public void setRefundUsername(String refundUsername) { | 199 | public void setRefundUsername(String refundUsername) { |
| 182 | - this.refundUsername = refundUsername == null ? null : refundUsername.trim(); | 200 | + this.refundUsername = refundUsername; |
| 183 | } | 201 | } |
| 184 | 202 | ||
| 185 | public Long getRefundAccountId() { | 203 | public Long getRefundAccountId() { |
| @@ -227,7 +245,7 @@ public class MallBizRefund extends BaseDO { | @@ -227,7 +245,7 @@ public class MallBizRefund extends BaseDO { | ||
| 227 | } | 245 | } |
| 228 | 246 | ||
| 229 | public void setRefundReason(String refundReason) { | 247 | public void setRefundReason(String refundReason) { |
| 230 | - this.refundReason = refundReason == null ? null : refundReason.trim(); | 248 | + this.refundReason = refundReason; |
| 231 | } | 249 | } |
| 232 | 250 | ||
| 233 | public String getRefundCallback() { | 251 | public String getRefundCallback() { |
| @@ -235,7 +253,15 @@ public class MallBizRefund extends BaseDO { | @@ -235,7 +253,15 @@ public class MallBizRefund extends BaseDO { | ||
| 235 | } | 253 | } |
| 236 | 254 | ||
| 237 | public void setRefundCallback(String refundCallback) { | 255 | public void setRefundCallback(String refundCallback) { |
| 238 | - this.refundCallback = refundCallback == null ? null : refundCallback.trim(); | 256 | + this.refundCallback = refundCallback; |
| 257 | + } | ||
| 258 | + | ||
| 259 | + public String getCreaterName() { | ||
| 260 | + return createrName; | ||
| 261 | + } | ||
| 262 | + | ||
| 263 | + public void setCreaterName(String createrName) { | ||
| 264 | + this.createrName = createrName; | ||
| 239 | } | 265 | } |
| 240 | 266 | ||
| 241 | public String getRefuseReason() { | 267 | public String getRefuseReason() { |
| @@ -243,6 +269,48 @@ public class MallBizRefund extends BaseDO { | @@ -243,6 +269,48 @@ public class MallBizRefund extends BaseDO { | ||
| 243 | } | 269 | } |
| 244 | 270 | ||
| 245 | public void setRefuseReason(String refuseReason) { | 271 | public void setRefuseReason(String refuseReason) { |
| 246 | - this.refuseReason = refuseReason == null ? null : refuseReason.trim(); | 272 | + this.refuseReason = refuseReason; |
| 273 | + } | ||
| 274 | + | ||
| 275 | + public List<MallBizRefundItem> getRefundItemList() { | ||
| 276 | + return refundItemList; | ||
| 277 | + } | ||
| 278 | + | ||
| 279 | + public void setRefundItemList(List<MallBizRefundItem> refundItemList) { | ||
| 280 | + this.refundItemList = refundItemList; | ||
| 281 | + } | ||
| 282 | + | ||
| 283 | + /** | ||
| 284 | + * of | ||
| 285 | + */ | ||
| 286 | + public static MallBizRefund of(final RefundCO refundCo, | ||
| 287 | + final MallBizOrder mallBizOrder, | ||
| 288 | + final MallBizPayment mallBizPayment) { | ||
| 289 | + MallSnowflakeKeyManager snowflakeKeyManager = SpringContextUtils.getBean(MallSnowflakeKeyManager.class); | ||
| 290 | + | ||
| 291 | + MallBizRefund mallBizRefund = new MallBizRefund(); | ||
| 292 | + mallBizRefund.setRefundTradeNo(snowflakeKeyManager.nextId(SnowflakeKey.MALL_BIZ_REFUND_ID).toString()); | ||
| 293 | + BeanUtils.copyProperties(refundCo, mallBizRefund); | ||
| 294 | + | ||
| 295 | + mallBizRefund.setTradeId(mallBizPayment.getTradeId()); | ||
| 296 | + mallBizRefund.setPayTradeNo(mallBizPayment.getPayTradeNo()); | ||
| 297 | + mallBizRefund.setPayPaymentId(mallBizPayment.getPayPaymentId()); | ||
| 298 | + | ||
| 299 | + // 回调地址 | ||
| 300 | + RtMallDynamicProperty rtMallDynamicProperty = SpringContextUtils.getBean(RtMallDynamicProperty.class); | ||
| 301 | + RtMallDynamicProperty.AppSecretDynamicProperty property = rtMallDynamicProperty.getBySourceAndType(mallBizOrder.getSource(), mallBizOrder.getOrderType()); | ||
| 302 | + mallBizRefund.setRefundCallback(property.getCallbackDomain()); | ||
| 303 | + | ||
| 304 | + // 退款商品明细 | ||
| 305 | + Optional.ofNullable(refundCo.getReturnItemList()) | ||
| 306 | + .ifPresent(items -> { | ||
| 307 | + List<MallBizRefundItem> list = items.stream().map(item -> { | ||
| 308 | + MallBizRefundItem mallBizRefundItem = new MallBizRefundItem(); | ||
| 309 | + BeanUtils.copyProperties(item, mallBizRefundItem); | ||
| 310 | + return mallBizRefundItem; | ||
| 311 | + }).toList(); | ||
| 312 | + mallBizRefund.setRefundItemList(list); | ||
| 313 | + }); | ||
| 314 | + return mallBizRefund; | ||
| 247 | } | 315 | } |
| 248 | } | 316 | } |
cashier-mall/src/main/java/com/diligrp/cashier/mall/service/biz/MallBizOrderService.java
| @@ -2,8 +2,11 @@ package com.diligrp.cashier.mall.service.biz; | @@ -2,8 +2,11 @@ package com.diligrp.cashier.mall.service.biz; | ||
| 2 | 2 | ||
| 3 | import com.diligrp.cashier.mall.domain.rtmall.co.OrderCO; | 3 | import com.diligrp.cashier.mall.domain.rtmall.co.OrderCO; |
| 4 | import com.diligrp.cashier.mall.domain.rtmall.co.OrderInfoCO; | 4 | import com.diligrp.cashier.mall.domain.rtmall.co.OrderInfoCO; |
| 5 | +import com.diligrp.cashier.mall.domain.rtmall.co.OrderStatusCallbackCO; | ||
| 5 | import com.diligrp.cashier.mall.domain.rtmall.vo.OrderPaymentVO; | 6 | import com.diligrp.cashier.mall.domain.rtmall.vo.OrderPaymentVO; |
| 7 | +import com.diligrp.cashier.mall.domain.rtmall.vo.OrderStatusCallbackVO; | ||
| 6 | import com.diligrp.cashier.mall.domain.rtmall.vo.OrderSuccessVO; | 8 | import com.diligrp.cashier.mall.domain.rtmall.vo.OrderSuccessVO; |
| 9 | +import com.diligrp.cashier.mall.model.MallBizOrder; | ||
| 7 | 10 | ||
| 8 | /** | 11 | /** |
| 9 | * @ClassName MallBizOrderService.java | 12 | * @ClassName MallBizOrderService.java |
| @@ -22,4 +25,14 @@ public interface MallBizOrderService { | @@ -22,4 +25,14 @@ public interface MallBizOrderService { | ||
| 22 | * info | 25 | * info |
| 23 | */ | 26 | */ |
| 24 | OrderPaymentVO info(OrderInfoCO orderInfoCo); | 27 | OrderPaymentVO info(OrderInfoCO orderInfoCo); |
| 28 | + | ||
| 29 | + /** | ||
| 30 | + * statusCallback | ||
| 31 | + */ | ||
| 32 | + OrderStatusCallbackVO statusCallback(OrderStatusCallbackCO orderStatusCallback); | ||
| 33 | + | ||
| 34 | + /** | ||
| 35 | + * getByOrderId | ||
| 36 | + */ | ||
| 37 | + MallBizOrder getByOrderId(String orderId); | ||
| 25 | } | 38 | } |
cashier-mall/src/main/java/com/diligrp/cashier/mall/service/biz/MallBizPaymentService.java
| 1 | package com.diligrp.cashier.mall.service.biz; | 1 | package com.diligrp.cashier.mall.service.biz; |
| 2 | 2 | ||
| 3 | +import com.diligrp.cashier.mall.domain.rtmall.vo.OrderPaymentVO; | ||
| 3 | import com.diligrp.cashier.mall.model.MallBizPayment; | 4 | import com.diligrp.cashier.mall.model.MallBizPayment; |
| 4 | 5 | ||
| 5 | /** | 6 | /** |
| @@ -11,4 +12,6 @@ import com.diligrp.cashier.mall.model.MallBizPayment; | @@ -11,4 +12,6 @@ import com.diligrp.cashier.mall.model.MallBizPayment; | ||
| 11 | */ | 12 | */ |
| 12 | public interface MallBizPaymentService { | 13 | public interface MallBizPaymentService { |
| 13 | void save(MallBizPayment mallBizPayment); | 14 | void save(MallBizPayment mallBizPayment); |
| 15 | + | ||
| 16 | + MallBizPayment paymentInfo(MallBizPayment mallBizPayment); | ||
| 14 | } | 17 | } |
cashier-mall/src/main/java/com/diligrp/cashier/mall/service/biz/MallBizRefundService.java
0 → 100644
| 1 | +package com.diligrp.cashier.mall.service.biz; | ||
| 2 | + | ||
| 3 | +import com.diligrp.cashier.mall.domain.rtmall.co.RefundCO; | ||
| 4 | +import com.diligrp.cashier.mall.domain.rtmall.vo.RefundSuccessVO; | ||
| 5 | + | ||
| 6 | +/** | ||
| 7 | + * @ClassName MallBizRefundService.java | ||
| 8 | + * @author dengwei | ||
| 9 | + * @version 1.0.0 | ||
| 10 | + * @Description MallBizRefundService | ||
| 11 | + */ | ||
| 12 | +public interface MallBizRefundService { | ||
| 13 | + RefundSuccessVO refund(RefundCO refundCo); | ||
| 14 | +} |
cashier-mall/src/main/java/com/diligrp/cashier/mall/service/biz/impl/MallBizOrderServiceImpl.java
| @@ -7,7 +7,9 @@ import com.diligrp.cashier.mall.dao.MallBizOrderItemDao; | @@ -7,7 +7,9 @@ import com.diligrp.cashier.mall.dao.MallBizOrderItemDao; | ||
| 7 | import com.diligrp.cashier.mall.domain.rtmall.co.AuthLoginCO; | 7 | import com.diligrp.cashier.mall.domain.rtmall.co.AuthLoginCO; |
| 8 | import com.diligrp.cashier.mall.domain.rtmall.co.OrderCO; | 8 | import com.diligrp.cashier.mall.domain.rtmall.co.OrderCO; |
| 9 | import com.diligrp.cashier.mall.domain.rtmall.co.OrderInfoCO; | 9 | import com.diligrp.cashier.mall.domain.rtmall.co.OrderInfoCO; |
| 10 | +import com.diligrp.cashier.mall.domain.rtmall.co.OrderStatusCallbackCO; | ||
| 10 | import com.diligrp.cashier.mall.domain.rtmall.vo.OrderPaymentVO; | 11 | import com.diligrp.cashier.mall.domain.rtmall.vo.OrderPaymentVO; |
| 12 | +import com.diligrp.cashier.mall.domain.rtmall.vo.OrderStatusCallbackVO; | ||
| 11 | import com.diligrp.cashier.mall.domain.rtmall.vo.OrderSuccessVO; | 13 | import com.diligrp.cashier.mall.domain.rtmall.vo.OrderSuccessVO; |
| 12 | import com.diligrp.cashier.mall.exception.RtMartMallException; | 14 | import com.diligrp.cashier.mall.exception.RtMartMallException; |
| 13 | import com.diligrp.cashier.mall.model.MallBizOrder; | 15 | import com.diligrp.cashier.mall.model.MallBizOrder; |
| @@ -15,12 +17,11 @@ import com.diligrp.cashier.mall.model.MallBizPayment; | @@ -15,12 +17,11 @@ import com.diligrp.cashier.mall.model.MallBizPayment; | ||
| 15 | import com.diligrp.cashier.mall.service.biz.MallBizOrderService; | 17 | import com.diligrp.cashier.mall.service.biz.MallBizOrderService; |
| 16 | import com.diligrp.cashier.mall.service.biz.MallBizPaymentService; | 18 | import com.diligrp.cashier.mall.service.biz.MallBizPaymentService; |
| 17 | import com.diligrp.cashier.mall.type.RtMarkErrorCode; | 19 | import com.diligrp.cashier.mall.type.RtMarkErrorCode; |
| 18 | -import com.diligrp.cashier.mall.util.MallSnowflakeKeyManager; | ||
| 19 | import com.diligrp.cashier.shared.util.JsonUtils; | 20 | import com.diligrp.cashier.shared.util.JsonUtils; |
| 20 | -import com.diligrp.cashier.trade.type.SnowflakeKey; | ||
| 21 | import jakarta.annotation.Resource; | 21 | import jakarta.annotation.Resource; |
| 22 | import org.slf4j.Logger; | 22 | import org.slf4j.Logger; |
| 23 | import org.slf4j.LoggerFactory; | 23 | import org.slf4j.LoggerFactory; |
| 24 | +import org.springframework.beans.BeanUtils; | ||
| 24 | import org.springframework.data.redis.core.RedisTemplate; | 25 | import org.springframework.data.redis.core.RedisTemplate; |
| 25 | import org.springframework.stereotype.Service; | 26 | import org.springframework.stereotype.Service; |
| 26 | import org.springframework.transaction.annotation.Transactional; | 27 | import org.springframework.transaction.annotation.Transactional; |
| @@ -42,8 +43,6 @@ public class MallBizOrderServiceImpl implements MallBizOrderService { | @@ -42,8 +43,6 @@ public class MallBizOrderServiceImpl implements MallBizOrderService { | ||
| 42 | @Resource | 43 | @Resource |
| 43 | private RedisTemplate<String, Object> redisTemplate; | 44 | private RedisTemplate<String, Object> redisTemplate; |
| 44 | @Resource | 45 | @Resource |
| 45 | - private MallSnowflakeKeyManager mallSnowflakeKeyManager; | ||
| 46 | - @Resource | ||
| 47 | private MallBizPaymentService mallBizPaymentService; | 46 | private MallBizPaymentService mallBizPaymentService; |
| 48 | @Resource | 47 | @Resource |
| 49 | private MallBizOrderDao mallBizOrderDao; | 48 | private MallBizOrderDao mallBizOrderDao; |
| @@ -69,7 +68,7 @@ public class MallBizOrderServiceImpl implements MallBizOrderService { | @@ -69,7 +68,7 @@ public class MallBizOrderServiceImpl implements MallBizOrderService { | ||
| 69 | 68 | ||
| 70 | // save | 69 | // save |
| 71 | commonCreate(mallBizOrder, mallBizPayment); | 70 | commonCreate(mallBizOrder, mallBizPayment); |
| 72 | - return new OrderSuccessVO(mallSnowflakeKeyManager.nextId(SnowflakeKey.MALL_BIZ_ORDER_ID).toString(), "https://www.baidu.com"); | 71 | + return new OrderSuccessVO(mallBizPayment.getPayTradeNo(), mallBizPayment.getCashierUrl()); |
| 73 | } | 72 | } |
| 74 | 73 | ||
| 75 | /** | 74 | /** |
| @@ -78,7 +77,31 @@ public class MallBizOrderServiceImpl implements MallBizOrderService { | @@ -78,7 +77,31 @@ public class MallBizOrderServiceImpl implements MallBizOrderService { | ||
| 78 | */ | 77 | */ |
| 79 | @Override | 78 | @Override |
| 80 | public OrderPaymentVO info(OrderInfoCO orderInfoCo) { | 79 | public OrderPaymentVO info(OrderInfoCO orderInfoCo) { |
| 81 | - return null; | 80 | + MallBizPayment mallBizPayment = new MallBizPayment(); |
| 81 | + BeanUtils.copyProperties(orderInfoCo, mallBizPayment); | ||
| 82 | + mallBizPayment = mallBizPaymentService.paymentInfo(mallBizPayment); | ||
| 83 | + return mallBizPayment.ofOrderPaymentVO(); | ||
| 84 | + } | ||
| 85 | + | ||
| 86 | + /** | ||
| 87 | + * statusCallback | ||
| 88 | + */ | ||
| 89 | + @Override | ||
| 90 | + @Transactional(rollbackFor = {Exception.class}) | ||
| 91 | + public OrderStatusCallbackVO statusCallback(OrderStatusCallbackCO orderStatusCallback) { | ||
| 92 | + // update order status | ||
| 93 | + MallBizOrder mallBizOrder = getByOrderId(orderStatusCallback.getOrderId()); | ||
| 94 | + | ||
| 95 | + MallBizOrder update = mallBizOrder.ofUpdateState(orderStatusCallback); | ||
| 96 | + int num = mallBizOrderDao.updateByPrimaryKeySelective(update); | ||
| 97 | + if (num < 1) { | ||
| 98 | + throw new RtMartMallException(RtMarkErrorCode.E5004); | ||
| 99 | + } | ||
| 100 | + | ||
| 101 | + MallBizPayment mallBizPayment = new MallBizPayment(); | ||
| 102 | + BeanUtils.copyProperties(orderStatusCallback, mallBizPayment); | ||
| 103 | + mallBizPayment = mallBizPaymentService.paymentInfo(mallBizPayment); | ||
| 104 | + return new OrderStatusCallbackVO(mallBizPayment.getPayTradeNo()); | ||
| 82 | } | 105 | } |
| 83 | 106 | ||
| 84 | /** | 107 | /** |
| @@ -111,4 +134,17 @@ public class MallBizOrderServiceImpl implements MallBizOrderService { | @@ -111,4 +134,17 @@ public class MallBizOrderServiceImpl implements MallBizOrderService { | ||
| 111 | 134 | ||
| 112 | Optional.ofNullable(mallBizPayment).ifPresent(mallBizPaymentService::save); | 135 | Optional.ofNullable(mallBizPayment).ifPresent(mallBizPaymentService::save); |
| 113 | } | 136 | } |
| 137 | + | ||
| 138 | + /** | ||
| 139 | + * getByOrderId | ||
| 140 | + * | ||
| 141 | + */ | ||
| 142 | + @Override | ||
| 143 | + public MallBizOrder getByOrderId(String orderId) { | ||
| 144 | + MallBizOrder mallBizOrder = mallBizOrderDao.getByOrderId(orderId); | ||
| 145 | + if (Objects.isNull(mallBizOrder)) { | ||
| 146 | + throw new RtMartMallException(RtMarkErrorCode.E5004); | ||
| 147 | + } | ||
| 148 | + return mallBizOrder; | ||
| 149 | + } | ||
| 114 | } | 150 | } |
cashier-mall/src/main/java/com/diligrp/cashier/mall/service/biz/impl/MallBizPaymentServiceImpl.java
| 1 | package com.diligrp.cashier.mall.service.biz.impl; | 1 | package com.diligrp.cashier.mall.service.biz.impl; |
| 2 | 2 | ||
| 3 | import com.diligrp.cashier.mall.dao.MallBizPaymentDao; | 3 | import com.diligrp.cashier.mall.dao.MallBizPaymentDao; |
| 4 | +import com.diligrp.cashier.mall.domain.rtmall.co.OrderInfoCO; | ||
| 5 | +import com.diligrp.cashier.mall.domain.rtmall.vo.OrderPaymentVO; | ||
| 4 | import com.diligrp.cashier.mall.model.MallBizPayment; | 6 | import com.diligrp.cashier.mall.model.MallBizPayment; |
| 5 | import com.diligrp.cashier.mall.service.biz.MallBizPaymentService; | 7 | import com.diligrp.cashier.mall.service.biz.MallBizPaymentService; |
| 6 | import jakarta.annotation.Resource; | 8 | import jakarta.annotation.Resource; |
| 7 | import org.slf4j.Logger; | 9 | import org.slf4j.Logger; |
| 8 | import org.slf4j.LoggerFactory; | 10 | import org.slf4j.LoggerFactory; |
| 11 | +import org.springframework.beans.BeanUtils; | ||
| 9 | import org.springframework.stereotype.Service; | 12 | import org.springframework.stereotype.Service; |
| 10 | import org.springframework.transaction.annotation.Transactional; | 13 | import org.springframework.transaction.annotation.Transactional; |
| 11 | 14 | ||
| @@ -23,9 +26,22 @@ public class MallBizPaymentServiceImpl implements MallBizPaymentService { | @@ -23,9 +26,22 @@ public class MallBizPaymentServiceImpl implements MallBizPaymentService { | ||
| 23 | @Resource | 26 | @Resource |
| 24 | private MallBizPaymentDao mallBizPaymentDao; | 27 | private MallBizPaymentDao mallBizPaymentDao; |
| 25 | 28 | ||
| 29 | + /** | ||
| 30 | + * save | ||
| 31 | + * | ||
| 32 | + */ | ||
| 26 | @Override | 33 | @Override |
| 27 | @Transactional(rollbackFor = {Exception.class}) | 34 | @Transactional(rollbackFor = {Exception.class}) |
| 28 | public void save(MallBizPayment mallBizPayment) { | 35 | public void save(MallBizPayment mallBizPayment) { |
| 29 | mallBizPaymentDao.insertSelective(mallBizPayment); | 36 | mallBizPaymentDao.insertSelective(mallBizPayment); |
| 30 | } | 37 | } |
| 38 | + | ||
| 39 | + /** | ||
| 40 | + * paymentInfo | ||
| 41 | + * | ||
| 42 | + */ | ||
| 43 | + @Override | ||
| 44 | + public MallBizPayment paymentInfo(MallBizPayment mallBizPayment) { | ||
| 45 | + return mallBizPaymentDao.getMallBizPayment(mallBizPayment); | ||
| 46 | + } | ||
| 31 | } | 47 | } |
cashier-mall/src/main/java/com/diligrp/cashier/mall/service/biz/impl/MallBizRefundServiceImpl.java
0 → 100644
| 1 | +package com.diligrp.cashier.mall.service.biz.impl; | ||
| 2 | + | ||
| 3 | +import com.diligrp.cashier.mall.context.MallInitializeContext; | ||
| 4 | +import com.diligrp.cashier.mall.dao.MallBizOrderDao; | ||
| 5 | +import com.diligrp.cashier.mall.dao.MallBizRefundDao; | ||
| 6 | +import com.diligrp.cashier.mall.dao.MallBizRefundItemDao; | ||
| 7 | +import com.diligrp.cashier.mall.domain.rtmall.co.RefundCO; | ||
| 8 | +import com.diligrp.cashier.mall.domain.rtmall.vo.RefundSuccessVO; | ||
| 9 | +import com.diligrp.cashier.mall.exception.RtMartMallException; | ||
| 10 | +import com.diligrp.cashier.mall.model.MallBizOrder; | ||
| 11 | +import com.diligrp.cashier.mall.model.MallBizPayment; | ||
| 12 | +import com.diligrp.cashier.mall.model.MallBizRefund; | ||
| 13 | +import com.diligrp.cashier.mall.service.biz.MallBizPaymentService; | ||
| 14 | +import com.diligrp.cashier.mall.service.biz.MallBizRefundService; | ||
| 15 | +import com.diligrp.cashier.mall.type.RtMarkErrorCode; | ||
| 16 | +import jakarta.annotation.Resource; | ||
| 17 | +import org.slf4j.Logger; | ||
| 18 | +import org.slf4j.LoggerFactory; | ||
| 19 | +import org.springframework.stereotype.Service; | ||
| 20 | +import org.springframework.transaction.annotation.Transactional; | ||
| 21 | + | ||
| 22 | +import java.util.Objects; | ||
| 23 | + | ||
| 24 | +/** | ||
| 25 | + * @ClassName MallBizRefundServiceImpl.java | ||
| 26 | + * @author dengwei | ||
| 27 | + * @version 1.0.0 | ||
| 28 | + * @Description MallBizRefundServiceImpl | ||
| 29 | + */ | ||
| 30 | +@Service | ||
| 31 | +public class MallBizRefundServiceImpl implements MallBizRefundService { | ||
| 32 | + private static final Logger log = LoggerFactory.getLogger(MallBizRefundServiceImpl.class); | ||
| 33 | + | ||
| 34 | + @Resource | ||
| 35 | + private MallBizOrderDao mallBizOrderDao; | ||
| 36 | + @Resource | ||
| 37 | + private MallBizPaymentService mallBizPaymentService; | ||
| 38 | + @Resource | ||
| 39 | + private MallBizRefundDao mallBizRefundDao; | ||
| 40 | + | ||
| 41 | + /** | ||
| 42 | + * refund | ||
| 43 | + * 退款成功回调 | ||
| 44 | + */ | ||
| 45 | + @Override | ||
| 46 | + @Transactional(rollbackFor = {Exception.class}) | ||
| 47 | + public RefundSuccessVO refund(RefundCO refundCo) { | ||
| 48 | + MallBizOrder mallBizOrder = mallBizOrderDao.getByOrderId(refundCo.getOrderId()); | ||
| 49 | + MallBizRefund mallBizRefund = MallInitializeContext.getBySource(mallBizOrder.getSource()).refund(refundCo); | ||
| 50 | + return new RefundSuccessVO(mallBizRefund.getPayTradeNo(), mallBizRefund.getRefundTradeNo()); | ||
| 51 | + } | ||
| 52 | + | ||
| 53 | + /** | ||
| 54 | + * getPayment | ||
| 55 | + */ | ||
| 56 | + private MallBizPayment getPayment(RefundCO refundCo) { | ||
| 57 | + MallBizPayment mallBizPayment = mallBizPaymentService.paymentInfo(new MallBizPayment(refundCo.getOrderId(), null)); | ||
| 58 | + if (Objects.isNull(mallBizPayment)) { | ||
| 59 | + throw new RtMartMallException(RtMarkErrorCode.E5004); | ||
| 60 | + } | ||
| 61 | + return mallBizPayment; | ||
| 62 | + } | ||
| 63 | +} |
cashier-mall/src/main/java/com/diligrp/cashier/mall/service/paychannel/AbstractPayChannel.java
| @@ -8,7 +8,7 @@ import org.slf4j.LoggerFactory; | @@ -8,7 +8,7 @@ import org.slf4j.LoggerFactory; | ||
| 8 | * @author dengwei | 8 | * @author dengwei |
| 9 | * @version 1.0.0 | 9 | * @version 1.0.0 |
| 10 | * @Description AbstractPayChannel | 10 | * @Description AbstractPayChannel |
| 11 | - * @date 2025-12-25 17:07 | 11 | + * 支付渠道抽象层 |
| 12 | */ | 12 | */ |
| 13 | public abstract class AbstractPayChannel { | 13 | public abstract class AbstractPayChannel { |
| 14 | protected final Logger log = LoggerFactory.getLogger(getClass()); | 14 | protected final Logger log = LoggerFactory.getLogger(getClass()); |
cashier-mall/src/main/java/com/diligrp/cashier/mall/service/paychannel/CardPayChannel.java
| 1 | package com.diligrp.cashier.mall.service.paychannel; | 1 | package com.diligrp.cashier.mall.service.paychannel; |
| 2 | 2 | ||
| 3 | +import com.diligrp.cashier.mall.type.PaymentChanel; | ||
| 3 | import org.springframework.stereotype.Component; | 4 | import org.springframework.stereotype.Component; |
| 4 | 5 | ||
| 5 | /** | 6 | /** |
| @@ -7,12 +8,12 @@ import org.springframework.stereotype.Component; | @@ -7,12 +8,12 @@ import org.springframework.stereotype.Component; | ||
| 7 | * @author dengwei | 8 | * @author dengwei |
| 8 | * @version 1.0.0 | 9 | * @version 1.0.0 |
| 9 | * @Description CardPayChannel | 10 | * @Description CardPayChannel |
| 10 | - * @date 2025-12-25 17:08 | 11 | + * 园区卡支付渠道 |
| 11 | */ | 12 | */ |
| 12 | @Component | 13 | @Component |
| 13 | public class CardPayChannel extends AbstractPayChannel { | 14 | public class CardPayChannel extends AbstractPayChannel { |
| 14 | @Override | 15 | @Override |
| 15 | public Integer getPayChannel() { | 16 | public Integer getPayChannel() { |
| 16 | - return 0; | 17 | + return PaymentChanel.PARK_CARD.getCode(); |
| 17 | } | 18 | } |
| 18 | } | 19 | } |
cashier-mall/src/main/java/com/diligrp/cashier/mall/service/paychannel/WeChatPayChannel.java
| 1 | package com.diligrp.cashier.mall.service.paychannel; | 1 | package com.diligrp.cashier.mall.service.paychannel; |
| 2 | 2 | ||
| 3 | +import com.diligrp.cashier.mall.type.PaymentChanel; | ||
| 3 | import org.springframework.stereotype.Component; | 4 | import org.springframework.stereotype.Component; |
| 4 | 5 | ||
| 5 | /** | 6 | /** |
| @@ -7,12 +8,12 @@ import org.springframework.stereotype.Component; | @@ -7,12 +8,12 @@ import org.springframework.stereotype.Component; | ||
| 7 | * @author dengwei | 8 | * @author dengwei |
| 8 | * @version 1.0.0 | 9 | * @version 1.0.0 |
| 9 | * @Description WeChatPayChannel | 10 | * @Description WeChatPayChannel |
| 10 | - * @date 2025-12-25 17:08 | 11 | + * 微信支付渠道 |
| 11 | */ | 12 | */ |
| 12 | @Component | 13 | @Component |
| 13 | public class WeChatPayChannel extends AbstractPayChannel { | 14 | public class WeChatPayChannel extends AbstractPayChannel { |
| 14 | @Override | 15 | @Override |
| 15 | public Integer getPayChannel() { | 16 | public Integer getPayChannel() { |
| 16 | - return 1; | 17 | + return PaymentChanel.WECHAT.getCode(); |
| 17 | } | 18 | } |
| 18 | } | 19 | } |
cashier-mall/src/main/java/com/diligrp/cashier/mall/service/sourcechannel/AbstractChannel.java renamed to cashier-mall/src/main/java/com/diligrp/cashier/mall/service/sourcechannel/AbstractSourceChannel.java
| @@ -2,16 +2,29 @@ package com.diligrp.cashier.mall.service.sourcechannel; | @@ -2,16 +2,29 @@ package com.diligrp.cashier.mall.service.sourcechannel; | ||
| 2 | 2 | ||
| 3 | import cn.hutool.core.util.IdUtil; | 3 | import cn.hutool.core.util.IdUtil; |
| 4 | import com.diligrp.cashier.mall.MallConstants; | 4 | import com.diligrp.cashier.mall.MallConstants; |
| 5 | +import com.diligrp.cashier.mall.dao.MallBizOrderDao; | ||
| 6 | +import com.diligrp.cashier.mall.dao.MallBizRefundDao; | ||
| 7 | +import com.diligrp.cashier.mall.dao.MallBizRefundItemDao; | ||
| 5 | import com.diligrp.cashier.mall.domain.rtmall.co.AuthLoginCO; | 8 | import com.diligrp.cashier.mall.domain.rtmall.co.AuthLoginCO; |
| 9 | +import com.diligrp.cashier.mall.domain.rtmall.co.RefundCO; | ||
| 6 | import com.diligrp.cashier.mall.domain.rtmall.vo.UserInfoVO; | 10 | import com.diligrp.cashier.mall.domain.rtmall.vo.UserInfoVO; |
| 11 | +import com.diligrp.cashier.mall.exception.RtMartMallException; | ||
| 12 | +import com.diligrp.cashier.mall.model.MallBizOrder; | ||
| 13 | +import com.diligrp.cashier.mall.model.MallBizPayment; | ||
| 14 | +import com.diligrp.cashier.mall.model.MallBizRefund; | ||
| 7 | import com.diligrp.cashier.mall.property.RtMallDynamicProperty; | 15 | import com.diligrp.cashier.mall.property.RtMallDynamicProperty; |
| 16 | +import com.diligrp.cashier.mall.service.biz.MallBizPaymentService; | ||
| 17 | +import com.diligrp.cashier.mall.type.RtMarkErrorCode; | ||
| 8 | import com.diligrp.cashier.shared.util.DateUtils; | 18 | import com.diligrp.cashier.shared.util.DateUtils; |
| 9 | import com.diligrp.cashier.shared.util.JsonUtils; | 19 | import com.diligrp.cashier.shared.util.JsonUtils; |
| 10 | import jakarta.annotation.Resource; | 20 | import jakarta.annotation.Resource; |
| 11 | import org.slf4j.Logger; | 21 | import org.slf4j.Logger; |
| 12 | import org.slf4j.LoggerFactory; | 22 | import org.slf4j.LoggerFactory; |
| 13 | import org.springframework.data.redis.core.RedisTemplate; | 23 | import org.springframework.data.redis.core.RedisTemplate; |
| 24 | +import org.springframework.transaction.annotation.Transactional; | ||
| 14 | 25 | ||
| 26 | +import java.util.Objects; | ||
| 27 | +import java.util.Optional; | ||
| 15 | import java.util.concurrent.TimeUnit; | 28 | import java.util.concurrent.TimeUnit; |
| 16 | 29 | ||
| 17 | /** | 30 | /** |
| @@ -19,15 +32,24 @@ import java.util.concurrent.TimeUnit; | @@ -19,15 +32,24 @@ import java.util.concurrent.TimeUnit; | ||
| 19 | * @author dengwei | 32 | * @author dengwei |
| 20 | * @version 1.0.0 | 33 | * @version 1.0.0 |
| 21 | * @Description AbstractChannel | 34 | * @Description AbstractChannel |
| 35 | + * 对接收银台订单来源抽象 | ||
| 22 | * @date 2025-12-25 11:19 | 36 | * @date 2025-12-25 11:19 |
| 23 | */ | 37 | */ |
| 24 | -public abstract class AbstractChannel { | ||
| 25 | - private static final Logger log = LoggerFactory.getLogger(AbstractChannel.class); | 38 | +public abstract class AbstractSourceChannel { |
| 39 | + private static final Logger log = LoggerFactory.getLogger(AbstractSourceChannel.class); | ||
| 26 | 40 | ||
| 27 | @Resource | 41 | @Resource |
| 28 | protected RtMallDynamicProperty rtMallDynamicProperty; | 42 | protected RtMallDynamicProperty rtMallDynamicProperty; |
| 29 | @Resource | 43 | @Resource |
| 30 | protected RedisTemplate<String, Object> redisTemplate; | 44 | protected RedisTemplate<String, Object> redisTemplate; |
| 45 | + @Resource | ||
| 46 | + protected MallBizOrderDao mallBizOrderDao; | ||
| 47 | + @Resource | ||
| 48 | + protected MallBizPaymentService mallBizPaymentService; | ||
| 49 | + @Resource | ||
| 50 | + protected MallBizRefundDao mallBizRefundDao; | ||
| 51 | + @Resource | ||
| 52 | + protected MallBizRefundItemDao mallBizRefundItemDao; | ||
| 31 | 53 | ||
| 32 | /** | 54 | /** |
| 33 | * authLogin | 55 | * authLogin |
| @@ -65,6 +87,21 @@ public abstract class AbstractChannel { | @@ -65,6 +87,21 @@ public abstract class AbstractChannel { | ||
| 65 | } | 87 | } |
| 66 | 88 | ||
| 67 | /** | 89 | /** |
| 90 | + * refund | ||
| 91 | + */ | ||
| 92 | + @Transactional(rollbackFor = {Exception.class}) | ||
| 93 | + public MallBizRefund refund(RefundCO refundCo) { | ||
| 94 | + MallBizOrder mallBizOrder = mallBizOrderDao.getByOrderId(refundCo.getOrderId()); | ||
| 95 | + MallBizPayment mallBizPayment = getPayment(refundCo); | ||
| 96 | + | ||
| 97 | + // TODO 2025/12/30: 调用支付完善信息 | ||
| 98 | + MallBizRefund refund = MallBizRefund.of(refundCo, mallBizOrder, mallBizPayment); | ||
| 99 | + | ||
| 100 | + save(refund); | ||
| 101 | + return refund; | ||
| 102 | + } | ||
| 103 | + | ||
| 104 | + /** | ||
| 68 | * 渠道 | 105 | * 渠道 |
| 69 | */ | 106 | */ |
| 70 | public abstract Integer source(); | 107 | public abstract Integer source(); |
| @@ -74,5 +111,32 @@ public abstract class AbstractChannel { | @@ -74,5 +111,32 @@ public abstract class AbstractChannel { | ||
| 74 | */ | 111 | */ |
| 75 | public abstract String authUrl(AuthLoginCO authLogin, String token, long timestamp); | 112 | public abstract String authUrl(AuthLoginCO authLogin, String token, long timestamp); |
| 76 | 113 | ||
| 114 | + /** | ||
| 115 | + * userInfoChannel | ||
| 116 | + */ | ||
| 77 | public abstract void userInfoChannel(UserInfoVO authLogin, RtMallDynamicProperty.AppSecretDynamicProperty userInfoVO); | 117 | public abstract void userInfoChannel(UserInfoVO authLogin, RtMallDynamicProperty.AppSecretDynamicProperty userInfoVO); |
| 118 | + | ||
| 119 | + /** | ||
| 120 | + * getPayment | ||
| 121 | + */ | ||
| 122 | + private MallBizPayment getPayment(RefundCO refundCo) { | ||
| 123 | + MallBizPayment mallBizPayment = mallBizPaymentService.paymentInfo(new MallBizPayment(refundCo.getOrderId(), null)); | ||
| 124 | + if (Objects.isNull(mallBizPayment)) { | ||
| 125 | + throw new RtMartMallException(RtMarkErrorCode.E5004); | ||
| 126 | + } | ||
| 127 | + return mallBizPayment; | ||
| 128 | + } | ||
| 129 | + | ||
| 130 | + /** | ||
| 131 | + * save | ||
| 132 | + */ | ||
| 133 | + private void save(MallBizRefund refund) { | ||
| 134 | + mallBizRefundDao.insertSelective(refund); | ||
| 135 | + // 退款商品明细 | ||
| 136 | + Optional.ofNullable(refund.getRefundItemList()) | ||
| 137 | + .ifPresent(items -> { | ||
| 138 | + items.forEach(item -> item.setBizRefundId(refund.getId())); | ||
| 139 | + mallBizRefundItemDao.batchInsert(items); | ||
| 140 | + }); | ||
| 141 | + } | ||
| 78 | } | 142 | } |
cashier-mall/src/main/java/com/diligrp/cashier/mall/service/sourcechannel/RtMallChannel.java
| @@ -18,10 +18,11 @@ import java.util.Map; | @@ -18,10 +18,11 @@ import java.util.Map; | ||
| 18 | * @author dengwei | 18 | * @author dengwei |
| 19 | * @version 1.0.0 | 19 | * @version 1.0.0 |
| 20 | * @Description RtMallChannel | 20 | * @Description RtMallChannel |
| 21 | + * 大润发订单来源渠道 | ||
| 21 | * @date 2025-12-25 11:20 | 22 | * @date 2025-12-25 11:20 |
| 22 | */ | 23 | */ |
| 23 | @Component | 24 | @Component |
| 24 | -public class RtMallChannel extends AbstractChannel { | 25 | +public class RtMallChannel extends AbstractSourceChannel { |
| 25 | private static final Logger log = LoggerFactory.getLogger(RtMallChannel.class); | 26 | private static final Logger log = LoggerFactory.getLogger(RtMallChannel.class); |
| 26 | 27 | ||
| 27 | @Override | 28 | @Override |
cashier-mall/src/main/java/com/diligrp/cashier/mall/type/OrderState.java
| 1 | package com.diligrp.cashier.mall.type; | 1 | package com.diligrp.cashier.mall.type; |
| 2 | 2 | ||
| 3 | +import com.diligrp.cashier.mall.exception.RtMartMallException; | ||
| 4 | + | ||
| 5 | +import java.util.Arrays; | ||
| 6 | +import java.util.Map; | ||
| 7 | +import java.util.Optional; | ||
| 8 | +import java.util.stream.Collectors; | ||
| 9 | + | ||
| 3 | /** | 10 | /** |
| 4 | * @ClassName OrderStatus.java | 11 | * @ClassName OrderStatus.java |
| 5 | * @author dengwei | 12 | * @author dengwei |
| @@ -12,6 +19,7 @@ public enum OrderState { | @@ -12,6 +19,7 @@ public enum OrderState { | ||
| 12 | NOT_PAY_CANCEL(2, "notpaycancel", "未支付取消"), | 19 | NOT_PAY_CANCEL(2, "notpaycancel", "未支付取消"), |
| 13 | PAYED_CANCEL(3, "payedcancel", "已支付取消"), | 20 | PAYED_CANCEL(3, "payedcancel", "已支付取消"), |
| 14 | DONE(4, "done", "订单完成"), | 21 | DONE(4, "done", "订单完成"), |
| 22 | + CONFIRM_RECEIPT(4, "confirmreceipt", "订单完成"), | ||
| 15 | BUYER_CONFIRM(5, "buyer_confirm", "待用户收货"), | 23 | BUYER_CONFIRM(5, "buyer_confirm", "待用户收货"), |
| 16 | ; | 24 | ; |
| 17 | 25 | ||
| @@ -36,4 +44,14 @@ public enum OrderState { | @@ -36,4 +44,14 @@ public enum OrderState { | ||
| 36 | public String getName() { | 44 | public String getName() { |
| 37 | return name; | 45 | return name; |
| 38 | } | 46 | } |
| 47 | + | ||
| 48 | + /** | ||
| 49 | + * getCode | ||
| 50 | + * 根据key获取code | ||
| 51 | + * | ||
| 52 | + */ | ||
| 53 | + public static Integer getCode(String key) { | ||
| 54 | + Map<String, Integer> keyCodeMap = Arrays.stream(values()).collect(Collectors.toMap(OrderState::getKey, OrderState::getCode)); | ||
| 55 | + return Optional.ofNullable(keyCodeMap.get(key)).orElseThrow(() -> new RtMartMallException(RtMarkErrorCode.E5003)); | ||
| 56 | + } | ||
| 39 | } | 57 | } |
cashier-mall/src/main/java/com/diligrp/cashier/mall/type/PaymentChanel.java
0 → 100644
| 1 | +package com.diligrp.cashier.mall.type; | ||
| 2 | + | ||
| 3 | +/** | ||
| 4 | + * @ClassName PaymentChanel.java | ||
| 5 | + * @author dengwei | ||
| 6 | + * @version 1.0.0 | ||
| 7 | + * @Description PaymentChanel | ||
| 8 | + */ | ||
| 9 | +public enum PaymentChanel { | ||
| 10 | + WECHAT(10, "微信"), | ||
| 11 | + PARK_CARD(19, "园区卡"); | ||
| 12 | + | ||
| 13 | + private final int code; | ||
| 14 | + private final String description; | ||
| 15 | + | ||
| 16 | + PaymentChanel(int code, String description) { | ||
| 17 | + this.code = code; | ||
| 18 | + this.description = description; | ||
| 19 | + } | ||
| 20 | + | ||
| 21 | + public int getCode() { | ||
| 22 | + return code; | ||
| 23 | + } | ||
| 24 | + | ||
| 25 | + public String getDescription() { | ||
| 26 | + return description; | ||
| 27 | + } | ||
| 28 | +} |
cashier-mall/src/main/java/com/diligrp/cashier/mall/type/RtMarkErrorCode.java
| @@ -17,6 +17,8 @@ public enum RtMarkErrorCode { | @@ -17,6 +17,8 @@ public enum RtMarkErrorCode { | ||
| 17 | E5000("E5000", "未知错误"), | 17 | E5000("E5000", "未知错误"), |
| 18 | E5001("E5001", "认证失败"), | 18 | E5001("E5001", "认证失败"), |
| 19 | E5002("E5002", "不支持的类型"), | 19 | E5002("E5002", "不支持的类型"), |
| 20 | + E5003("E5003", "回调状态不匹配"), | ||
| 21 | + E5004("E5004", "数据异常"), | ||
| 20 | ; | 22 | ; |
| 21 | 23 | ||
| 22 | public final String code; | 24 | public final String code; |
cashier-mall/src/main/resources/com/diligrp/cashier/dao/mapper/MallBizOrderDao.xml
| @@ -23,12 +23,13 @@ | @@ -23,12 +23,13 @@ | ||
| 23 | <result column="order_expire" jdbcType="INTEGER" property="orderExpire" /> | 23 | <result column="order_expire" jdbcType="INTEGER" property="orderExpire" /> |
| 24 | <result column="version" jdbcType="INTEGER" property="version" /> | 24 | <result column="version" jdbcType="INTEGER" property="version" /> |
| 25 | <result column="created_time" jdbcType="TIMESTAMP" property="createdTime" /> | 25 | <result column="created_time" jdbcType="TIMESTAMP" property="createdTime" /> |
| 26 | + <result column="modifier_name" jdbcType="VARCHAR" property="modifierName" /> | ||
| 26 | <result column="modified_time" jdbcType="TIMESTAMP" property="modifiedTime" /> | 27 | <result column="modified_time" jdbcType="TIMESTAMP" property="modifiedTime" /> |
| 27 | </resultMap> | 28 | </resultMap> |
| 28 | <sql id="Base_Column_List"> | 29 | <sql id="Base_Column_List"> |
| 29 | id, order_no, order_id, trade_id, channel, mch_id, source, order_type, user_code, | 30 | id, order_no, order_id, trade_id, channel, mch_id, source, order_type, user_code, |
| 30 | username, company_code, shop_code, shop_name, total_amount, freight_fee, state, | 31 | username, company_code, shop_code, shop_name, total_amount, freight_fee, state, |
| 31 | - rtmart_state, order_time, order_expire, version, created_time, modified_time | 32 | + rtmart_state, order_time, order_expire, version, created_time, modifier_name, modified_time |
| 32 | </sql> | 33 | </sql> |
| 33 | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> | 34 | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| 34 | select | 35 | select |
| @@ -47,16 +48,14 @@ | @@ -47,16 +48,14 @@ | ||
| 47 | username, company_code, shop_code, | 48 | username, company_code, shop_code, |
| 48 | shop_name, total_amount, freight_fee, | 49 | shop_name, total_amount, freight_fee, |
| 49 | state, rtmart_state, order_time, | 50 | state, rtmart_state, order_time, |
| 50 | - order_expire, version, created_time, | ||
| 51 | - modified_time) | 51 | + order_expire) |
| 52 | values (#{id,jdbcType=BIGINT}, #{orderNo,jdbcType=VARCHAR}, #{orderId,jdbcType=VARCHAR}, | 52 | values (#{id,jdbcType=BIGINT}, #{orderNo,jdbcType=VARCHAR}, #{orderId,jdbcType=VARCHAR}, |
| 53 | #{tradeId,jdbcType=VARCHAR}, #{channel,jdbcType=VARCHAR}, #{mchId,jdbcType=VARCHAR}, | 53 | #{tradeId,jdbcType=VARCHAR}, #{channel,jdbcType=VARCHAR}, #{mchId,jdbcType=VARCHAR}, |
| 54 | #{source,jdbcType=TINYINT}, #{orderType,jdbcType=TINYINT}, #{userCode,jdbcType=VARCHAR}, | 54 | #{source,jdbcType=TINYINT}, #{orderType,jdbcType=TINYINT}, #{userCode,jdbcType=VARCHAR}, |
| 55 | #{username,jdbcType=VARCHAR}, #{companyCode,jdbcType=VARCHAR}, #{shopCode,jdbcType=VARCHAR}, | 55 | #{username,jdbcType=VARCHAR}, #{companyCode,jdbcType=VARCHAR}, #{shopCode,jdbcType=VARCHAR}, |
| 56 | #{shopName,jdbcType=VARCHAR}, #{totalAmount,jdbcType=BIGINT}, #{freightFee,jdbcType=BIGINT}, | 56 | #{shopName,jdbcType=VARCHAR}, #{totalAmount,jdbcType=BIGINT}, #{freightFee,jdbcType=BIGINT}, |
| 57 | #{state,jdbcType=TINYINT}, #{rtmartState,jdbcType=TINYINT}, #{orderTime,jdbcType=TIMESTAMP}, | 57 | #{state,jdbcType=TINYINT}, #{rtmartState,jdbcType=TINYINT}, #{orderTime,jdbcType=TIMESTAMP}, |
| 58 | - #{orderExpire,jdbcType=INTEGER}, #{version,jdbcType=INTEGER}, #{createdTime,jdbcType=TIMESTAMP}, | ||
| 59 | - #{modifiedTime,jdbcType=TIMESTAMP}) | 58 | + #{orderExpire,jdbcType=INTEGER}) |
| 60 | </insert> | 59 | </insert> |
| 61 | <insert id="insertSelective" parameterType="com.diligrp.cashier.mall.model.MallBizOrder"> | 60 | <insert id="insertSelective" parameterType="com.diligrp.cashier.mall.model.MallBizOrder"> |
| 62 | insert into mall_biz_order | 61 | insert into mall_biz_order |
| @@ -254,18 +253,21 @@ | @@ -254,18 +253,21 @@ | ||
| 254 | <if test="orderExpire != null"> | 253 | <if test="orderExpire != null"> |
| 255 | order_expire = #{orderExpire,jdbcType=INTEGER}, | 254 | order_expire = #{orderExpire,jdbcType=INTEGER}, |
| 256 | </if> | 255 | </if> |
| 257 | - <if test="version != null"> | ||
| 258 | - version = #{version,jdbcType=INTEGER}, | ||
| 259 | - </if> | ||
| 260 | <if test="createdTime != null"> | 256 | <if test="createdTime != null"> |
| 261 | created_time = #{createdTime,jdbcType=TIMESTAMP}, | 257 | created_time = #{createdTime,jdbcType=TIMESTAMP}, |
| 262 | </if> | 258 | </if> |
| 259 | + <if test="modifierName != null"> | ||
| 260 | + modifier_name = #{modifierName,jdbcType=VARCHAR}, | ||
| 261 | + </if> | ||
| 263 | <if test="modifiedTime != null"> | 262 | <if test="modifiedTime != null"> |
| 264 | modified_time = #{modifiedTime,jdbcType=TIMESTAMP}, | 263 | modified_time = #{modifiedTime,jdbcType=TIMESTAMP}, |
| 265 | </if> | 264 | </if> |
| 265 | + version = version + 1, | ||
| 266 | </set> | 266 | </set> |
| 267 | where id = #{id,jdbcType=BIGINT} | 267 | where id = #{id,jdbcType=BIGINT} |
| 268 | + and version = #{version} | ||
| 268 | </update> | 269 | </update> |
| 270 | + | ||
| 269 | <update id="updateByPrimaryKey" parameterType="com.diligrp.cashier.mall.model.MallBizOrder"> | 271 | <update id="updateByPrimaryKey" parameterType="com.diligrp.cashier.mall.model.MallBizOrder"> |
| 270 | update mall_biz_order | 272 | update mall_biz_order |
| 271 | set order_no = #{orderNo,jdbcType=VARCHAR}, | 273 | set order_no = #{orderNo,jdbcType=VARCHAR}, |
| @@ -286,9 +288,55 @@ | @@ -286,9 +288,55 @@ | ||
| 286 | rtmart_state = #{rtmartState,jdbcType=TINYINT}, | 288 | rtmart_state = #{rtmartState,jdbcType=TINYINT}, |
| 287 | order_time = #{orderTime,jdbcType=TIMESTAMP}, | 289 | order_time = #{orderTime,jdbcType=TIMESTAMP}, |
| 288 | order_expire = #{orderExpire,jdbcType=INTEGER}, | 290 | order_expire = #{orderExpire,jdbcType=INTEGER}, |
| 289 | - version = #{version,jdbcType=INTEGER}, | ||
| 290 | - created_time = #{createdTime,jdbcType=TIMESTAMP}, | ||
| 291 | - modified_time = #{modifiedTime,jdbcType=TIMESTAMP} | 291 | + modifier_name = #{modifierName,jdbcType=VARCHAR}, |
| 292 | where id = #{id,jdbcType=BIGINT} | 292 | where id = #{id,jdbcType=BIGINT} |
| 293 | </update> | 293 | </update> |
| 294 | + | ||
| 295 | + <select id="getByOrderId" resultType="com.diligrp.cashier.mall.model.MallBizOrder"> | ||
| 296 | + select <include refid="Base_Column_List"/> | ||
| 297 | + from mall_biz_order | ||
| 298 | + where order_id = #{orderId} | ||
| 299 | + </select> | ||
| 300 | + | ||
| 301 | + <update id="update"> | ||
| 302 | + update mall_biz_order | ||
| 303 | + <set> | ||
| 304 | + <if test="tradeId != null"> | ||
| 305 | + trade_id = #{tradeId,jdbcType=VARCHAR}, | ||
| 306 | + </if> | ||
| 307 | + <if test="username != null"> | ||
| 308 | + username = #{username,jdbcType=VARCHAR}, | ||
| 309 | + </if> | ||
| 310 | + <if test="companyCode != null"> | ||
| 311 | + company_code = #{companyCode,jdbcType=VARCHAR}, | ||
| 312 | + </if> | ||
| 313 | + <if test="shopCode != null"> | ||
| 314 | + shop_code = #{shopCode,jdbcType=VARCHAR}, | ||
| 315 | + </if> | ||
| 316 | + <if test="shopName != null"> | ||
| 317 | + shop_name = #{shopName,jdbcType=VARCHAR}, | ||
| 318 | + </if> | ||
| 319 | + <if test="totalAmount != null"> | ||
| 320 | + total_amount = #{totalAmount,jdbcType=BIGINT}, | ||
| 321 | + </if> | ||
| 322 | + <if test="freightFee != null"> | ||
| 323 | + freight_fee = #{freightFee,jdbcType=BIGINT}, | ||
| 324 | + </if> | ||
| 325 | + <if test="state != null"> | ||
| 326 | + state = #{state,jdbcType=TINYINT}, | ||
| 327 | + </if> | ||
| 328 | + <if test="rtmartState != null"> | ||
| 329 | + rtmart_state = #{rtmartState,jdbcType=TINYINT}, | ||
| 330 | + </if> | ||
| 331 | + <if test="orderExpire != null"> | ||
| 332 | + order_expire = #{orderExpire,jdbcType=INTEGER}, | ||
| 333 | + </if> | ||
| 334 | + version = version + 1 | ||
| 335 | + </set> | ||
| 336 | + where order_id = #{orderId} | ||
| 337 | + <if test="tradeId != null and tradeId != ''"> | ||
| 338 | + and trade_id = #{tradeId} | ||
| 339 | + </if> | ||
| 340 | + and version = #{version} | ||
| 341 | + </update> | ||
| 294 | </mapper> | 342 | </mapper> |
cashier-mall/src/main/resources/com/diligrp/cashier/dao/mapper/MallBizPaymentDao.xml
| @@ -35,7 +35,7 @@ | @@ -35,7 +35,7 @@ | ||
| 35 | from mall_biz_payment | 35 | from mall_biz_payment |
| 36 | where id = #{id,jdbcType=BIGINT} | 36 | where id = #{id,jdbcType=BIGINT} |
| 37 | </select> | 37 | </select> |
| 38 | - <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> | 38 | + <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| 39 | delete from mall_biz_payment | 39 | delete from mall_biz_payment |
| 40 | where id = #{id,jdbcType=BIGINT} | 40 | where id = #{id,jdbcType=BIGINT} |
| 41 | </delete> | 41 | </delete> |
| @@ -280,4 +280,14 @@ | @@ -280,4 +280,14 @@ | ||
| 280 | modified_time = #{modifiedTime,jdbcType=TIMESTAMP} | 280 | modified_time = #{modifiedTime,jdbcType=TIMESTAMP} |
| 281 | where id = #{id,jdbcType=BIGINT} | 281 | where id = #{id,jdbcType=BIGINT} |
| 282 | </update> | 282 | </update> |
| 283 | + | ||
| 284 | + <select id="getMallBizPayment" resultType="com.diligrp.cashier.mall.model.MallBizPayment"> | ||
| 285 | + select | ||
| 286 | + <include refid="Base_Column_List" /> | ||
| 287 | + from mall_biz_payment | ||
| 288 | + where order_id = #{orderId} | ||
| 289 | + <if test="tradeId != null and tradeId != ''"> | ||
| 290 | + and trade_id = #{tradeId} | ||
| 291 | + </if> | ||
| 292 | + </select> | ||
| 283 | </mapper> | 293 | </mapper> |
cashier-mall/src/main/resources/com/diligrp/cashier/dao/mapper/MallBizRefundDao.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
| 3 | +<mapper namespace="com.diligrp.cashier.mall.dao.MallBizRefundDao"> | ||
| 4 | + <resultMap id="BaseResultMap" type="com.diligrp.cashier.mall.model.MallBizRefund"> | ||
| 5 | + <id column="id" jdbcType="BIGINT" property="id" /> | ||
| 6 | + <result column="refund_trade_no" jdbcType="VARCHAR" property="refundTradeNo" /> | ||
| 7 | + <result column="pay_trade_no" jdbcType="VARCHAR" property="payTradeNo" /> | ||
| 8 | + <result column="refund_bn" jdbcType="VARCHAR" property="refundBn" /> | ||
| 9 | + <result column="order_id" jdbcType="VARCHAR" property="orderId" /> | ||
| 10 | + <result column="trade_id" jdbcType="VARCHAR" property="tradeId" /> | ||
| 11 | + <result column="refund_payment_id" jdbcType="VARCHAR" property="refundPaymentId" /> | ||
| 12 | + <result column="pay_payment_id" jdbcType="VARCHAR" property="payPaymentId" /> | ||
| 13 | + <result column="refund_card_no" jdbcType="VARCHAR" property="refundCardNo" /> | ||
| 14 | + <result column="refund_user_id" jdbcType="BIGINT" property="refundUserId" /> | ||
| 15 | + <result column="refund_username" jdbcType="VARCHAR" property="refundUsername" /> | ||
| 16 | + <result column="refund_account_id" jdbcType="BIGINT" property="refundAccountId" /> | ||
| 17 | + <result column="refund_time" jdbcType="TIMESTAMP" property="refundTime" /> | ||
| 18 | + <result column="refund_fee" jdbcType="BIGINT" property="refundFee" /> | ||
| 19 | + <result column="freight_fee" jdbcType="BIGINT" property="freightFee" /> | ||
| 20 | + <result column="refund_state" jdbcType="TINYINT" property="refundState" /> | ||
| 21 | + <result column="refund_reason" jdbcType="VARCHAR" property="refundReason" /> | ||
| 22 | + <result column="refund_callback" jdbcType="VARCHAR" property="refundCallback" /> | ||
| 23 | + <result column="version" jdbcType="INTEGER" property="version" /> | ||
| 24 | + <result column="creater_name" jdbcType="VARCHAR" property="createrName" /> | ||
| 25 | + <result column="created_time" jdbcType="TIMESTAMP" property="createdTime" /> | ||
| 26 | + <result column="refuse_reason" jdbcType="VARCHAR" property="refuseReason" /> | ||
| 27 | + </resultMap> | ||
| 28 | + <sql id="Base_Column_List"> | ||
| 29 | + id, refund_trade_no, pay_trade_no, refund_bn, order_id, trade_id, refund_payment_id, | ||
| 30 | + pay_payment_id, refund_card_no, refund_user_id, refund_username, refund_account_id, | ||
| 31 | + refund_time, refund_fee, freight_fee, refund_state, refund_reason, refund_callback, | ||
| 32 | + version, creater_name, created_time, refuse_reason | ||
| 33 | + </sql> | ||
| 34 | + <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> | ||
| 35 | + select | ||
| 36 | + <include refid="Base_Column_List" /> | ||
| 37 | + from mall_biz_refund | ||
| 38 | + where id = #{id,jdbcType=BIGINT} | ||
| 39 | + </select> | ||
| 40 | + <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> | ||
| 41 | + delete from mall_biz_refund | ||
| 42 | + where id = #{id,jdbcType=BIGINT} | ||
| 43 | + </delete> | ||
| 44 | + <insert id="insert" parameterType="com.diligrp.cashier.mall.model.MallBizRefund"> | ||
| 45 | + insert into mall_biz_refund (id, refund_trade_no, pay_trade_no, | ||
| 46 | + refund_bn, order_id, trade_id, | ||
| 47 | + refund_payment_id, pay_payment_id, refund_card_no, | ||
| 48 | + refund_user_id, refund_username, refund_account_id, | ||
| 49 | + refund_time, refund_fee, freight_fee, | ||
| 50 | + refund_state, refund_reason, refund_callback, | ||
| 51 | + version, creater_name, created_time, | ||
| 52 | + refuse_reason) | ||
| 53 | + values (#{id,jdbcType=BIGINT}, #{refundTradeNo,jdbcType=VARCHAR}, #{payTradeNo,jdbcType=VARCHAR}, | ||
| 54 | + #{refundBn,jdbcType=VARCHAR}, #{orderId,jdbcType=VARCHAR}, #{tradeId,jdbcType=VARCHAR}, | ||
| 55 | + #{refundPaymentId,jdbcType=VARCHAR}, #{payPaymentId,jdbcType=VARCHAR}, #{refundCardNo,jdbcType=VARCHAR}, | ||
| 56 | + #{refundUserId,jdbcType=BIGINT}, #{refundUsername,jdbcType=VARCHAR}, #{refundAccountId,jdbcType=BIGINT}, | ||
| 57 | + #{refundTime,jdbcType=TIMESTAMP}, #{refundFee,jdbcType=BIGINT}, #{freightFee,jdbcType=BIGINT}, | ||
| 58 | + #{refundState,jdbcType=TINYINT}, #{refundReason,jdbcType=VARCHAR}, #{refundCallback,jdbcType=VARCHAR}, | ||
| 59 | + #{version,jdbcType=INTEGER}, #{createrName,jdbcType=VARCHAR}, #{createdTime,jdbcType=TIMESTAMP}, | ||
| 60 | + #{refuseReason,jdbcType=VARCHAR}) | ||
| 61 | + </insert> | ||
| 62 | + <insert id="insertSelective" parameterType="com.diligrp.cashier.mall.model.MallBizRefund" | ||
| 63 | + useGeneratedKeys="true" keyColumn="id"> | ||
| 64 | + insert into mall_biz_refund | ||
| 65 | + <trim prefix="(" suffix=")" suffixOverrides=","> | ||
| 66 | + <if test="id != null"> | ||
| 67 | + id, | ||
| 68 | + </if> | ||
| 69 | + <if test="refundTradeNo != null"> | ||
| 70 | + refund_trade_no, | ||
| 71 | + </if> | ||
| 72 | + <if test="payTradeNo != null"> | ||
| 73 | + pay_trade_no, | ||
| 74 | + </if> | ||
| 75 | + <if test="refundBn != null"> | ||
| 76 | + refund_bn, | ||
| 77 | + </if> | ||
| 78 | + <if test="orderId != null"> | ||
| 79 | + order_id, | ||
| 80 | + </if> | ||
| 81 | + <if test="tradeId != null"> | ||
| 82 | + trade_id, | ||
| 83 | + </if> | ||
| 84 | + <if test="refundPaymentId != null"> | ||
| 85 | + refund_payment_id, | ||
| 86 | + </if> | ||
| 87 | + <if test="payPaymentId != null"> | ||
| 88 | + pay_payment_id, | ||
| 89 | + </if> | ||
| 90 | + <if test="refundCardNo != null"> | ||
| 91 | + refund_card_no, | ||
| 92 | + </if> | ||
| 93 | + <if test="refundUserId != null"> | ||
| 94 | + refund_user_id, | ||
| 95 | + </if> | ||
| 96 | + <if test="refundUsername != null"> | ||
| 97 | + refund_username, | ||
| 98 | + </if> | ||
| 99 | + <if test="refundAccountId != null"> | ||
| 100 | + refund_account_id, | ||
| 101 | + </if> | ||
| 102 | + <if test="refundTime != null"> | ||
| 103 | + refund_time, | ||
| 104 | + </if> | ||
| 105 | + <if test="refundFee != null"> | ||
| 106 | + refund_fee, | ||
| 107 | + </if> | ||
| 108 | + <if test="freightFee != null"> | ||
| 109 | + freight_fee, | ||
| 110 | + </if> | ||
| 111 | + <if test="refundState != null"> | ||
| 112 | + refund_state, | ||
| 113 | + </if> | ||
| 114 | + <if test="refundReason != null"> | ||
| 115 | + refund_reason, | ||
| 116 | + </if> | ||
| 117 | + <if test="refundCallback != null"> | ||
| 118 | + refund_callback, | ||
| 119 | + </if> | ||
| 120 | + <if test="version != null"> | ||
| 121 | + version, | ||
| 122 | + </if> | ||
| 123 | + <if test="createrName != null"> | ||
| 124 | + creater_name, | ||
| 125 | + </if> | ||
| 126 | + <if test="createdTime != null"> | ||
| 127 | + created_time, | ||
| 128 | + </if> | ||
| 129 | + <if test="refuseReason != null"> | ||
| 130 | + refuse_reason, | ||
| 131 | + </if> | ||
| 132 | + </trim> | ||
| 133 | + <trim prefix="values (" suffix=")" suffixOverrides=","> | ||
| 134 | + <if test="id != null"> | ||
| 135 | + #{id,jdbcType=BIGINT}, | ||
| 136 | + </if> | ||
| 137 | + <if test="refundTradeNo != null"> | ||
| 138 | + #{refundTradeNo,jdbcType=VARCHAR}, | ||
| 139 | + </if> | ||
| 140 | + <if test="payTradeNo != null"> | ||
| 141 | + #{payTradeNo,jdbcType=VARCHAR}, | ||
| 142 | + </if> | ||
| 143 | + <if test="refundBn != null"> | ||
| 144 | + #{refundBn,jdbcType=VARCHAR}, | ||
| 145 | + </if> | ||
| 146 | + <if test="orderId != null"> | ||
| 147 | + #{orderId,jdbcType=VARCHAR}, | ||
| 148 | + </if> | ||
| 149 | + <if test="tradeId != null"> | ||
| 150 | + #{tradeId,jdbcType=VARCHAR}, | ||
| 151 | + </if> | ||
| 152 | + <if test="refundPaymentId != null"> | ||
| 153 | + #{refundPaymentId,jdbcType=VARCHAR}, | ||
| 154 | + </if> | ||
| 155 | + <if test="payPaymentId != null"> | ||
| 156 | + #{payPaymentId,jdbcType=VARCHAR}, | ||
| 157 | + </if> | ||
| 158 | + <if test="refundCardNo != null"> | ||
| 159 | + #{refundCardNo,jdbcType=VARCHAR}, | ||
| 160 | + </if> | ||
| 161 | + <if test="refundUserId != null"> | ||
| 162 | + #{refundUserId,jdbcType=BIGINT}, | ||
| 163 | + </if> | ||
| 164 | + <if test="refundUsername != null"> | ||
| 165 | + #{refundUsername,jdbcType=VARCHAR}, | ||
| 166 | + </if> | ||
| 167 | + <if test="refundAccountId != null"> | ||
| 168 | + #{refundAccountId,jdbcType=BIGINT}, | ||
| 169 | + </if> | ||
| 170 | + <if test="refundTime != null"> | ||
| 171 | + #{refundTime,jdbcType=TIMESTAMP}, | ||
| 172 | + </if> | ||
| 173 | + <if test="refundFee != null"> | ||
| 174 | + #{refundFee,jdbcType=BIGINT}, | ||
| 175 | + </if> | ||
| 176 | + <if test="freightFee != null"> | ||
| 177 | + #{freightFee,jdbcType=BIGINT}, | ||
| 178 | + </if> | ||
| 179 | + <if test="refundState != null"> | ||
| 180 | + #{refundState,jdbcType=TINYINT}, | ||
| 181 | + </if> | ||
| 182 | + <if test="refundReason != null"> | ||
| 183 | + #{refundReason,jdbcType=VARCHAR}, | ||
| 184 | + </if> | ||
| 185 | + <if test="refundCallback != null"> | ||
| 186 | + #{refundCallback,jdbcType=VARCHAR}, | ||
| 187 | + </if> | ||
| 188 | + <if test="version != null"> | ||
| 189 | + #{version,jdbcType=INTEGER}, | ||
| 190 | + </if> | ||
| 191 | + <if test="createrName != null"> | ||
| 192 | + #{createrName,jdbcType=VARCHAR}, | ||
| 193 | + </if> | ||
| 194 | + <if test="createdTime != null"> | ||
| 195 | + #{createdTime,jdbcType=TIMESTAMP}, | ||
| 196 | + </if> | ||
| 197 | + <if test="refuseReason != null"> | ||
| 198 | + #{refuseReason,jdbcType=VARCHAR}, | ||
| 199 | + </if> | ||
| 200 | + </trim> | ||
| 201 | + </insert> | ||
| 202 | + <update id="updateByPrimaryKeySelective" parameterType="com.diligrp.cashier.mall.model.MallBizRefund"> | ||
| 203 | + update mall_biz_refund | ||
| 204 | + <set> | ||
| 205 | + <if test="refundTradeNo != null"> | ||
| 206 | + refund_trade_no = #{refundTradeNo,jdbcType=VARCHAR}, | ||
| 207 | + </if> | ||
| 208 | + <if test="payTradeNo != null"> | ||
| 209 | + pay_trade_no = #{payTradeNo,jdbcType=VARCHAR}, | ||
| 210 | + </if> | ||
| 211 | + <if test="refundBn != null"> | ||
| 212 | + refund_bn = #{refundBn,jdbcType=VARCHAR}, | ||
| 213 | + </if> | ||
| 214 | + <if test="orderId != null"> | ||
| 215 | + order_id = #{orderId,jdbcType=VARCHAR}, | ||
| 216 | + </if> | ||
| 217 | + <if test="tradeId != null"> | ||
| 218 | + trade_id = #{tradeId,jdbcType=VARCHAR}, | ||
| 219 | + </if> | ||
| 220 | + <if test="refundPaymentId != null"> | ||
| 221 | + refund_payment_id = #{refundPaymentId,jdbcType=VARCHAR}, | ||
| 222 | + </if> | ||
| 223 | + <if test="payPaymentId != null"> | ||
| 224 | + pay_payment_id = #{payPaymentId,jdbcType=VARCHAR}, | ||
| 225 | + </if> | ||
| 226 | + <if test="refundCardNo != null"> | ||
| 227 | + refund_card_no = #{refundCardNo,jdbcType=VARCHAR}, | ||
| 228 | + </if> | ||
| 229 | + <if test="refundUserId != null"> | ||
| 230 | + refund_user_id = #{refundUserId,jdbcType=BIGINT}, | ||
| 231 | + </if> | ||
| 232 | + <if test="refundUsername != null"> | ||
| 233 | + refund_username = #{refundUsername,jdbcType=VARCHAR}, | ||
| 234 | + </if> | ||
| 235 | + <if test="refundAccountId != null"> | ||
| 236 | + refund_account_id = #{refundAccountId,jdbcType=BIGINT}, | ||
| 237 | + </if> | ||
| 238 | + <if test="refundTime != null"> | ||
| 239 | + refund_time = #{refundTime,jdbcType=TIMESTAMP}, | ||
| 240 | + </if> | ||
| 241 | + <if test="refundFee != null"> | ||
| 242 | + refund_fee = #{refundFee,jdbcType=BIGINT}, | ||
| 243 | + </if> | ||
| 244 | + <if test="freightFee != null"> | ||
| 245 | + freight_fee = #{freightFee,jdbcType=BIGINT}, | ||
| 246 | + </if> | ||
| 247 | + <if test="refundState != null"> | ||
| 248 | + refund_state = #{refundState,jdbcType=TINYINT}, | ||
| 249 | + </if> | ||
| 250 | + <if test="refundReason != null"> | ||
| 251 | + refund_reason = #{refundReason,jdbcType=VARCHAR}, | ||
| 252 | + </if> | ||
| 253 | + <if test="refundCallback != null"> | ||
| 254 | + refund_callback = #{refundCallback,jdbcType=VARCHAR}, | ||
| 255 | + </if> | ||
| 256 | + <if test="version != null"> | ||
| 257 | + version = #{version,jdbcType=INTEGER}, | ||
| 258 | + </if> | ||
| 259 | + <if test="createrName != null"> | ||
| 260 | + creater_name = #{createrName,jdbcType=VARCHAR}, | ||
| 261 | + </if> | ||
| 262 | + <if test="createdTime != null"> | ||
| 263 | + created_time = #{createdTime,jdbcType=TIMESTAMP}, | ||
| 264 | + </if> | ||
| 265 | + <if test="refuseReason != null"> | ||
| 266 | + refuse_reason = #{refuseReason,jdbcType=VARCHAR}, | ||
| 267 | + </if> | ||
| 268 | + </set> | ||
| 269 | + where id = #{id,jdbcType=BIGINT} | ||
| 270 | + </update> | ||
| 271 | + <update id="updateByPrimaryKey" parameterType="com.diligrp.cashier.mall.model.MallBizRefund"> | ||
| 272 | + update mall_biz_refund | ||
| 273 | + set refund_trade_no = #{refundTradeNo,jdbcType=VARCHAR}, | ||
| 274 | + pay_trade_no = #{payTradeNo,jdbcType=VARCHAR}, | ||
| 275 | + refund_bn = #{refundBn,jdbcType=VARCHAR}, | ||
| 276 | + order_id = #{orderId,jdbcType=VARCHAR}, | ||
| 277 | + trade_id = #{tradeId,jdbcType=VARCHAR}, | ||
| 278 | + refund_payment_id = #{refundPaymentId,jdbcType=VARCHAR}, | ||
| 279 | + pay_payment_id = #{payPaymentId,jdbcType=VARCHAR}, | ||
| 280 | + refund_card_no = #{refundCardNo,jdbcType=VARCHAR}, | ||
| 281 | + refund_user_id = #{refundUserId,jdbcType=BIGINT}, | ||
| 282 | + refund_username = #{refundUsername,jdbcType=VARCHAR}, | ||
| 283 | + refund_account_id = #{refundAccountId,jdbcType=BIGINT}, | ||
| 284 | + refund_time = #{refundTime,jdbcType=TIMESTAMP}, | ||
| 285 | + refund_fee = #{refundFee,jdbcType=BIGINT}, | ||
| 286 | + freight_fee = #{freightFee,jdbcType=BIGINT}, | ||
| 287 | + refund_state = #{refundState,jdbcType=TINYINT}, | ||
| 288 | + refund_reason = #{refundReason,jdbcType=VARCHAR}, | ||
| 289 | + refund_callback = #{refundCallback,jdbcType=VARCHAR}, | ||
| 290 | + version = #{version,jdbcType=INTEGER}, | ||
| 291 | + creater_name = #{createrName,jdbcType=VARCHAR}, | ||
| 292 | + created_time = #{createdTime,jdbcType=TIMESTAMP}, | ||
| 293 | + refuse_reason = #{refuseReason,jdbcType=VARCHAR} | ||
| 294 | + where id = #{id,jdbcType=BIGINT} | ||
| 295 | + </update> | ||
| 296 | +</mapper> |
cashier-mall/src/main/resources/com/diligrp/cashier/dao/mapper/MallBizRefundItemDao.xml
| @@ -80,7 +80,7 @@ | @@ -80,7 +80,7 @@ | ||
| 80 | </if> | 80 | </if> |
| 81 | </trim> | 81 | </trim> |
| 82 | </insert> | 82 | </insert> |
| 83 | - <update id="updateByPrimaryKeySelective" parameterType="com.diligrp.cashier.mall.model.MallBizRefundItem"> | 83 | + <update id="updateByPrimaryKeySelective" parameterType="com.diligrp.cashier.mall.model.MallBizRefundItem"> |
| 84 | update mall_biz_refund_item | 84 | update mall_biz_refund_item |
| 85 | <set> | 85 | <set> |
| 86 | <if test="bizRefundId != null"> | 86 | <if test="bizRefundId != null"> |
| @@ -114,4 +114,17 @@ | @@ -114,4 +114,17 @@ | ||
| 114 | refund_fee = #{refundFee,jdbcType=BIGINT} | 114 | refund_fee = #{refundFee,jdbcType=BIGINT} |
| 115 | where id = #{id,jdbcType=BIGINT} | 115 | where id = #{id,jdbcType=BIGINT} |
| 116 | </update> | 116 | </update> |
| 117 | + | ||
| 118 | + <insert id="batchInsert"> | ||
| 119 | + insert into mall_biz_refund_item (biz_refund_id, sub_order_id, | ||
| 120 | + item_bn, item_name, num, | ||
| 121 | + refund_fee) | ||
| 122 | + values | ||
| 123 | + <foreach collection="list" item="item" index="index" separator=","> | ||
| 124 | + (#{item.bizRefundId,jdbcType=BIGINT}, #{item.subOrderId,jdbcType=BIGINT}, | ||
| 125 | + #{item.itemBn,jdbcType=VARCHAR}, #{item.itemName,jdbcType=VARCHAR}, #{item.num,jdbcType=INTEGER}, | ||
| 126 | + #{item.refundFee,jdbcType=BIGINT}) | ||
| 127 | + </foreach> | ||
| 128 | + </insert> | ||
| 129 | + | ||
| 117 | </mapper> | 130 | </mapper> |
cashier-mall/src/main/resources/package.json deleted
100644 → 0
| 1 | -{ | ||
| 2 | - "name": "resources", | ||
| 3 | - "version": "1.0.0", | ||
| 4 | - "description": "", | ||
| 5 | - "main": "index.js", | ||
| 6 | - "scripts": { | ||
| 7 | - "test": "echo \"Error: no test specified\" && exit 1" | ||
| 8 | - }, | ||
| 9 | - "repository": { | ||
| 10 | - "type": "git", | ||
| 11 | - "url": "https://git3.nong12.com/cashierdesk/dili-cashier.git" | ||
| 12 | - }, | ||
| 13 | - "private": true | ||
| 14 | -} |