Commit bc1b1b61 authored by 黎博's avatar 黎博

新增redis存储,以及/api/afterSaleNew/getApplyDetailInfo

parent dbf20582
......@@ -296,6 +296,10 @@ public class OrderController {
*/
@PostMapping("/api/afterSaleNew/createAfsApply")
public JdAfterSaleApplyResponse createAfsApply(String token, String param) {
AfsApplyRequest.ApplyParam applyParam = JSON.parseObject(param, AfsApplyRequest.ApplyParam.class);
String orderId = applyParam.getOrderId();
// 设置缓存,给后续接口使用
redisUtils.set("afs:apply:" + orderId, JSON.toJSONString(applyParam));
JdAfterSaleApplyResponse response = new JdAfterSaleApplyResponse();
response.setSuccess(true);
response.setResultCode("0000");
......@@ -352,6 +356,50 @@ public class OrderController {
afsOutlinePage.setData(applyInfoList);
response.setResult(afsOutlinePage);
redisUtils.set("afs:outline:" + afsOutlineParam.getOrderId(), JSON.toJSONString(afsOutlineParam));
return response;
}
/**
* 9.8 查询售后申请单明细
*/
@PostMapping("/api/afterSaleNew/getApplyDetailInfo")
public AfsApplyDetailResponse getApplyDetailInfo(String token, String param) {
AfsApplyDetailRequest.ApplyDetailParam applyDetailParam = new AfsApplyDetailRequest.ApplyDetailParam();
AfsApplyDetailResponse response = new AfsApplyDetailResponse();
response.setSuccess(true);
response.setResultMessage("操作成功");
response.setResultCode("0000");
AfsApplyDetailResponse.AfsApplyDetailDto applyDetailDto = new AfsApplyDetailResponse.AfsApplyDetailDto();
applyDetailDto.setRefundInfoResultDtos(null);
List<AfsApplyDetailResponse.AddressInfoDto> addressInfoDtoList = new ArrayList<>();
AfsApplyDetailResponse.AddressInfoDto addressInfoDto = new AfsApplyDetailResponse.AddressInfoDto();
// 设置AddressInfoDto
addressInfoDto.setCustomerPin("北京量化派VOP");
addressInfoDto.setNewOrderId(null);
addressInfoDto.setThirdApplyId(applyDetailParam.getThirdApplyId());
addressInfoDto.setOriginalOrderId(applyDetailParam.getOrderId());
addressInfoDto.setOrderId(applyDetailParam.getOrderId());
addressInfoDto.setAfterserviceType(30);
addressInfoDto.setAfterserviceProvince(0);
addressInfoDto.setAfterserviceCity(0);
addressInfoDto.setAfterserviceCounty(0);
addressInfoDto.setAfterserviceVillage(0);
addressInfoDto.setAfterserviceAddress("北京市市辖区海淀区中国电子大厦B座");
addressInfoDto.setAfterserviceReceiver("WTJD售后组");
addressInfoDto.setAfterserviceTel("13691060671");
addressInfoDto.setAfterserviceZipcode("");
addressInfoDto.setAfterservicePhone("");
addressInfoDtoList.add(addressInfoDto);
applyDetailDto.setAddressInfoDtos(addressInfoDtoList);
response.setResult(applyDetailDto);
return response;
}
......@@ -361,13 +409,13 @@ public class OrderController {
* @return
*/
@PostMapping("/api/message/get")
public JSONObject qygMessageGet(JdCompanyMsgRequest request) {
public JdCompanyMsgResponse qygMessageGet(JdCompanyMsgRequest request) {
String type = request.getType();
JSONObject response = new JSONObject();
response.put("success", true);
response.put("resultMessage", "");
response.put("resultCode", "0000");
JSONArray result = new JSONArray();
JdCompanyMsgResponse response = new JdCompanyMsgResponse();
response.setSuccess(true);
response.setResultMessage("");
response.setResultCode("0000");
List<Map<String, Object>> result = new ArrayList<>();
switch (type) {
case "10":
// TODO
......@@ -375,10 +423,36 @@ public class OrderController {
case "31":
// TODO
break;
case "104":
Set<String> set = redisUtils.keys("afs:outline:*");
if (!set.isEmpty()) {
for (String afsOutlineStr: set) {
AfsOutlineRequest.AfsOutlineParam afsOutlineParam = JSON.parseObject(afsOutlineStr, AfsOutlineRequest.AfsOutlineParam.class);
Map<String, Object> map = new HashMap<>();
map.put("id", RandomStringUtils.randomNumeric(16));
map.put("time", DateUtils.convertDate(new Date(), "yyyy-mm-dd hh:MM:ss"));
map.put("type", 104);
Map<String, Object> childMap = new HashMap<>();
childMap.put("expectationChanged", true);
childMap.put("thirdApplyId", afsOutlineParam.getThirdApplyId());
childMap.put("pin", "北京量化派VOP");
childMap.put("stepPassType", 10);
childMap.put("isOffline", false);
childMap.put("applyStep", 60);
childMap.put("contractNumber", "VOP-20201209182245");
childMap.put("orderId", afsOutlineParam.getOrderId());
map.put("result", childMap);
// 处理完就删除
redisUtils.del("afs:outline:" + afsOutlineParam.getOrderId());
result.add(map);
}
}
break;
default:
break;
}
response.put("result", result);
response.setResult(result);
return response;
}
......
package cn.qg.holmes.entity.mock.keystone.jdbuy;
import lombok.Data;
import java.util.List;
/**
* 9.8 查询售后申请单明细
*/
@Data
public class AfsApplyDetailRequest {
private ApplyDetailParam param;
@Data
public static class ApplyDetailParam{
private Long orderId; //订单号,即京东子单号
private String thirdApplyId; //第三方申请单号
private List<Integer> appendInfoSteps; //获取信息模块:1、代表增加获取退款明细; 2、代表增加获取客户发货信息
}
}
package cn.qg.holmes.entity.mock.keystone.jdbuy;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* 9.8 查询售后申请单明细
*/
@Data
public class AfsApplyDetailResponse extends JdBaseResponse{
private AfsApplyDetailDto result;
@Data
public static class AfsApplyDetailDto{
private List<AfsRefundInfoResultDto> refundInfoResultDtos; //申请单维度退款明细
private List<AddressInfoDto> addressInfoDtos; //客户送货售后方式时邮寄地址
}
@Data
public static class AfsRefundInfoResultDto {
private String thirdApplyId; //客售后申请单号
private String originalOrderId; //京东订单号
private BigDecimal refundAmount; //退款⾦额
//@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date modifyDate; //完成时间
private List<RefundDetailVo> refundDetailDtos; //退款明细
private List<RefundPayVo> refundPayDtos; //退款明细涉及的⽀付信息
private List<RefundWareVo> refundWareDtos; //退款商品明细
}
@Data
public static class RefundDetailVo{
private String refundSourceId; //申请单退款明细ID:与⽀付实体中⼀致
private String payId; //⽀付单号
private Integer refundType; //退款类型
private Integer refundJdBankId; //退款平台编号
private String refundJdBankName; //退款银⾏名称(⼯商银⾏,招商银⾏等)
private BigDecimal refundAmount; //退款⾦额
private Long simpleCodeBankId; //公司账号银⾏简码ID
}
@Data
public static class RefundPayVo{
private String refundSourceId; //申请单退款明细ID:与⽀付实体中⼀致
private String payId; //⽀付单号
private Integer payType; //⽀付类型
private Integer payEnum; //⽀付枚举
private Integer payFlag; //个⼈或企业,1:个⼈;2:企业
private Integer busPayType; //企业⽀付⽅式,混合⽀付必填
private BigDecimal refundableAmount; //涉及到退款⾦额
}
@Data
public static class RefundWareVo{
private String skuId; //商品编号
private String skuName; //商品名称
private Integer wareNumber; //商品数量
}
@Data
public static class AddressInfoDto{
private String customerPin; //企业PIN
private Long orderId; //订单号
private Long newOrderId; //换新订单号
private Long originalOrderId; //原始订单号
private String thirdApplyId; //三方申请单号
private Integer afterserviceType; //售后类型
private Integer afterserviceProvince; //售后省份
private Integer afterserviceCity; //售后城市
private Integer afterserviceCounty; //售后县城
private Integer afterserviceVillage; //售后城镇
private String afterserviceAddress; //售后地址
private String afterserviceReceiver; //售后收货人
private String afterserviceTel; //售后收货人电话
private String afterserviceZipcode; //售后邮编
private String afterservicePhone; //售后电话
}
}
package cn.qg.holmes.entity.mock.keystone.jdbuy;
import lombok.Data;
import java.util.List;
import java.util.Map;
/**
* 11.1 查询推送消息
*/
@Data
public class JdCompanyMsgResponse extends JdBaseResponse{
private List<Map<String, Object>> result;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment