@@ -11,19 +11,19 @@ public enum UserType { | |||
private final Integer code; | |||
private final String type; | |||
private final String name; | |||
UserType(Integer code, String type) { | |||
UserType(Integer code, String name) { | |||
this.code = code; | |||
this.type = type; | |||
this.name = name; | |||
} | |||
public Integer getCode() { | |||
return this.code; | |||
} | |||
public String getType() { | |||
return this.type; | |||
public String getName() { | |||
return this.name; | |||
} | |||
public static UserType fromCode(Integer code) { |
@@ -11,7 +11,7 @@ public enum RefundOperateType { | |||
private final Integer code; | |||
private final String type; | |||
private final String name; | |||
public static RefundOperateType find(Integer code) throws ServiceHandleException { | |||
for (RefundOperateType instance : RefundOperateType.values()) { | |||
@@ -22,24 +22,24 @@ public enum RefundOperateType { | |||
return null; | |||
} | |||
public static String getValue(Integer code){ | |||
public static String getNameByCode(Integer code){ | |||
for (RefundOperateType instance : RefundOperateType.values()) { | |||
if (instance.getCode().equals(code)) { | |||
return instance.type; | |||
return instance.name; | |||
} | |||
} | |||
return null; | |||
} | |||
RefundOperateType(Integer code, String type) { | |||
RefundOperateType(Integer code, String name) { | |||
this.code = code; | |||
this.type = type; | |||
this.name = name; | |||
} | |||
public Integer getCode() { | |||
return code; | |||
} | |||
public String getType() { | |||
return type; | |||
public String getName() { | |||
return name; | |||
} | |||
} |
@@ -15,7 +15,7 @@ public enum RefundStatus { | |||
private final String code; | |||
private final String type; | |||
private final String name; | |||
public static RefundStatus find(String code) throws ServiceHandleException { | |||
for (RefundStatus instance : RefundStatus.values()) { | |||
@@ -27,16 +27,16 @@ public enum RefundStatus { | |||
// throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("不存在的退费类型!" + code); | |||
} | |||
RefundStatus(String code, String type) { | |||
RefundStatus(String code, String name) { | |||
this.code = code; | |||
this.type = type; | |||
this.name = name; | |||
} | |||
public String getCode() { | |||
return this.code; | |||
} | |||
public String getType() { | |||
return this.type; | |||
public String getName() { | |||
return this.name; | |||
} | |||
} |
@@ -3,6 +3,7 @@ package cn.com.taiji.core.entity.issue; | |||
import cn.com.taiji.common.entity.StringPropertyUUIDEntity; | |||
import cn.com.taiji.core.entity.dict.basic.UserType; | |||
import cn.com.taiji.core.entity.dict.issue.BankType; | |||
import cn.com.taiji.core.entity.dict.issue.RefundBusiness; | |||
import cn.com.taiji.core.entity.dict.issue.RefundOperateType; | |||
import cn.com.taiji.core.entity.dict.issue.RefundStatus; | |||
import lombok.Getter; | |||
@@ -56,17 +57,17 @@ public class IssueOrderRefund extends StringPropertyUUIDEntity { | |||
@Size(max = 1024) | |||
@Column(name = "REFUND_REASON") | |||
private String refundReason;//退费原因 | |||
@NotBlank | |||
@NotNull | |||
@Column(name = "STATUS") | |||
@Enumerated(EnumType.STRING) | |||
private RefundStatus status;//状态 | |||
@Size(max = 1024) | |||
@Column(name = "FAIL_REASON") | |||
private String failReason;//退费失败原因 | |||
@NotBlank | |||
@Size(max = 32) | |||
@NotNull | |||
@Column(name = "BUSINESS_PORT") | |||
private String businessPort;//业务端口 | |||
@Enumerated(EnumType.STRING) | |||
private RefundBusiness businessPort;//业务端口 | |||
@Size(max = 32) | |||
@Column(name = "SALESMAN_OPEN_ID") | |||
private String salesmanOpenId;//业务员 | |||
@@ -99,7 +100,7 @@ public class IssueOrderRefund extends StringPropertyUUIDEntity { | |||
private String cusTel;//开户人联系方式 | |||
@Column(name = "CUS_TYPE") | |||
private UserType cusType;//开户用户类型 | |||
@NotBlank | |||
@NotNull | |||
@Column(name = "OPERATE_TYPE") | |||
@Enumerated(EnumType.STRING) | |||
private RefundOperateType operateType;//退款方式 |
@@ -0,0 +1,70 @@ | |||
package cn.com.taiji.core.repo.request.issue; | |||
import cn.com.taiji.common.pub.dao.HqlBuilder; | |||
import cn.com.taiji.common.repo.request.jpa.JpaDateTimePageableDataRequest; | |||
import cn.com.taiji.core.entity.dict.issue.RefundBusiness; | |||
import cn.com.taiji.core.entity.dict.issue.RefundStatus; | |||
import cn.com.taiji.core.entity.issue.IssueOrderRefund; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
import java.time.LocalDateTime; | |||
/** | |||
* @Auther: humh | |||
* @Description: | |||
* @Date: 2025/6/13 20:34 | |||
* @email: huminghao@mail.taiji.com.cn | |||
* @version: 1.0 | |||
*/ | |||
@Getter | |||
@Setter | |||
public class IssueOrderRefundPageRequest extends JpaDateTimePageableDataRequest<IssueOrderRefund> { | |||
/** 订单号 */ | |||
private String orderNo; | |||
/** 卡号 */ | |||
private String cardId; | |||
/** 车牌颜色 */ | |||
private Integer vehiclePlatecolor; | |||
/** 车辆编号 */ | |||
private String vehiclePlate; | |||
/** 退费类型类型 */ | |||
private RefundBusiness refundBusiness; | |||
/** 状态 */ | |||
private RefundStatus status; | |||
/** 渠道id */ | |||
private String agencyId; | |||
/** 创建开始时间 */ | |||
private LocalDateTime startTime; | |||
/** 创建结束时间 */ | |||
private LocalDateTime endTime; | |||
public IssueOrderRefundPageRequest() { | |||
this.orderBy = "insertTime"; | |||
this.desc = true; | |||
} | |||
@Override | |||
public HqlBuilder toSelectHql() { | |||
HqlBuilder hql = new HqlBuilder("from IssueOrderRefund where 1=1 "); | |||
hql.append(" and agencyId=:agencyId",agencyId); | |||
hql.append(" and orderNo=:orderNo",orderNo); | |||
hql.append(" and cardId=:cardId",cardId); | |||
hql.append(" and vehiclePlate=:vehiclePlate",vehiclePlate); | |||
hql.append(" and vehiclePlatecolor=:vehiclePlatecolor",vehiclePlatecolor); | |||
hql.append(" and refundBusiness=:refundBusiness",refundBusiness); | |||
hql.append(" and status=:status",status); | |||
hql.append(" and insertTime >= :startTime", startTime); | |||
hql.append(" and insertTime <= :endTime", endTime); | |||
return hql; | |||
} | |||
} |
@@ -45,7 +45,7 @@ public class InvwEnterApplyAddRequestDTO extends AbstractStaffBizRequestDTO { | |||
@Enumerated(EnumType.STRING) | |||
private InventoryType inventoryType; | |||
@ApiModelProperty(value = "库存型号") | |||
@ApiModelProperty(value = "设备型号") | |||
@NotNull | |||
@Enumerated(EnumType.STRING) | |||
private DeviceVersion version; |
@@ -0,0 +1,60 @@ | |||
package cn.com.taiji.managew.api.issueOrder; | |||
import cn.com.taiji.common.manager.ManagerException; | |||
import cn.com.taiji.common.manager.net.http.ServiceHandleException; | |||
import cn.com.taiji.common.model.dao.Pagination; | |||
import cn.com.taiji.common.web.ApiResponse; | |||
import cn.com.taiji.managew.api.MyValidController; | |||
import cn.com.taiji.managew.dto.issueOrder.*; | |||
import cn.com.taiji.managew.manager.issueOrder.IssueOrderRefundManager; | |||
import io.swagger.annotations.Api; | |||
import io.swagger.annotations.ApiOperation; | |||
import lombok.extern.slf4j.Slf4j; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.web.bind.annotation.PostMapping; | |||
import org.springframework.web.bind.annotation.RequestBody; | |||
import org.springframework.web.bind.annotation.RequestMapping; | |||
import org.springframework.web.bind.annotation.RestController; | |||
import javax.validation.Valid; | |||
/** | |||
* 渠道映射 | |||
* @author pb | |||
* @date: 2024/10/9 11:24 | |||
*/ | |||
@Api(tags = "退费管理") | |||
@RestController | |||
@RequestMapping("/api/issue/refund") | |||
@Slf4j | |||
public class IssueOrderRefundController extends MyValidController { | |||
@Autowired | |||
private IssueOrderRefundManager manager; | |||
@ApiOperation(value = "退费分页查询") | |||
@PostMapping("/page") | |||
public ApiResponse<Pagination> page(@Valid @RequestBody IssueOrderRefundPageRequestDTO dto) throws ServiceHandleException { | |||
return ApiResponse.of(manager.page(dto)); | |||
} | |||
@ApiOperation(value = "退费确认管理-查看") | |||
@PostMapping("/view") | |||
public ApiResponse<IssueOrderRefundViewResponseDTO> view(@Valid @RequestBody IssueOrderRefundViewRequestDTO dto) throws ServiceHandleException { | |||
return ApiResponse.of(manager.view(dto)); | |||
} | |||
@ApiOperation(value = "退费确认管理-退费确认") | |||
@PostMapping("/result") | |||
public ApiResponse<IssueOrderRefundResultResponseDTO> result(@Valid @RequestBody IssueOrderRefundResultRequestDTO dto) throws ManagerException { | |||
return ApiResponse.of(manager.result(dto)); | |||
} | |||
@ApiOperation(value = "退费确认管理-导出") | |||
@PostMapping("/export") | |||
public ApiResponse<IssueOrderRefundExportResponseDTO> export(@Valid@RequestBody IssueOrderRefundExportRequestDTO dto) throws ManagerException { | |||
return ApiResponse.of(manager.export(dto)); | |||
} | |||
} |
@@ -0,0 +1,50 @@ | |||
package cn.com.taiji.managew.dto.issueOrder; | |||
import cn.com.taiji.core.dto.AbstractStaffBizRequestDTO; | |||
import cn.com.taiji.core.entity.dict.issue.RefundBusiness; | |||
import cn.com.taiji.core.entity.dict.issue.RefundStatus; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
import java.time.LocalDateTime; | |||
/** | |||
* @Auther: humh | |||
* @Description: | |||
* @Date: 2025/5/19 16:29 | |||
* @email: huminghao@mail.taiji.com.cn | |||
* @version: 1.0 | |||
*/ | |||
@Setter | |||
@Getter | |||
@ApiModel(description = "退费管理导出请求") | |||
public class IssueOrderRefundExportRequestDTO extends AbstractStaffBizRequestDTO { | |||
@ApiModelProperty(value = "订单号") | |||
private String orderNo; | |||
@ApiModelProperty(value = "卡号") | |||
private String cardId; | |||
@ApiModelProperty(value = "车牌颜色") | |||
private Integer vehiclePlatecolor; | |||
@ApiModelProperty(value = "车牌号") | |||
private String vehiclePlate; | |||
@ApiModelProperty(value = "退费类型类型") | |||
private RefundBusiness refundBusiness; | |||
@ApiModelProperty(value = "状态") | |||
private RefundStatus status; | |||
@ApiModelProperty(value = "创建开始时间") | |||
private LocalDateTime startTime; | |||
@ApiModelProperty(value = "创建结束时间") | |||
private LocalDateTime endTime; | |||
} |
@@ -0,0 +1,26 @@ | |||
package cn.com.taiji.managew.dto.issueOrder; | |||
import cn.com.taiji.common.model.BaseModel; | |||
import cn.com.taiji.core.dto.AbstractStaffBizPageRequestDTO; | |||
import io.swagger.annotations.ApiModel; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
/** | |||
* @Auther: humh | |||
* @Description: | |||
* @Date: 2025/5/19 16:29 | |||
* @email: huminghao@mail.taiji.com.cn | |||
* @version: 1.0 | |||
*/ | |||
@Setter | |||
@Getter | |||
@ApiModel(description = "退费管理导出响应") | |||
public class IssueOrderRefundExportResponseDTO extends BaseModel { | |||
private String excelUrl; | |||
public IssueOrderRefundExportResponseDTO(String excelUrl){ | |||
this.excelUrl = excelUrl; | |||
} | |||
} |
@@ -0,0 +1,50 @@ | |||
package cn.com.taiji.managew.dto.issueOrder; | |||
import cn.com.taiji.core.dto.AbstractStaffBizPageRequestDTO; | |||
import cn.com.taiji.core.entity.dict.issue.RefundBusiness; | |||
import cn.com.taiji.core.entity.dict.issue.RefundStatus; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
import java.time.LocalDateTime; | |||
/** | |||
* @Auther: humh | |||
* @Description: | |||
* @Date: 2025/5/19 16:29 | |||
* @email: huminghao@mail.taiji.com.cn | |||
* @version: 1.0 | |||
*/ | |||
@Setter | |||
@Getter | |||
@ApiModel(description = "退费管理分页查询") | |||
public class IssueOrderRefundPageRequestDTO extends AbstractStaffBizPageRequestDTO { | |||
@ApiModelProperty(value = "订单号") | |||
private String orderNo; | |||
@ApiModelProperty(value = "卡号") | |||
private String cardId; | |||
@ApiModelProperty(value = "车牌号") | |||
private Integer vehiclePlatecolor; | |||
@ApiModelProperty(value = "车辆编号") | |||
private String vehiclePlate; | |||
@ApiModelProperty(value = "退费类型类型") | |||
private RefundBusiness refundBusiness; | |||
@ApiModelProperty(value = "状态") | |||
private RefundStatus status; | |||
@ApiModelProperty(value = "创建开始时间") | |||
private LocalDateTime startTime; | |||
@ApiModelProperty(value = "创建结束时间") | |||
private LocalDateTime endTime; | |||
} |
@@ -0,0 +1,54 @@ | |||
package cn.com.taiji.managew.dto.issueOrder; | |||
import cn.com.taiji.common.manager.ManagerException; | |||
import cn.com.taiji.common.valid.ViolationValidator; | |||
import cn.com.taiji.core.dto.AbstractStaffBizRequestDTO; | |||
import cn.com.taiji.core.entity.dict.issue.RefundOperateType; | |||
import cn.com.taiji.managew.model.issueOrder.PaymentBankModel; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
import org.apache.commons.lang3.ObjectUtils; | |||
import javax.validation.constraints.NotBlank; | |||
import javax.validation.constraints.NotNull; | |||
/** | |||
* @Auther: humh | |||
* @Description: | |||
* @Date: 2025/5/19 16:29 | |||
* @email: huminghao@mail.taiji.com.cn | |||
* @version: 1.0 | |||
*/ | |||
@Setter | |||
@Getter | |||
@ApiModel(description = "退费管理确认/驳回请求") | |||
public class IssueOrderRefundResultRequestDTO extends AbstractStaffBizRequestDTO { | |||
@NotBlank | |||
private String id; | |||
@ApiModelProperty(value = "审核结果,通过-驳回") | |||
@NotBlank | |||
private String censorResult; | |||
@ApiModelProperty(value = "退费方式") | |||
@NotNull | |||
private RefundOperateType operateType; | |||
@ApiModelProperty(value = "银行卡退费信息") | |||
private PaymentBankModel paymentBankModel; | |||
public void valid() throws ManagerException { | |||
if ("通过".equals(censorResult)){ | |||
if (RefundOperateType.BANK.equals(operateType)){ | |||
if (ObjectUtils.allNotNull(paymentBankModel)){ | |||
throw new ManagerException("退费方式为银行卡,银行卡退费信息不能为空"); | |||
} | |||
} | |||
} | |||
} | |||
} |
@@ -0,0 +1,26 @@ | |||
package cn.com.taiji.managew.dto.issueOrder; | |||
import cn.com.taiji.common.model.BaseModel; | |||
import cn.com.taiji.core.dto.AbstractStaffBizPageRequestDTO; | |||
import io.swagger.annotations.ApiModel; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
/** | |||
* @Auther: humh | |||
* @Description: | |||
* @Date: 2025/5/19 16:29 | |||
* @email: huminghao@mail.taiji.com.cn | |||
* @version: 1.0 | |||
*/ | |||
@Setter | |||
@Getter | |||
@ApiModel(description = "退费管理确认/驳回响应") | |||
public class IssueOrderRefundResultResponseDTO extends BaseModel { | |||
private String id; | |||
public IssueOrderRefundResultResponseDTO(String id){ | |||
this.id = id; | |||
} | |||
} |
@@ -0,0 +1,26 @@ | |||
package cn.com.taiji.managew.dto.issueOrder; | |||
import cn.com.taiji.core.dto.AbstractStaffBizRequestDTO; | |||
import io.swagger.annotations.ApiModel; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
import javax.validation.constraints.NotBlank; | |||
/** | |||
* @Auther: humh | |||
* @Description: | |||
* @Date: 2025/5/19 16:29 | |||
* @email: huminghao@mail.taiji.com.cn | |||
* @version: 1.0 | |||
*/ | |||
@Setter | |||
@Getter | |||
@ApiModel(description = "退费管理查看详情请求") | |||
public class IssueOrderRefundViewRequestDTO extends AbstractStaffBizRequestDTO { | |||
@NotBlank | |||
private String id; | |||
} |
@@ -0,0 +1,96 @@ | |||
package cn.com.taiji.managew.dto.issueOrder; | |||
import cn.com.taiji.common.model.BaseModel; | |||
import cn.com.taiji.common.valid.BaseValidDTO; | |||
import cn.com.taiji.core.dto.AbstractStaffBizPageRequestDTO; | |||
import cn.com.taiji.core.dto.AbstractStaffBizRequestDTO; | |||
import cn.com.taiji.core.entity.dict.basic.UserType; | |||
import cn.com.taiji.core.entity.dict.issue.BankType; | |||
import cn.com.taiji.core.entity.dict.issue.RefundOperateType; | |||
import cn.com.taiji.core.entity.dict.issue.RefundStatus; | |||
import cn.com.taiji.core.entity.dict.operation.BusinessType; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
import javax.persistence.Column; | |||
import javax.persistence.EnumType; | |||
import javax.persistence.Enumerated; | |||
import javax.validation.constraints.NotBlank; | |||
import javax.validation.constraints.NotNull; | |||
import javax.validation.constraints.Size; | |||
import java.time.LocalDateTime; | |||
/** | |||
* @Auther: humh | |||
* @Description: | |||
* @Date: 2025/5/19 16:29 | |||
* @email: huminghao@mail.taiji.com.cn | |||
* @version: 1.0 | |||
*/ | |||
@Setter | |||
@Getter | |||
@ApiModel(description = "退费管理查看详情响应") | |||
public class IssueOrderRefundViewResponseDTO extends BaseModel { | |||
@ApiModelProperty(value = "申请时间") | |||
private LocalDateTime insertTime; | |||
@ApiModelProperty(value = "订单号") | |||
private String orderNo; | |||
@ApiModelProperty(value = "卡号") | |||
private String cardId; | |||
@ApiModelProperty(value = "车牌号") | |||
private String vehiclePlate; | |||
@ApiModelProperty(value = "车牌颜色") | |||
private Integer vehiclePlatecolor; | |||
@ApiModelProperty(value = "金额") | |||
private Long amount; | |||
@ApiModelProperty(value = "业务类型") | |||
private BusinessType businessPort; | |||
@ApiModelProperty(value = "申请人名称") | |||
private String userName; | |||
@ApiModelProperty(value = "申请人联系方式") | |||
private String userMobile; | |||
@ApiModelProperty(value = "退款方式") | |||
private RefundOperateType operateType; | |||
@ApiModelProperty(value = "原路返回类型") | |||
private String payReturnType; | |||
@ApiModelProperty(value = "退款金额") | |||
private Long refundAmount; | |||
@ApiModelProperty(value = "开户行") | |||
private BankType bankType; | |||
@ApiModelProperty(value = "银行卡号") | |||
private String bankCardId; | |||
@ApiModelProperty(value = "开户行所在的省") | |||
private String province; | |||
@ApiModelProperty(value = "开户行所在的市") | |||
private String sell; | |||
@ApiModelProperty(value = "开户人名称") | |||
private String cusName; | |||
@ApiModelProperty(value = "开户用户类型") | |||
private UserType cusType; | |||
@ApiModelProperty(value = "开户人联系方式") | |||
private String cusTel; | |||
@ApiModelProperty(value = "开户行支行名称") | |||
private String branchName; | |||
} |
@@ -0,0 +1,24 @@ | |||
package cn.com.taiji.managew.manager.issueOrder; | |||
import cn.com.taiji.common.manager.ManagerException; | |||
import cn.com.taiji.common.manager.net.http.ServiceHandleException; | |||
import cn.com.taiji.common.model.dao.Pagination; | |||
import cn.com.taiji.managew.dto.issueOrder.*; | |||
/** | |||
* @Auther: humh | |||
* @Description: | |||
* @Date: 2025/6/13 20:18 | |||
* @email: huminghao@mail.taiji.com.cn | |||
* @version: 1.0 | |||
*/ | |||
public interface IssueOrderRefundManager { | |||
Pagination page(IssueOrderRefundPageRequestDTO dto) throws ServiceHandleException; | |||
IssueOrderRefundViewResponseDTO view(IssueOrderRefundViewRequestDTO dto); | |||
IssueOrderRefundResultResponseDTO result(IssueOrderRefundResultRequestDTO dto) throws ManagerException; | |||
IssueOrderRefundExportResponseDTO export(IssueOrderRefundExportRequestDTO dto) throws ManagerException; | |||
} |
@@ -0,0 +1,107 @@ | |||
package cn.com.taiji.managew.manager.issueOrder; | |||
import cn.com.taiji.common.manager.ManagerException; | |||
import cn.com.taiji.common.manager.net.http.ServiceHandleException; | |||
import cn.com.taiji.common.model.dao.Pagination; | |||
import cn.com.taiji.common.pub.BeanTools; | |||
import cn.com.taiji.core.entity.dict.BucketFileBus; | |||
import cn.com.taiji.core.entity.dict.issue.RefundOperateType; | |||
import cn.com.taiji.core.entity.dict.issue.RefundStatus; | |||
import cn.com.taiji.core.entity.issue.IssueOrderRefund; | |||
import cn.com.taiji.core.entity.user.Staff; | |||
import cn.com.taiji.core.manager.tools.easyExcel.EasyExcelUtil; | |||
import cn.com.taiji.core.manager.tools.minio.MinioUtil; | |||
import cn.com.taiji.core.repo.jpa.issue.IssueOrderRefundRepo; | |||
import cn.com.taiji.core.repo.jpa.user.StaffRepo; | |||
import cn.com.taiji.core.repo.request.issue.IssueOrderRefundPageRequest; | |||
import cn.com.taiji.managew.dto.issueOrder.*; | |||
import cn.com.taiji.managew.manager.AbstractManagewManager; | |||
import cn.com.taiji.managew.model.excel.IssueOrderRefundExcelModel; | |||
import cn.com.taiji.managew.tools.SourceTargetMapper; | |||
import org.apache.commons.lang3.ObjectUtils; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.stereotype.Service; | |||
import java.io.File; | |||
import java.time.LocalDateTime; | |||
import java.util.List; | |||
/** | |||
* @Auther: humh | |||
* @Description: | |||
* @Date: 2025/6/13 20:18 | |||
* @email: huminghao@mail.taiji.com.cn | |||
* @version: 1.0 | |||
*/ | |||
@Service | |||
public class IssueOrderRefundManagerImpl extends AbstractManagewManager implements IssueOrderRefundManager { | |||
@Autowired | |||
private IssueOrderRefundRepo repo; | |||
@Autowired | |||
private StaffRepo staffRepo; | |||
@Autowired | |||
private MinioUtil minioUtil; | |||
@Override | |||
public Pagination page(IssueOrderRefundPageRequestDTO dto) throws ServiceHandleException { | |||
IssueOrderRefundPageRequest pageRequest = copyProperties(dto, new IssueOrderRefundPageRequest()); | |||
Staff staff = staffRepo.findByOpenId(findOpenIdByToken(dto.getAccessToken())); | |||
if (ObjectUtils.isNotEmpty(staff)){ | |||
pageRequest.setAgencyId(staff.getAgencyId()); | |||
if ("MANAGER".equals(staff.getIdentityType())){ | |||
pageRequest.setAgencyId(null); | |||
} | |||
} | |||
return repo.page(pageRequest); | |||
} | |||
@Override | |||
public IssueOrderRefundViewResponseDTO view(IssueOrderRefundViewRequestDTO dto) { | |||
IssueOrderRefund orderRefund = repo.findById(dto.getId()).orElse(null); | |||
return copyProperties(orderRefund, new IssueOrderRefundViewResponseDTO()); | |||
} | |||
@Override | |||
public IssueOrderRefundResultResponseDTO result(IssueOrderRefundResultRequestDTO dto) throws ManagerException { | |||
dto.valid(); | |||
IssueOrderRefund orderRefund = repo.findById(dto.getId()).orElse(null); | |||
LocalDateTime now = LocalDateTime.now(); | |||
if ("驳回".equals(dto.getCensorResult())){ | |||
orderRefund.setUpdateTime(now); | |||
orderRefund.setAuditTime(now); | |||
orderRefund.setStatus(RefundStatus.REJECT); | |||
}else { | |||
orderRefund.setUpdateTime(now); | |||
orderRefund.setUpdateTime(now); | |||
orderRefund.setStatus(RefundStatus.AUDITED); | |||
orderRefund.setOperateType(dto.getOperateType()); | |||
if (RefundOperateType.BANK.equals(dto.getOperateType())){ | |||
BeanTools.copyProperties(dto.getPaymentBankModel(), orderRefund); | |||
} | |||
} | |||
repo.merge(orderRefund); | |||
return new IssueOrderRefundResultResponseDTO(orderRefund.getId()); | |||
} | |||
@Override | |||
public IssueOrderRefundExportResponseDTO export(IssueOrderRefundExportRequestDTO dto) throws ManagerException { | |||
IssueOrderRefundPageRequest pageRequest = copyProperties(dto, new IssueOrderRefundPageRequest()); | |||
Staff staff = staffRepo.findByOpenId(findOpenIdByToken(dto.getAccessToken())); | |||
if (ObjectUtils.isNotEmpty(staff)){ | |||
pageRequest.setAgencyId(staff.getAgencyId()); | |||
if ("MANAGER".equals(staff.getIdentityType())){ | |||
pageRequest.setAgencyId(null); | |||
} | |||
} | |||
List<IssueOrderRefund> list = repo.list(pageRequest); | |||
List<IssueOrderRefundExcelModel> excelModelList = SourceTargetMapper.INSTANCE.orderRefundToModelList(list); | |||
File file = EasyExcelUtil.exportExcelFile(IssueOrderRefundExcelModel.class, excelModelList, "退费管理"); | |||
String filePath = minioUtil.fileUploadHttp(file, BucketFileBus.INVW); | |||
return new IssueOrderRefundExportResponseDTO(filePath); | |||
} | |||
} |
@@ -0,0 +1,176 @@ | |||
package cn.com.taiji.managew.model.excel; | |||
import cn.com.taiji.core.entity.dict.basic.UserType; | |||
import cn.com.taiji.core.entity.dict.issue.BankType; | |||
import cn.com.taiji.core.entity.dict.issue.RefundBusiness; | |||
import cn.com.taiji.core.entity.dict.issue.RefundOperateType; | |||
import cn.com.taiji.core.entity.dict.issue.RefundStatus; | |||
import cn.com.taiji.core.manager.tools.easyExcel.EasyExcelEnumConverter; | |||
import cn.com.taiji.core.manager.tools.easyExcel.LocalDateTimeConverter; | |||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | |||
import com.alibaba.excel.annotation.ExcelProperty; | |||
import com.alibaba.excel.annotation.write.style.*; | |||
import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
import java.time.LocalDateTime; | |||
/** | |||
* @Auther: humh | |||
* @Description: | |||
* @Date: 2025/6/14 10:27 | |||
* @email: huminghao@mail.taiji.com.cn | |||
* @version: 1.0 | |||
*/ | |||
@HeadStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER) | |||
@HeadFontStyle(fontHeightInPoints = 12) | |||
@ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.LEFT) | |||
@ContentFontStyle(fontHeightInPoints = 10, fontName = "宋体") | |||
@ExcelIgnoreUnannotated | |||
@Getter | |||
@Setter | |||
public class IssueOrderRefundExcelModel { | |||
@ColumnWidth(10) | |||
@ExcelProperty(value = "订单号", index = 0) | |||
private String orderNo; | |||
@ColumnWidth(10) | |||
@ExcelProperty(value = "卡号", index = 1) | |||
private String cardId; | |||
@ColumnWidth(10) | |||
@ExcelProperty(value = "车牌号", index = 2) | |||
private String vehiclePlate; | |||
@ColumnWidth(10) | |||
@ExcelProperty(value = "车牌颜色(0-蓝色,1-黄色,2-黑色,3-白色,4-渐变绿色,5-黄绿双拼色,6-蓝白渐变色,9-未确定,11-绿色,12-红色)", index = 3) | |||
private Integer vehiclePlatecolor; | |||
@ColumnWidth(10) | |||
@ExcelProperty(value = "车辆编号", index = 4) | |||
private String vehicleId; | |||
@ColumnWidth(10) | |||
@ExcelProperty(value = "金额(分)", index = 5) | |||
private Long amount; | |||
@ColumnWidth(10) | |||
@ExcelProperty(value = "退费原因", index = 6) | |||
private String refundReason; | |||
@ColumnWidth(10) | |||
@ExcelProperty(value = "状态", index = 7, converter = EasyExcelEnumConverter.class) | |||
private RefundStatus status; | |||
@ColumnWidth(10) | |||
@ExcelProperty(value = "退费失败原因", index = 8) | |||
private String failReason; | |||
@ColumnWidth(10) | |||
@ExcelProperty(value = "业务端口", index = 9, converter = EasyExcelEnumConverter.class) | |||
private RefundBusiness businessPort; | |||
@ColumnWidth(10) | |||
@ExcelProperty(value = "业务员", index = 10) | |||
private String salesmanOpenId; | |||
@ColumnWidth(10) | |||
@ExcelProperty(value = "审核时间", index = 11) | |||
private LocalDateTime auditTime; | |||
@ColumnWidth(10) | |||
@ExcelProperty(value = "申请人名称", index = 12) | |||
private String userName; | |||
@ColumnWidth(10) | |||
@ExcelProperty(value = "申请人联系方式", index = 13) | |||
private String userMobile; | |||
@ColumnWidth(10) | |||
@ExcelProperty(value = "退费时间", index = 14) | |||
private LocalDateTime refundTime; | |||
@ColumnWidth(10) | |||
@ExcelProperty(value = "开户行", index = 15, converter = EasyExcelEnumConverter.class) | |||
private BankType bankType; | |||
@ColumnWidth(10) | |||
@ExcelProperty(value = "开户行所在的省", index = 16) | |||
private String province; | |||
@ColumnWidth(10) | |||
@ExcelProperty(value = "开户行所在的市", index = 17) | |||
private String sell; | |||
@ColumnWidth(10) | |||
@ExcelProperty(value = "开户人名称", index = 18) | |||
private String cusName; | |||
@ColumnWidth(10) | |||
@ExcelProperty(value = "开户人联系方式", index = 19) | |||
private String cusTel; | |||
@ColumnWidth(10) | |||
@ExcelProperty(value = "开户用户类型", index = 20, converter = EasyExcelEnumConverter.class) | |||
private UserType cusType; | |||
@ColumnWidth(10) | |||
@ExcelProperty(value = "退款方式", index = 21, converter = EasyExcelEnumConverter.class) | |||
private RefundOperateType operateType; | |||
@ColumnWidth(10) | |||
@ExcelProperty(value = "开户行支行名称", index = 22) | |||
private String branchName; | |||
@ColumnWidth(10) | |||
@ExcelProperty(value = "退款金额(分)", index = 23) | |||
private Long refundAmount; | |||
@ColumnWidth(10) | |||
@ExcelProperty(value = "银行卡号", index = 24) | |||
private String bankCardId; | |||
@ColumnWidth(10) | |||
@ExcelProperty(value = "支付配置编号", index = 25) | |||
private String payConfigId; | |||
@ColumnWidth(10) | |||
@ExcelProperty(value = "支付订单号", index = 26) | |||
private String externalOrderNo; | |||
@ColumnWidth(10) | |||
@ExcelProperty(value = "退费订单号", index = 27) | |||
private String externalRefundNo; | |||
@ColumnWidth(10) | |||
@ExcelProperty(value = "退费申请次数", index = 28) | |||
private Integer applyNum; | |||
@ColumnWidth(10) | |||
@ExcelProperty(value = "结算人员", index = 29) | |||
private String settlementOpenId; | |||
@ColumnWidth(10) | |||
@ExcelProperty(value = "付款银行", index = 30, converter = EasyExcelEnumConverter.class) | |||
private BankType paymentBankType; | |||
@ColumnWidth(10) | |||
@ExcelProperty(value = "付款银行卡号", index = 31) | |||
private String paymentBankCardId; | |||
@ColumnWidth(10) | |||
@ExcelProperty(value = "原路返回类型", index = 32) | |||
private String payReturnType; | |||
@ColumnWidth(10) | |||
@ExcelProperty(value = "设备类型", index = 33) | |||
private String deviceType; | |||
@ColumnWidth(10) | |||
@ExcelProperty(value = "创建时间", index = 34) | |||
private LocalDateTime insertTime; | |||
} |
@@ -0,0 +1,45 @@ | |||
package cn.com.taiji.managew.model.issueOrder; | |||
import cn.com.taiji.common.model.BaseModel; | |||
import cn.com.taiji.core.entity.dict.basic.UserType; | |||
import cn.com.taiji.core.entity.dict.issue.BankType; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
/** | |||
* @Auther: humh | |||
* @Description: | |||
* @Date: 2025/6/14 9:41 | |||
* @email: huminghao@mail.taiji.com.cn | |||
* @version: 1.0 | |||
*/ | |||
@Getter | |||
@Setter | |||
public class PaymentBankModel extends BaseModel { | |||
@ApiModelProperty("开户行") | |||
private BankType bankType; | |||
@ApiModelProperty(value = "银行卡号") | |||
private String bankCardId; | |||
@ApiModelProperty(value = "开户行所在的省") | |||
private String province; | |||
@ApiModelProperty(value = "开户行所在的市") | |||
private String sell; | |||
@ApiModelProperty(value = "开户人名称") | |||
private String cusName; | |||
@ApiModelProperty(value = "开户用户类型") | |||
private UserType cusType; | |||
@ApiModelProperty(value = "开户人联系方式") | |||
private String cusTel; | |||
@ApiModelProperty(value = "开户行支行名称") | |||
private String branchName; | |||
} |
@@ -1,9 +1,11 @@ | |||
package cn.com.taiji.managew.tools; | |||
import cn.com.taiji.core.entity.issue.IssueOrderRefund; | |||
import cn.com.taiji.core.model.comm.protocol.bls.CardQueryModel; | |||
import cn.com.taiji.core.model.comm.protocol.bls.ObuQueryModel; | |||
import cn.com.taiji.managew.model.bls.BlackCardQueryModel; | |||
import cn.com.taiji.managew.model.bls.BlackObuQueryModel; | |||
import cn.com.taiji.managew.model.excel.IssueOrderRefundExcelModel; | |||
import org.mapstruct.Mapper; | |||
import org.mapstruct.ReportingPolicy; | |||
import org.mapstruct.factory.Mappers; | |||
@@ -20,4 +22,5 @@ public interface SourceTargetMapper { | |||
List<BlackObuQueryModel> resultListToBlackObuQueryModelList(List<ObuQueryModel> model); | |||
List<IssueOrderRefundExcelModel> orderRefundToModelList(List<IssueOrderRefund> model); | |||
} |