7 files deleted
24 files modified
| | |
| | | public static final DateTimeFormatter DFY_MD = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | public static final DateTimeFormatter DFY_M = DateTimeFormatter.ofPattern("yyyy-MM"); |
| | | public static final DateTimeFormatter SDF_YMDHMS = DateTimeFormatter.ofPattern("yyyyMMddHHmmss"); |
| | | public static final Integer DAY = 30; |
| | | |
| | | public static boolean isBefore(String date, int count) { |
| | | LocalDateTime time = LocalDateTime.parse(date, SDF_YMDHMS); |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | LocalDateTime nowPlus30 = time.plusDays(count); |
| | | |
| | | // 检查目标时间是否在 [time, time+count天] 区间内 |
| | | return !now.isBefore(time) && !now.isAfter(nowPlus30); |
| | | } |
| | | |
| | | /** |
| | | * Timestamp增加分钟 |
| | | * Timestamp增减天 |
| | | */ |
| | | public static Timestamp addMinute(Timestamp time, int month) { |
| | | public static Timestamp addDay(Timestamp time, int count) { |
| | | // 创建 Calendar 对象并设置为当前日期和时间的值 |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTimeInMillis(time.getTime()); |
| | | // 将MINUTE字段添加到当前日期和时间 |
| | | calendar.add(Calendar.MINUTE, month); |
| | | calendar.add(Calendar.DATE, count); |
| | | return new Timestamp(calendar.getTime().getTime()); |
| | | } |
| | | |
| | | /** |
| | | * Timestamp增减分钟 |
| | | */ |
| | | public static Timestamp addMinute(Timestamp time, int count) { |
| | | // 创建 Calendar 对象并设置为当前日期和时间的值 |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTimeInMillis(time.getTime()); |
| | | // 将MINUTE字段添加到当前日期和时间 |
| | | calendar.add(Calendar.MINUTE, count); |
| | | return new Timestamp(calendar.getTime().getTime()); |
| | | } |
| | | |
| | |
| | | |
| | | /** |
| | | * 获取当前时间yyyyMMdd |
| | | * |
| | | * @return 、yyyyMMdd |
| | | */ |
| | | public static String getNowTimeTypeYYYYMMDD() { |
| | |
| | | |
| | | /** |
| | | * 获取当前时间yyyyMM |
| | | * |
| | | * @return 、yyyyMM |
| | | */ |
| | | public static String getNowTimeTypeYYYYMM() { |
| | |
| | | @SuppressWarnings({"unchecked", "all"}) |
| | | public class RedisUtils { |
| | | private static final Logger log = LoggerFactory.getLogger(RedisUtils.class); |
| | | @Value("${jwt.generate-order-sn}") |
| | | private String generateOrderSn; |
| | | @Value("${wx.enabled}") |
| | | private Boolean wxEnabled; |
| | | private static final String T = "T-"; |
| | |
| | | * @param i |
| | | * @return |
| | | */ |
| | | public String generateOrderSn(Integer i) { |
| | | public String generateSn(String generate, Integer i) { |
| | | StringBuilder sb = new StringBuilder(); |
| | | String date = new SimpleDateFormat("yyyyMMdd").format(new Date()); |
| | | String key = generateOrderSn + i + date; |
| | | String key = generate + i + date; |
| | | Long increment = increment(key); |
| | | sb.append(date); |
| | | sb.append(String.format("%04d", i)); |
| | |
| | | public enum GenerateEnum { |
| | | |
| | | ORDER(10, "订单编号"), |
| | | RETURN_ORDER(20, "退单编号"), |
| | | ORDER_RETURN(20, "退单编号"), |
| | | |
| | | BUSINESS_NO(30,"未使用"), |
| | | FREE_DEPOSIT(40,"未使用"), |
| | |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum OrderStatusEnum { |
| | | ZERO(0, "订单已提交"), |
| | | ONE(1, "支付成功"), |
| | | TWO(2, "商家已接单"), |
| | | THREE(3, "骑手已接单"), |
| | | FOUR(4, "商家已备货"), |
| | | FIVE(5, "骑手已到店"), |
| | | SIX(6, "骑手已取货,正在送货"), |
| | | SEVEN(7, "商品已送达"), |
| | | EIGHT(8, "订单已完成"), |
| | | NINE(9, "取消订单"), |
| | | TEN(10, "申请售后"), |
| | | UNKNOWN(99, "未知枚举"); |
| | | ZERO(0, "ORDER", "订单已提交"), |
| | | ONE(1, "ORDER", "支付成功"), |
| | | TWO(2, "ORDER", "商家已接单"), |
| | | THREE(3, "ORDER", "商家已备货"), |
| | | FOUR(4, "ORDER", "骑手已接单"), |
| | | FIVE(5, "ORDER", "骑手已到店"), |
| | | SIX(6, "ORDER", "骑手已取货"), |
| | | SEVEN(7, "ORDER", "商品已送达"), |
| | | EIGHT(8, "ORDER", "订单已完成"), |
| | | NINE(9, "ORDER", "订单已取消"), |
| | | TEN(10, "REFUND", "申请退款"), |
| | | ELEVEN(11, "REFUND", "申请拒绝"), |
| | | TWELVE(12, "REFUND", "退款申诉"), |
| | | THIRTEEN(13, "REFUND", "申请同意"), |
| | | FOURTEEN(14, "REFUND", "退款成功"), |
| | | UNKNOWN(99, "UNKNOWN", "未知枚举"); |
| | | |
| | | private final Integer key; |
| | | |
| | | private final String code; |
| | | private final String value; |
| | | |
| | | public static OrderStatusEnum find(Integer val) { |
| | |
| | | public enum ReturnAuditEnum { |
| | | |
| | | ZERO(0, "申请"), |
| | | ONE(1, "通过"), |
| | | TWO(2, "拒绝"), |
| | | ONE(1, "拒绝"), |
| | | TWO(2, "通过"), |
| | | THREE(3, "未知"); |
| | | |
| | | private final Integer key; |
| | |
| | | */ |
| | | private Long renew; |
| | | |
| | | /** |
| | | * 自定义redis key |
| | | */ |
| | | private String generateOrderSn; |
| | | |
| | | public String getTokenStartWith() { |
| | | return tokenStartWith + " "; |
| | | } |
| | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | import java.util.Objects; |
| | | import java.util.Set; |
| | | |
| | |
| | | private String orderRemark; |
| | | |
| | | @NotBlank |
| | | @ApiModelProperty(value = "预计送达时间") |
| | | @ApiModelProperty(value = "送达预计时间") |
| | | private String orderTime; |
| | | |
| | | @ApiModelProperty(value = "送达完成时间") |
| | | private Timestamp orderFinishTime; |
| | | |
| | | @NotNull |
| | | @ApiModelProperty(value = "打包费") |
| | | private BigDecimal packagingPrice; |
| | |
| | | private Integer operation = 0; |
| | | |
| | | @NotBlank |
| | | @ApiModelProperty(value = "类型") |
| | | private String operationType; |
| | | |
| | | @NotBlank |
| | | @ApiModelProperty(value = "用户操作描述") |
| | | private String operationDescribe = "提交订单"; |
| | | |
| | |
| | | @ApiModelProperty(value = "实付金额") |
| | | private BigDecimal actuallyPayPrice; |
| | | |
| | | @ApiModelProperty(value = "退款价格") |
| | | @ApiModelProperty(value = "退款金额") |
| | | private BigDecimal refundPrice; |
| | | |
| | | @ApiModelProperty(value = "退款状态") |
| | |
| | | @ApiModelProperty(value = "退款渠道") |
| | | private String channel; |
| | | |
| | | @ApiModelProperty(value = "退款原因") |
| | | @ApiModelProperty(value = "退货类型") |
| | | private String reason; |
| | | |
| | | @ApiModelProperty(value = "备注") |
| | |
| | | @ApiModelProperty(value = "用户类型") |
| | | private String userType; |
| | | |
| | | @ApiModelProperty(value = "类型") |
| | | private String operationType; |
| | | |
| | | @ApiModelProperty(value = "订单号") |
| | | private String orderNum; |
| | | private List<Timestamp> operationTime; |
| | |
| | | package com.oying.modules.sh.domain.request; |
| | | |
| | | import com.oying.utils.enums.ReturnAuditEnum; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | |
| | | @ApiModelProperty(value = "退单号") |
| | | private String returnNum; |
| | | @ApiModelProperty(value = "审核状态") |
| | | private String auditStatus; |
| | | private ReturnAuditEnum auditStatus; |
| | | @ApiModelProperty(value = "备注") |
| | | private String message; |
| | | @ApiModelProperty(value = "金额") |
| | |
| | | |
| | | List<OrderOperationLog> findAll(@Param("criteria") OrderOperationLogQueryCriteria criteria); |
| | | |
| | | List<OrderOperationLog> getByOrderNum(String orderNum); |
| | | List<OrderOperationLog> getByOrderNum(String orderNum, String type); |
| | | } |
| | |
| | | |
| | | OrderReturn getByReturnNum(String returnNum); |
| | | |
| | | void updatePayStatus(String returnNum, String status, String time); |
| | | void updatePayStatus(String returnNum, String payState, String payTime); |
| | | |
| | | Long countAll(@Param("criteria") OrderReturnQueryCriteria criteria, @Param("blurry") String blurry); |
| | | |
| | | OrderReturn getByOrderNum(String orderNum, Integer status); |
| | | } |
| | |
| | | @GetMapping("getByOrderNum") |
| | | @ApiOperation("根据订单号查询订单操作日志") |
| | | @PreAuthorize("@el.check('orderOperationLog:list')") |
| | | public ResponseEntity<Object> queryOrderOperationLog(@RequestParam String orderNum) { |
| | | return new ResponseEntity<>(R.success(orderOperationLogService.getByOrderNum(orderNum)), HttpStatus.OK); |
| | | public ResponseEntity<Object> queryOrderOperationLog(@RequestParam String orderNum, @RequestParam String type) { |
| | | return new ResponseEntity<>(R.success(orderOperationLogService.getByOrderNum(orderNum, type)), HttpStatus.OK); |
| | | } |
| | | } |
| | |
| | | */ |
| | | void download(List<OrderOperationLog> all, HttpServletResponse response) throws IOException; |
| | | |
| | | List<OrderOperationLog> getByOrderNum(String orderNum); |
| | | List<OrderOperationLog> getByOrderNum(String orderNum, String type); |
| | | } |
| | |
| | | |
| | | OrderResponse getByOrderNum(String orderNum); |
| | | |
| | | Order queryByOrderNum(String orderNum); |
| | | |
| | | void operationLog(OrderResponse order, OrderStatusEnum stateEnum,String cardName); |
| | | |
| | | void updatePayStatus(String outTradeNo, PayStateEnum stateEnum, String payInfo, String timeEnd); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<OrderOperationLog> getByOrderNum(String orderNum) { |
| | | return orderOperationLogMapper.getByOrderNum(orderNum); |
| | | public List<OrderOperationLog> getByOrderNum(String orderNum, String type) { |
| | | return orderOperationLogMapper.getByOrderNum(orderNum, type); |
| | | } |
| | | |
| | | @Override |
| | |
| | | log1.setUsername(username); |
| | | log1.setUserType(userType); |
| | | log1.setOperation(OrderStatusEnum.ONE.getKey()); |
| | | log1.setOperationType(OrderStatusEnum.ONE.getCode()); |
| | | log1.setOperationDescribe(OrderStatusEnum.ONE.getValue()); |
| | | log1.setRemark(username + ":" + time + ">" + OrderStatusEnum.ONE.getValue() + ":" + response.getOrder().getOrderNum()); |
| | | Map<String, Object> map1 = new LinkedHashMap<>(); |
| | |
| | | log2.setUsername(username); |
| | | log2.setUserType(userType); |
| | | log2.setOperation(statusEnum.getKey()); |
| | | log2.setOperationType(statusEnum.getCode()); |
| | | log2.setOperationDescribe(statusEnum.getValue()); |
| | | log2.setRemark(username + ":" + time + ">" + statusEnum.getValue() + ":" + response.getOrder().getOrderNum()); |
| | | Map<String, Object> map2 = new LinkedHashMap<>(); |
| | |
| | | resources.setUsername(username); |
| | | resources.setUserType(userType); |
| | | resources.setOperation(statusEnum.getKey()); |
| | | resources.setOperationType(statusEnum.getCode()); |
| | | resources.setOperationDescribe(statusEnum.getValue()); |
| | | resources.setRemark(username + ":" + time + ">" + statusEnum.getValue() + ":" + response.getOrder().getOrderNum()); |
| | | Map<String, Object> map = new LinkedHashMap<>(); |
| | |
| | | package com.oying.modules.sh.service.impl; |
| | | |
| | | import com.oying.exception.BadRequestException; |
| | | import com.oying.modules.hwc.service.SwiftPassService; |
| | | import com.oying.modules.sh.domain.Order; |
| | | import com.oying.modules.sh.domain.OrderReturn; |
| | | import com.oying.modules.sh.domain.request.AuditOrderReturn; |
| | | import com.oying.modules.sh.domain.request.ReturnOrder; |
| | | import com.oying.utils.FileUtil; |
| | | import com.oying.modules.sh.service.OrderReturnProductSnapshotService; |
| | | import com.oying.modules.sh.service.OrderService; |
| | | import com.oying.utils.*; |
| | | import com.oying.utils.enums.GenerateEnum; |
| | | import com.oying.utils.enums.OrderStatusEnum; |
| | | import com.oying.utils.enums.PayTypeEnum; |
| | | import com.oying.utils.enums.ReturnAuditEnum; |
| | | import lombok.RequiredArgsConstructor; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | import com.oying.modules.sh.mapper.OrderReturnMapper; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import com.oying.utils.PageUtil; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.sql.Timestamp; |
| | | import java.util.*; |
| | | import java.io.IOException; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.LinkedHashMap; |
| | | |
| | | import com.oying.utils.PageResult; |
| | | |
| | | /** |
| | | * @author lixin |
| | |
| | | public class OrderReturnServiceImpl extends ServiceImpl<OrderReturnMapper, OrderReturn> implements OrderReturnService { |
| | | |
| | | private final OrderReturnMapper orderReturnMapper; |
| | | private final OrderService orderService; |
| | | private final OrderReturnProductSnapshotService productSnapshotService; |
| | | private final RedisUtils redisUtils; |
| | | private final SwiftPassService swiftPassService; |
| | | private static final String ORDER_RETURN_KEY = "oying:order:refund"; |
| | | |
| | | @Override |
| | | public PageResult<OrderReturn> queryAll(OrderReturnQueryCriteria criteria, Page<Object> page) { |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void create(ReturnOrder resources) { |
| | | public synchronized void create(ReturnOrder resources) { |
| | | Order order = orderService.queryByOrderNum(resources.getOrderNum()); |
| | | if (order == null) { |
| | | throw new BadRequestException("订单不存在!"); |
| | | } |
| | | if (Objects.equals(order.getOrderStatus(), OrderStatusEnum.ZERO.getKey())) { |
| | | throw new BadRequestException("订单未支付"); |
| | | } |
| | | OrderReturn returnOrder1 = orderReturnMapper.getByOrderNum(resources.getOrderNum(), ReturnAuditEnum.ZERO.getKey()); |
| | | if (returnOrder1 != null) { |
| | | throw new BadRequestException("退款订单已提交"); |
| | | } |
| | | OrderReturn returnOrder2 = orderReturnMapper.getByOrderNum(resources.getOrderNum(), ReturnAuditEnum.TWO.getKey()); |
| | | if (returnOrder2 != null) { |
| | | throw new BadRequestException("退款订单已处理"); |
| | | } |
| | | if (!DateUtil.isBefore(order.getPayTime(), DateUtil.DAY)) { |
| | | throw new BadRequestException("订单已超过售后有效期"); |
| | | } |
| | | // 退款订单 |
| | | OrderReturn returnOrder = new OrderReturn(); |
| | | // 退款订单号 |
| | | String returnNum = redisUtils.generateSn(ORDER_RETURN_KEY, GenerateEnum.ORDER_RETURN.getKey()); |
| | | returnOrder.setReturnNum(returnNum); |
| | | returnOrder.setReturnStatus(ReturnAuditEnum.ZERO.getKey()); |
| | | returnOrder.setReturnStatusDescribe(ReturnAuditEnum.ZERO.getValue()); |
| | | returnOrder.setOrderNum(resources.getOrderNum()); |
| | | returnOrder.setOrderTime(order.getOrderTime()); |
| | | returnOrder.setOrderStoreNum(order.getOrderStoreNum()); |
| | | returnOrder.setPackagingPrice(order.getPackagingPrice()); |
| | | returnOrder.setSendPrice(order.getSendPrice()); |
| | | returnOrder.setSendType(order.getSendType() != null ? order.getSendType() : null); |
| | | returnOrder.setRiderId(order.getRiderId() != null ? order.getRiderId() : null); |
| | | returnOrder.setRiderPhone(order.getRiderPhone() != null ? order.getRiderPhone() : null); |
| | | returnOrder.setRiderName(order.getRiderName() != null ? order.getRiderName() : null); |
| | | returnOrder.setPayType(order.getPayType()); |
| | | returnOrder.setUserId(order.getUserId()); |
| | | returnOrder.setUsername(order.getUsername()); |
| | | returnOrder.setStoreId(order.getStoreId()); |
| | | returnOrder.setStoreName(order.getStoreName()); |
| | | returnOrder.setStoreLogo(order.getStoreLogo()); |
| | | returnOrder.setOriginalPrice(order.getOriginalPrice()); |
| | | returnOrder.setPaidPrice(order.getPaidPrice()); |
| | | returnOrder.setActuallyPayPrice(order.getActuallyPayPrice()); |
| | | returnOrder.setReason(resources.getReason()); |
| | | returnOrder.setRemark(resources.getRemark()); |
| | | returnOrder.setPhotos(resources.getPhotos()); |
| | | returnOrder.setAuditStatus(ReturnAuditEnum.ZERO.getKey()); |
| | | orderReturnMapper.insert(returnOrder); |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void audit(AuditOrderReturn resources) { |
| | | |
| | | public synchronized void audit(AuditOrderReturn resources) { |
| | | OrderReturn orderReturn = orderReturnMapper.getByReturnNum(resources.getReturnNum()); |
| | | if (orderReturn == null) { |
| | | throw new BadRequestException("订单不存在"); |
| | | } |
| | | if (!Objects.equals(orderReturn.getReturnStatus(), ReturnAuditEnum.ZERO.getKey())) { |
| | | throw new BadRequestException("订单已处理或取消"); |
| | | } |
| | | if (resources.getAmount().compareTo(orderReturn.getActuallyPayPrice()) > 0) { |
| | | throw new BadRequestException("退款金额超过订单金额"); |
| | | } |
| | | switch (resources.getAuditStatus()) { |
| | | case ONE: |
| | | break; |
| | | case TWO: |
| | | long total = BigDecimalUtils.yuanToCents(orderReturn.getActuallyPayPrice()); |
| | | long refund = BigDecimalUtils.yuanToCents(resources.getAmount()); |
| | | orderReturn.setRefundPrice(resources.getAmount()); |
| | | PayTypeEnum status = PayTypeEnum.find(orderReturn.getPayType()); |
| | | switch (status) { |
| | | case HWC: |
| | | case HWC2: |
| | | if (refund > 0) { |
| | | Map<String, String> re = swiftPassService.refund(orderReturn.getReturnNum(), orderReturn.getOrderNum(), |
| | | resources.getMessage(), refund, total, status); |
| | | orderReturn.setChannel(re.get("refund_channel")); |
| | | } |
| | | break; |
| | | default: |
| | | throw new BadRequestException("暂未开通其余支付模式"); |
| | | } |
| | | break; |
| | | default: |
| | | throw new BadRequestException("审核状态错误"); |
| | | } |
| | | // 审核状态 |
| | | orderReturn.setAuditStatus(resources.getAuditStatus().getKey()); |
| | | // 审核人 |
| | | orderReturn.setAuditUser(SecurityUtils.getCurrentUsername()); |
| | | // 审核时间 |
| | | orderReturn.setAuditTime(new Timestamp(System.currentTimeMillis())); |
| | | // 审核信息 |
| | | orderReturn.setAuditMessage(resources.getMessage()); |
| | | orderReturnMapper.updateById(orderReturn); |
| | | } |
| | | |
| | | @Override |
| | |
| | | map.put("退款状态", orderReturn.getRefundStatus()); |
| | | map.put("退款成功时间", orderReturn.getSuccessTime()); |
| | | map.put("退款渠道", orderReturn.getChannel()); |
| | | map.put("退款原因", orderReturn.getReason()); |
| | | map.put("退货类型", orderReturn.getReason()); |
| | | map.put("备注", orderReturn.getRemark()); |
| | | map.put("图片", orderReturn.getPhotos()); |
| | | map.put("审核状态", ReturnAuditEnum.getValue(orderReturn.getAuditStatus())); |
| | |
| | | private final RedisUtils redisUtils; |
| | | private final StoreService storeService; |
| | | private final OrderOperationLogService operationLogService; |
| | | private final static String DESCRIBE = "哦应:"; |
| | | private static final String DESCRIBE = "哦应:"; |
| | | private static final String ORDER_KEY = "oying:order"; |
| | | private static final String ORDER_STORE_KEY = "oying:order:store"; |
| | | |
| | | @Override |
| | | public PageResult<Order> queryAll(OrderQueryCriteria criteria, Page<Object> page) { |
| | |
| | | if (!(address.getDistance().compareTo(BigDecimal.valueOf(store.getRadius())) <= 0)) { |
| | | throw new BadRequestException("超出配送范围"); |
| | | } |
| | | String orderNum = redisUtils.generateOrderSn(GenerateEnum.ORDER.getKey()); |
| | | // 订单号 |
| | | String orderNum = redisUtils.generateSn(ORDER_KEY, GenerateEnum.ORDER.getKey()); |
| | | // 总金额 |
| | | BigDecimal amount = BigDecimal.ZERO; |
| | | // 商品快照 |
| | |
| | | // 订单信息 |
| | | Order order = new Order(); |
| | | order.setOrderNum(orderNum); |
| | | order.setOrderStoreNum(redisUtils.generateOrderSn(Math.toIntExact(submit.getStoreId())).substring(orderNum.length() - 4)); |
| | | order.setOrderStoreNum(redisUtils.generateSn(ORDER_STORE_KEY, Math.toIntExact(submit.getStoreId())).substring(orderNum.length() - 4)); |
| | | order.setOrderStatus(OrderStatusEnum.ZERO.getKey()); |
| | | order.setOrderStatusDescribe(OrderStatusEnum.ZERO.getValue()); |
| | | order.setOrderRemark(submit.getRemark() != null ? submit.getRemark() : ""); |
| | |
| | | } |
| | | |
| | | OrderAddressSnapshot addressSnapshot = getOrderAddressSnapshot(orderNum, address); |
| | | |
| | | |
| | | addressSnapshotService.save(addressSnapshot); |
| | | orderMapper.insert(order); |
| | |
| | | public OrderResponse getByOrderNum(String orderNum) { |
| | | return new OrderResponse(orderMapper.getByOrderNum(orderNum), |
| | | addressSnapshotService.queryByOrderNum(orderNum), |
| | | operationLogService.getByOrderNum(orderNum)); |
| | | operationLogService.getByOrderNum(orderNum, null)); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Order queryByOrderNum(String orderNum) { |
| | | return orderMapper.getByOrderNum(orderNum); |
| | | } |
| | | |
| | | @Override |
| | |
| | | online-key: "online_token:" |
| | | # 验证码 |
| | | code-key: "captcha_code:" |
| | | # 自定义redis key |
| | | generate-order-sn: oying:generate:sn |
| | | # token 续期检查时间范围(默认30分钟,单位毫秒),在token即将过期的一段时间内用户操作了,则给用户的token续期 |
| | | detect: 1800000 |
| | | # 续期时间范围,默认1小时,单位毫秒 |
| | |
| | | online-key: "online_token:" |
| | | # 验证码 |
| | | code-key: "captcha_code:" |
| | | # 自定义redis key |
| | | generate-order-sn: oying:generate:sn |
| | | # token 续期检查时间范围(默认30分钟,单位默认毫秒),在token即将过期的一段时间内用户操作了,则给用户的token续期 |
| | | detect: 1800000 |
| | | # 续期时间范围,默认 1小时,这里单位毫秒 |
| | |
| | | <result column="order_status_describe" property="orderStatusDescribe"/> |
| | | <result column="order_remark" property="orderRemark"/> |
| | | <result column="order_time" property="orderTime"/> |
| | | <result column="order_finish_time" property="orderFinishTime"/> |
| | | <result column="packaging_price" property="packagingPrice"/> |
| | | <result column="send_price" property="sendPrice"/> |
| | | <result column="send_type" property="sendType"/> |
| | |
| | | |
| | | <sql id="Base_Column_List"> |
| | | o.order_id, o.order_num, o.order_store_num, o.order_status, o.order_status_describe, |
| | | o.order_remark, o.order_time, o.packaging_price, o.send_price, o.send_type, o.user_id, o.username, o.store_id, |
| | | o.order_remark, o.order_time, o.order_finish_time, o.packaging_price, o.send_price, o.send_type, o.user_id, o.username, o.store_id, |
| | | o.store_name, o.store_logo, o.store_address, o.store_longitude, o.store_latitude, |
| | | o.order_describe, o.original_price order_original_price, o.paid_price order_paid_price, |
| | | o.actually_pay_price order_actually_pay_price, o.pay_state order_pay_state, o.pay_message, o.pay_type, o.pay_time, o.expire_time, |
| | |
| | | <result column="username" property="username"/> |
| | | <result column="user_type" property="userType"/> |
| | | <result column="operation" property="operation"/> |
| | | <result column="operation_type" property="operationType"/> |
| | | <result column="operation_describe" property="operationDescribe"/> |
| | | <result column="remark" property="remark"/> |
| | | <result column="snapshot_data" property="snapshotData"/> |
| | |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | | log_id, username, user_type, operation, operation_describe, remark, snapshot_data, operation_time, order_num |
| | | log_id, username, user_type, operation, operation_type, operation_describe, remark, snapshot_data, operation_time, order_num |
| | | </sql> |
| | | |
| | | <select id="findAll" resultMap="BaseResultMap"> |
| | |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | from sh_order_operation_log |
| | | where order_num = #{orderNum} order by log_id |
| | | where order_num = #{orderNum} |
| | | <if test="type!= null and type != ''"> |
| | | operation_type = #{type} |
| | | </if> |
| | | order by log_id |
| | | </select> |
| | | </mapper> |
| | |
| | | update sh_order_return |
| | | set return_status = #{payState}, |
| | | success_time = #{payTime} |
| | | where order_num = #{orderNum} |
| | | where return_num = #{returnNum} |
| | | </update> |
| | | |
| | | <select id="findAll" resultMap="BaseResultMap"> |
| | |
| | | <include refid="Where_Sql_Product"/> |
| | | ) t |
| | | </select> |
| | | <select id="getByOrderNum" resultType="com.oying.modules.sh.domain.OrderReturn"> |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | from sh_order_return as o |
| | | where o.order_num = #{orderNum} and o.audit_status = #{status} |
| | | </select> |
| | | </mapper> |