用户码值表获取
This commit is contained in:
parent
0e8982ec3b
commit
70008ee4b1
@ -0,0 +1,26 @@
|
||||
package com.ebike.feign.clients;
|
||||
|
||||
import com.cdzy.common.model.response.JsonResult;
|
||||
import com.ebike.feign.component.FeignTokenInterceptor;
|
||||
import com.ebike.feign.config.ExampleFeignConfiguration;
|
||||
import com.ebike.feign.model.vo.FeignEbikeDicVo;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author yanglei
|
||||
* @since 2025-11-18 14:16
|
||||
*/
|
||||
|
||||
@FeignClient(name = "ebike-staff", configuration = {ExampleFeignConfiguration.class, FeignTokenInterceptor.class})
|
||||
public interface StaffFeignClient {
|
||||
|
||||
/**
|
||||
* 获取字字典及字典值
|
||||
*/
|
||||
@GetMapping("ebikeDicValue/list")
|
||||
JsonResult<List<FeignEbikeDicVo>> getDicValue();
|
||||
|
||||
}
|
||||
@ -0,0 +1,52 @@
|
||||
package com.ebike.feign.model.vo;
|
||||
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 实体类。
|
||||
*
|
||||
* @author attiya
|
||||
* @since 2025-09-09
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table("ebike_dic_value")
|
||||
public class FeignEbikeDicValueVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
private Long dicValueId;
|
||||
|
||||
/**
|
||||
* 字典值名称
|
||||
*/
|
||||
@NotBlank(message = "字典值名称不能为空")
|
||||
private String dicValueName;
|
||||
|
||||
/**
|
||||
* 字典值
|
||||
*/
|
||||
@NotBlank(message = "字典值不能为空")
|
||||
private String dicValue;
|
||||
|
||||
/**
|
||||
* 字典id
|
||||
*/
|
||||
@NotNull(message = "字典id不能为空")
|
||||
private Long dicId;
|
||||
|
||||
}
|
||||
@ -0,0 +1,63 @@
|
||||
package com.ebike.feign.model.vo;
|
||||
|
||||
import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.RelationOneToMany;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 实体类。
|
||||
*
|
||||
* @author attiya
|
||||
* @since 2025-09-09
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table("ebike_dic")
|
||||
public class FeignEbikeDicVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@Id
|
||||
private Long dicId;
|
||||
|
||||
/**
|
||||
* 字典名称
|
||||
*/
|
||||
private String dicName;
|
||||
|
||||
/**
|
||||
* 字典编码
|
||||
*/
|
||||
private String dicCode;
|
||||
|
||||
private Long createBy;
|
||||
|
||||
@Column(onInsertValue = "now()")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
private Long updateBy;
|
||||
|
||||
@Column(onUpdateValue = "now()")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
private Boolean isDeleted;
|
||||
|
||||
@RelationOneToMany(selfField = "dicId",targetField = "dicId")
|
||||
private List<FeignEbikeDicValueVo> values;
|
||||
}
|
||||
@ -125,11 +125,6 @@ public class EbikeRefund implements Serializable {
|
||||
*/
|
||||
private Long reviewOperator;
|
||||
|
||||
/**
|
||||
* 退款人
|
||||
*/
|
||||
private Long refundOperator;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
|
||||
@ -427,7 +427,6 @@ public class EbikeWxPayServiceImpl implements EbikeWxPayService {
|
||||
Refund result = wxRefundService.create(request);
|
||||
// 更新退款信息
|
||||
if (result != null) {
|
||||
ebikeRefund.setRefundOperator(operator);
|
||||
ebikeRefund.setOrderId(orderId);
|
||||
ebikeRefund.setTransactionId(transactionId);
|
||||
ebikeRefund.setTotal(amount.getTotal());
|
||||
@ -439,6 +438,7 @@ public class EbikeWxPayServiceImpl implements EbikeWxPayService {
|
||||
ebikeRefund.setRemark(refundDto.getRemark());
|
||||
ebikeRefund.setProcessStatus(RefundStatus.PROCESSED);
|
||||
ebikeRefund.setRefundTransactionId(result.getRefundId());
|
||||
ebikeRefund.setCreateBy(operator);
|
||||
ebikeRefundService.updateById(ebikeRefund);
|
||||
notifyVo.setSuccess(true);
|
||||
notifyVo.setMessage("退款成功");
|
||||
|
||||
@ -0,0 +1,43 @@
|
||||
package com.cdzy.user.controller;
|
||||
|
||||
import com.cdzy.common.enums.Code;
|
||||
import com.cdzy.common.ex.EbikeException;
|
||||
import com.cdzy.common.model.response.JsonResult;
|
||||
import com.ebike.feign.clients.StaffFeignClient;
|
||||
import com.ebike.feign.model.vo.FeignEbikeDicVo;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 获取字典码值
|
||||
*
|
||||
* @author yanglei
|
||||
* @since 2025-11-18 14:21
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/ebikeDicValue")
|
||||
public class EbikeDicValueController {
|
||||
|
||||
@Resource
|
||||
private StaffFeignClient staffFeignClient;
|
||||
|
||||
/**
|
||||
* 获取字典和字典值
|
||||
*
|
||||
* @return 列表
|
||||
*/
|
||||
@GetMapping("list")
|
||||
public JsonResult<?> list() {
|
||||
JsonResult<List<FeignEbikeDicVo>> dicValue = staffFeignClient.getDicValue();
|
||||
if (dicValue.getCode() != Code.SUCCESS) {
|
||||
throw new EbikeException("获取字典码值失败");
|
||||
}
|
||||
List<FeignEbikeDicVo> data = dicValue.getData();
|
||||
return JsonResult.success(data);
|
||||
}
|
||||
}
|
||||
@ -130,11 +130,6 @@ public class EbikeRefund implements Serializable {
|
||||
*/
|
||||
private Long reviewOperator;
|
||||
|
||||
/**
|
||||
* 退款人
|
||||
*/
|
||||
private Long refundOperator;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user