init
This commit is contained in:
@@ -0,0 +1,109 @@
|
||||
package org.springblade.modules.advertisement.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springblade.core.boot.ctrl.BladeController;
|
||||
import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springblade.modules.advertisement.entity.Advertisement;
|
||||
import org.springblade.modules.advertisement.service.IAdvertisementService;
|
||||
import org.springblade.modules.advertisement.vo.AdvertisementVO;
|
||||
import org.springblade.modules.advertisement.wrapper.AdvertisementWrapper;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 自营广告 控制器
|
||||
*
|
||||
* @author 刘玮杰
|
||||
* @since 2023-06-16
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/miscellaneous/advertisement")
|
||||
@Api(value = "自营广告", tags = "自营广告接口")
|
||||
public class AdvertisementController extends BladeController {
|
||||
|
||||
private final IAdvertisementService advertisementService;
|
||||
|
||||
/**
|
||||
* 自营广告 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@ApiOperation(value = "详情", notes = "传入advertisement")
|
||||
public R<AdvertisementVO> detail(Advertisement advertisement) {
|
||||
Advertisement detail = advertisementService.getOne(Condition.getQueryWrapper(advertisement));
|
||||
return R.data(AdvertisementWrapper.build().entityVO(detail));
|
||||
}
|
||||
/**
|
||||
* 自营广告 分页
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@ApiOperation(value = "分页", notes = "传入advertisement")
|
||||
public R<IPage<AdvertisementVO>> list(Advertisement advertisement, Query query) {
|
||||
IPage<Advertisement> pages = advertisementService.page(Condition.getPage(query), Condition.getQueryWrapper(advertisement));
|
||||
return R.data(AdvertisementWrapper.build().pageVO(pages));
|
||||
}
|
||||
|
||||
/**
|
||||
* 自营广告 自定义分页
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@ApiOperation(value = "分页", notes = "传入advertisement")
|
||||
public R<IPage<AdvertisementVO>> page(AdvertisementVO advertisement, Query query) {
|
||||
IPage<AdvertisementVO> pages = advertisementService.selectAdvertisementPage(Condition.getPage(query), advertisement);
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
/**
|
||||
* 自营广告 新增
|
||||
*/
|
||||
@PostMapping("/save")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@ApiOperation(value = "新增", notes = "传入advertisement")
|
||||
public R save(@Valid @RequestBody Advertisement advertisement) {
|
||||
return R.status(advertisementService.save(advertisement));
|
||||
}
|
||||
|
||||
/**
|
||||
* 自营广告 修改
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@ApiOperation(value = "修改", notes = "传入advertisement")
|
||||
public R update(@Valid @RequestBody Advertisement advertisement) {
|
||||
return R.status(advertisementService.updateById(advertisement));
|
||||
}
|
||||
|
||||
/**
|
||||
* 自营广告 新增或修改
|
||||
*/
|
||||
@PostMapping("/submit")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@ApiOperation(value = "新增或修改", notes = "传入advertisement")
|
||||
public R submit(@Valid @RequestBody Advertisement advertisement) {
|
||||
return R.status(advertisementService.saveOrUpdate(advertisement));
|
||||
}
|
||||
|
||||
/**
|
||||
* 自营广告 删除
|
||||
*/
|
||||
@PostMapping("/remove")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@ApiOperation(value = "逻辑删除", notes = "传入ids")
|
||||
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
|
||||
return R.status(advertisementService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package org.springblade.modules.advertisement.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springblade.modules.advertisement.entity.Advertisement;
|
||||
|
||||
/**
|
||||
* 自营广告 数据传输对象实体类
|
||||
*
|
||||
* @author 刘玮杰
|
||||
* @since 2023-06-16
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class AdvertisementDTO extends Advertisement {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package org.springblade.modules.advertisement.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springblade.core.mp.base.BaseEntity;
|
||||
|
||||
/**
|
||||
* 自营广告 实体类
|
||||
*
|
||||
* @author 刘玮杰
|
||||
* @since 2023-06-16
|
||||
*/
|
||||
@Data
|
||||
@TableName("self_advertisement")
|
||||
@ApiModel(value = "Advertisement对象", description = "自营广告")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class Advertisement extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 广告地址
|
||||
*/
|
||||
@ApiModelProperty(value = "广告地址")
|
||||
private String mediaUrl;
|
||||
/**
|
||||
* 外挑地址
|
||||
*/
|
||||
@ApiModelProperty(value = "外挑地址")
|
||||
private String outUrl;
|
||||
/**
|
||||
* 总时长
|
||||
*/
|
||||
@ApiModelProperty(value = "总时长")
|
||||
private Integer totalDuration;
|
||||
/**
|
||||
* 最短时长
|
||||
*/
|
||||
@ApiModelProperty(value = "最短时长")
|
||||
private Integer minimumDuration;
|
||||
/**
|
||||
* 媒体类型 1-视频 2-图片
|
||||
*/
|
||||
@ApiModelProperty(value = "媒体类型 1-视频 2-图片")
|
||||
private Integer mediaType;
|
||||
/**
|
||||
* 广告类型 1-开屏 2-任务
|
||||
*/
|
||||
@ApiModelProperty(value = "广告类型 1-开屏 2-任务")
|
||||
private Integer advertisementType;
|
||||
/**
|
||||
* 备忘
|
||||
*/
|
||||
@ApiModelProperty(value = "备忘")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package org.springblade.modules.advertisement.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.modules.advertisement.entity.Advertisement;
|
||||
import org.springblade.modules.advertisement.vo.AdvertisementVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 自营广告 Mapper 接口
|
||||
*
|
||||
* @author 刘玮杰
|
||||
* @since 2023-06-16
|
||||
*/
|
||||
public interface AdvertisementMapper extends BaseMapper<Advertisement> {
|
||||
|
||||
/**
|
||||
* 自定义分页
|
||||
*
|
||||
* @param page
|
||||
* @param advertisement
|
||||
* @return
|
||||
*/
|
||||
List<AdvertisementVO> selectAdvertisementPage(IPage page, AdvertisementVO advertisement);
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.springblade.modules.advertisement.mapper.AdvertisementMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="advertisementResultMap" type="org.springblade.modules.advertisement.entity.Advertisement">
|
||||
<result column="id" property="id"/>
|
||||
<result column="media_url" property="mediaUrl"/>
|
||||
<result column="out_url" property="outUrl"/>
|
||||
<result column="total_duration" property="totalDuration"/>
|
||||
<result column="minimum_duration" property="minimumDuration"/>
|
||||
<result column="media_type" property="mediaType"/>
|
||||
<result column="advertisement_type" property="advertisementType"/>
|
||||
<result column="remark" property="remark"/>
|
||||
<result column="create_user" property="createUser"/>
|
||||
<result column="create_dept" property="createDept"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_user" property="updateUser"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="status" property="status"/>
|
||||
<result column="is_deleted" property="isDeleted"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="selectAdvertisementPage" resultMap="advertisementResultMap">
|
||||
select * from self_advertisement where is_deleted = 0
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,27 @@
|
||||
package org.springblade.modules.advertisement.service.impl;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.core.mp.base.BaseServiceImpl;
|
||||
import org.springblade.modules.advertisement.entity.Advertisement;
|
||||
import org.springblade.modules.advertisement.mapper.AdvertisementMapper;
|
||||
import org.springblade.modules.advertisement.service.IAdvertisementService;
|
||||
import org.springblade.modules.advertisement.vo.AdvertisementVO;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 自营广告 服务实现类
|
||||
*
|
||||
* @author 刘玮杰
|
||||
* @since 2023-06-16
|
||||
*/
|
||||
@Service
|
||||
public class AdvertisementServiceImpl extends BaseServiceImpl<AdvertisementMapper, Advertisement> implements IAdvertisementService {
|
||||
|
||||
@Override
|
||||
public IPage<AdvertisementVO> selectAdvertisementPage(IPage<AdvertisementVO> page, AdvertisementVO advertisement) {
|
||||
return page.setRecords(baseMapper.selectAdvertisementPage(page, advertisement));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package org.springblade.modules.advertisement.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springblade.modules.advertisement.entity.Advertisement;
|
||||
|
||||
/**
|
||||
* 自营广告 视图实体类
|
||||
*
|
||||
* @author 刘玮杰
|
||||
* @since 2023-06-16
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class AdvertisementVO extends Advertisement {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package org.springblade.modules.advertisement.wrapper;
|
||||
|
||||
import org.springblade.core.mp.support.BaseEntityWrapper;
|
||||
import org.springblade.core.tool.utils.BeanUtil;
|
||||
import org.springblade.modules.advertisement.entity.Advertisement;
|
||||
import org.springblade.modules.advertisement.vo.AdvertisementVO;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 自营广告 包装类,返回视图层所需的字段
|
||||
*
|
||||
* @author 刘玮杰
|
||||
* @since 2023-06-16
|
||||
*/
|
||||
public class AdvertisementWrapper extends BaseEntityWrapper<Advertisement, AdvertisementVO> {
|
||||
|
||||
public static AdvertisementWrapper build() {
|
||||
return new AdvertisementWrapper();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AdvertisementVO entityVO(Advertisement advertisement) {
|
||||
AdvertisementVO advertisementVO = Objects.requireNonNull(BeanUtil.copy(advertisement, AdvertisementVO.class));
|
||||
|
||||
//User createUser = UserCache.getUser(advertisement.getCreateUser());
|
||||
//User updateUser = UserCache.getUser(advertisement.getUpdateUser());
|
||||
//advertisementVO.setCreateUserName(createUser.getName());
|
||||
//advertisementVO.setUpdateUserName(updateUser.getName());
|
||||
|
||||
return advertisementVO;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
|
||||
package org.springblade.modules.alibaba.ocean.rawsdk.client.http;
|
||||
|
||||
import org.springblade.modules.alibaba.ocean.rawsdk.client.Response;
|
||||
import org.springblade.modules.alibaba.ocean.rawsdk.client.policy.ClientPolicy;
|
||||
import org.springblade.modules.alibaba.ocean.rawsdk.client.policy.Protocol;
|
||||
import org.springblade.modules.alibaba.ocean.rawsdk.client.policy.RequestPolicy;
|
||||
import org.springblade.modules.alibaba.ocean.rawsdk.client.serialize.DeSerializerListener;
|
||||
import org.springblade.modules.alibaba.ocean.rawsdk.client.serialize.Serializer;
|
||||
import org.springblade.modules.alibaba.ocean.rawsdk.client.serialize.SerializerListener;
|
||||
import org.springblade.modules.alibaba.ocean.rawsdk.client.serialize.SerializerProvider;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author hongbang.hb
|
||||
*
|
||||
*/
|
||||
public abstract class AbstractHttpClient {
|
||||
|
||||
private SerializerProvider serializerProvider;
|
||||
private HttpResponseBuilder responseBuilder;
|
||||
|
||||
public AbstractHttpClient(SerializerProvider serializerProvider, HttpResponseBuilder responseBuilder) {
|
||||
super();
|
||||
this.serializerProvider = serializerProvider;
|
||||
this.responseBuilder = responseBuilder;
|
||||
}
|
||||
|
||||
public Response request(InvokeContext invokeContext, ClientPolicy clientPolicy,
|
||||
Collection<SerializerListener> serializerListners, Collection<DeSerializerListener> deSerializerListners)
|
||||
throws IOException {
|
||||
// create the path. The pass is used when signature the request.
|
||||
StringBuilder protocolRequestPath = HttpSupport.getProtocolRequestPath(invokeContext, clientPolicy);
|
||||
// generate the http parameters, include the system parameters.
|
||||
Protocol protocol = invokeContext.getPolicy().getRequestProtocol();
|
||||
Serializer serializer = serializerProvider.getSerializer(protocol.name());
|
||||
for (SerializerListener serializerListener : serializerListners) {
|
||||
serializer.registeSerializerListener(serializerListener);
|
||||
}
|
||||
Map<String, Object> parameters = HttpSupport.buildParams(serializer, invokeContext);
|
||||
// signature the request
|
||||
HttpSupport.signature(protocolRequestPath, parameters, invokeContext.getPolicy(), clientPolicy);
|
||||
|
||||
if (RequestPolicy.HttpMethodPolicy.GET.equals(invokeContext.getPolicy().getHttpMethod())) {
|
||||
URL getURL = HttpSupport.buildGetRequestUrl(clientPolicy, invokeContext, parameters);
|
||||
Response response = this.doGet(getURL, parameters, invokeContext, clientPolicy, deSerializerListners);
|
||||
return response;
|
||||
} else {
|
||||
URL postURL = HttpSupport.buildPostRequestUrl(clientPolicy, invokeContext, parameters);
|
||||
for (Map.Entry<String, Object> entry : parameters.entrySet()) {
|
||||
Object inputValue = entry.getValue();
|
||||
if (inputValue.getClass().isAssignableFrom(byte[].class)
|
||||
|| inputValue.getClass().isAssignableFrom(Byte[].class)) {
|
||||
return this.doMultipartPost(postURL, parameters, invokeContext, clientPolicy, deSerializerListners);
|
||||
}
|
||||
}
|
||||
Response response = this.doPost(postURL, parameters, invokeContext, clientPolicy, deSerializerListners);
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract Response doMultipartPost(URL url, Map<String, Object> parameters, InvokeContext invokeContext,
|
||||
ClientPolicy clientPolicy, Collection<DeSerializerListener> deSerializerListners) throws IOException;
|
||||
|
||||
protected abstract Response doPost(URL url, Map<String, Object> parameters, InvokeContext invokeContext,
|
||||
ClientPolicy clientPolicy, Collection<DeSerializerListener> deSerializerListners) throws IOException;
|
||||
|
||||
protected abstract Response doGet(URL url, Map<String, Object> parameters, InvokeContext invokeContext,
|
||||
ClientPolicy clientPolicy, Collection<DeSerializerListener> deSerializerListners) throws IOException;
|
||||
|
||||
public SerializerProvider getSerializerProvider() {
|
||||
return serializerProvider;
|
||||
}
|
||||
|
||||
public HttpResponseBuilder getResponseBuilder() {
|
||||
return responseBuilder;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
|
||||
package org.springblade.modules.alibaba.ocean.rawsdk.client.imp.serialize;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.springblade.modules.alibaba.ocean.rawsdk.client.entity.ResponseWrapper;
|
||||
import org.springblade.modules.alibaba.ocean.rawsdk.client.serialize.DeSerializer;
|
||||
import org.springblade.modules.alibaba.ocean.rawsdk.client.util.LoggerHelper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.Reader;
|
||||
import java.text.ParseException;
|
||||
|
||||
/**
|
||||
* @author hongbang.hb
|
||||
*
|
||||
*/
|
||||
public abstract class AbstractJsonDeserializer implements DeSerializer {
|
||||
|
||||
public abstract <T> ResponseWrapper<T> deSerialize(String content, Class<T> resultType);
|
||||
|
||||
public abstract Throwable buildException(String content, int statusCode);
|
||||
|
||||
public <T> ResponseWrapper<T> deSerialize(InputStream istream, Class<T> resultType, String charSet)
|
||||
throws IOException, ParseException {
|
||||
LoggerHelper.getClientLogger().finer("Parse body by json.");
|
||||
String content = getStreamAsString(istream, charSet);
|
||||
return deSerialize(content, resultType);
|
||||
}
|
||||
|
||||
public Throwable buildException(InputStream inputStream, int statusCode, String charSet) throws IOException,
|
||||
ParseException {
|
||||
LoggerHelper.getClientLogger().finer("Parse body by json.");
|
||||
String content = getStreamAsString(inputStream, charSet);
|
||||
return buildException(content, statusCode);
|
||||
}
|
||||
|
||||
protected <T> T parseResult(JSONObject json, Class<T> resultType) {
|
||||
LoggerHelper.getClientLogger().finer("Parse body by json.");
|
||||
T result = JSON.toJavaObject(json, resultType);
|
||||
return result;
|
||||
}
|
||||
|
||||
private String getStreamAsString(InputStream stream, String charset) throws IOException {
|
||||
|
||||
Reader reader = new InputStreamReader(stream, charset);
|
||||
StringBuilder response = new StringBuilder();
|
||||
|
||||
final char[] buff = new char[1024];
|
||||
int read = 0;
|
||||
while ((read = reader.read(buff)) > 0) {
|
||||
response.append(buff, 0, read);
|
||||
}
|
||||
return response.toString();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
|
||||
package org.springblade.modules.alibaba.ocean.rawsdk.client.imp.serialize;
|
||||
|
||||
import org.springblade.modules.alibaba.ocean.rawsdk.client.serialize.Serializer;
|
||||
import org.springblade.modules.alibaba.ocean.rawsdk.client.serialize.SerializerListener;
|
||||
import org.springblade.modules.alibaba.ocean.rawsdk.util.DateUtil;
|
||||
import org.springblade.modules.alibaba.ocean.rawsdk.util.DefaultPropertyUtils;
|
||||
import org.springblade.modules.alibaba.ocean.rawsdk.util.GenericsUtil;
|
||||
import org.springblade.modules.alibaba.ocean.rawsdk.util.SimplePropertyDescriptor;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Date;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* @author hongbang.hb
|
||||
*
|
||||
*/
|
||||
public abstract class AbstractParamRequestSerializer implements Serializer {
|
||||
|
||||
private Map<Class<? extends SerializerListener>, SerializerListener> listnerList = new LinkedHashMap<Class<? extends SerializerListener>, SerializerListener>();
|
||||
|
||||
abstract protected String processNestedParameter(Object value);
|
||||
|
||||
public Map<String, Object> serialize(Object serializer) {
|
||||
if(serializer==null){
|
||||
return new LinkedHashMap<String, Object>();
|
||||
}
|
||||
Map<String, Object> params = new LinkedHashMap<String, Object>();
|
||||
SimplePropertyDescriptor[] propertyDescriptors = DefaultPropertyUtils.getPropertyDescriptors(serializer.getClass());
|
||||
|
||||
for (SimplePropertyDescriptor propertyDescriptor : propertyDescriptors) {
|
||||
String name = propertyDescriptor.getName();
|
||||
if (name.equals("class")) {
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
Method method = propertyDescriptor.getReadMethod();
|
||||
if (method == null) {
|
||||
// 对于Boolean的返回值,也许API生成的isXXX方法,补救一下
|
||||
if (Boolean.class.isAssignableFrom(propertyDescriptor.getPropertyType())) {
|
||||
Method booleanMethod = null;
|
||||
try {
|
||||
booleanMethod = serializer.getClass().getMethod("is" + GenericsUtil.capitalize(name));
|
||||
} catch (NoSuchMethodException e) {
|
||||
//ignore, use default
|
||||
} catch (SecurityException e) {
|
||||
//ignore, use default
|
||||
}
|
||||
method = booleanMethod;
|
||||
}
|
||||
}
|
||||
if (method == null) {
|
||||
throw new RuntimeException("Could not parse the property[" + name + "] of "
|
||||
+ serializer.getClass().getSimpleName());
|
||||
}
|
||||
Object value = method.invoke(serializer);
|
||||
|
||||
if (value != null) {
|
||||
Class<?> valueType = value.getClass();
|
||||
String valueStr;
|
||||
if (valueType.isPrimitive() || CharSequence.class.isAssignableFrom(valueType)
|
||||
|| Number.class.isAssignableFrom(valueType) || Boolean.class.equals(valueType)
|
||||
|| Character.class.equals(valueType)) {
|
||||
valueStr = value.toString();
|
||||
} else if (Date.class.isAssignableFrom(valueType)) {
|
||||
valueStr = DateUtil.format((Date) value);
|
||||
} else {
|
||||
valueStr = processNestedParameter(value);
|
||||
// valueStr = JsonSerializeHelper.object2json(value);
|
||||
}
|
||||
params.put(name, valueStr);
|
||||
}
|
||||
|
||||
} catch (InvocationTargetException e) {
|
||||
throw new IllegalArgumentException("illegal argument " + name + ", error:" + e.getMessage(), e);
|
||||
} catch (IllegalAccessException e) {
|
||||
throw new IllegalArgumentException("illegal argument " + name + ", error:" + e.getMessage(), e);
|
||||
} catch (IllegalArgumentException e) {
|
||||
throw new IllegalArgumentException("illegal argument " + name + ", error:" + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
for (SerializerListener serializerListener : listnerList.values()) {
|
||||
serializerListener.onRequestSerialized(params);
|
||||
}
|
||||
return params;
|
||||
}
|
||||
|
||||
public void registeSerializerListener(SerializerListener listner) {
|
||||
if (!listnerList.containsKey(listner.getClass())) {
|
||||
listnerList.put(listner.getClass(), listner);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
|
||||
package org.springblade.modules.alibaba.ocean.rawsdk.common;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.springblade.modules.alibaba.ocean.rawsdk.client.APIId;
|
||||
import org.springblade.modules.alibaba.ocean.rawsdk.client.policy.RequestPolicy;
|
||||
|
||||
import java.lang.reflect.ParameterizedType;
|
||||
import java.lang.reflect.Type;
|
||||
|
||||
|
||||
/**
|
||||
* @author hongbang.hb
|
||||
*
|
||||
*/
|
||||
@Setter
|
||||
@Getter
|
||||
public abstract class AbstractAPIRequest<TResponse> {
|
||||
|
||||
protected RequestPolicy oceanRequestPolicy = new RequestPolicy();
|
||||
|
||||
protected APIId oceanApiId;
|
||||
|
||||
protected String traceId;
|
||||
|
||||
protected String rpcId;
|
||||
|
||||
public Class<TResponse> getResponseClass() {
|
||||
Type type = this.getClass().getGenericSuperclass();
|
||||
|
||||
ParameterizedType parameterizedType = (ParameterizedType) this.getClass().getGenericSuperclass();
|
||||
return (Class) parameterizedType.getActualTypeArguments()[0];
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package org.springblade.modules.alibaba.trade.param;
|
||||
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
|
||||
public class AccountPeriodListBuyerViewResult {
|
||||
|
||||
private String totalCount;
|
||||
|
||||
/**
|
||||
* @return 总数据条数
|
||||
*/
|
||||
public String getTotalCount() {
|
||||
return totalCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置总数据条数 *
|
||||
* 参数示例:<pre>100</pre>
|
||||
* 此参数必填
|
||||
*/
|
||||
public void setTotalCount(String totalCount) {
|
||||
this.totalCount = totalCount;
|
||||
}
|
||||
|
||||
private AlibabaOceanOpenplatformBizTradeCommonModelAccountPeriodInfo[] accountPeriodList;
|
||||
|
||||
/**
|
||||
* @return 授信列表
|
||||
*/
|
||||
public AlibabaOceanOpenplatformBizTradeCommonModelAccountPeriodInfo[] getAccountPeriodList() {
|
||||
return accountPeriodList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置授信列表 *
|
||||
* 参数示例:<pre>[]</pre>
|
||||
* 此参数必填
|
||||
*/
|
||||
public void setAccountPeriodList(AlibabaOceanOpenplatformBizTradeCommonModelAccountPeriodInfo[] accountPeriodList) {
|
||||
this.accountPeriodList = accountPeriodList;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package org.springblade.modules.flightTrain.serializers;
|
||||
|
||||
import cn.hutool.core.util.DesensitizedUtil;
|
||||
import com.fasterxml.jackson.core.JsonGenerator;
|
||||
import com.fasterxml.jackson.databind.JsonSerializer;
|
||||
import com.fasterxml.jackson.databind.SerializerProvider;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* @author: jhl
|
||||
*/
|
||||
public class AccountDesensitizedSerializer extends JsonSerializer<String> {
|
||||
@Override
|
||||
public void serialize(String value, JsonGenerator gen, SerializerProvider serializers) throws IOException {
|
||||
gen.writeString(DesensitizedUtil.idCardNum(value, 1, 2));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package org.springblade.modules.flow.excel;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
|
||||
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
|
||||
import lombok.Data;
|
||||
import org.springblade.common.constant.UserBaseConstant;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@ColumnWidth(25)
|
||||
@HeadRowHeight(20)
|
||||
@ContentRowHeight(18)
|
||||
public class ActiveValueLogExcel implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@ColumnWidth(15)
|
||||
@ExcelProperty("名字")
|
||||
private String userName;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("手机号")
|
||||
private Long phone;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("活跃值")
|
||||
private BigDecimal activeValue;
|
||||
|
||||
@ColumnWidth(30)
|
||||
@ExcelProperty("支出/支入类型")
|
||||
private String remarks;
|
||||
|
||||
@ExcelIgnore
|
||||
private Integer type;
|
||||
|
||||
@ExcelIgnore
|
||||
private Integer sourceType;
|
||||
|
||||
@ColumnWidth(15)
|
||||
@ExcelProperty("支出/支入")
|
||||
private String typeName;
|
||||
|
||||
@ColumnWidth(30)
|
||||
@ExcelProperty("创建时间")
|
||||
private Date createTime;
|
||||
|
||||
|
||||
|
||||
public String getTypeName() {
|
||||
return UserBaseConstant.TYPE_NAME_ARR[this.type];
|
||||
}
|
||||
|
||||
public String getRemarks() {
|
||||
return UserBaseConstant.ACTIVE_VALUE_LOG_SOURCE_NAME[this.getSourceType()];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package org.springblade.modules.mq.service;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ActiveRocketMqMessage<T> implements Serializable {
|
||||
|
||||
/**
|
||||
* 消息内容
|
||||
*/
|
||||
private T content;
|
||||
/**
|
||||
* 消息的key
|
||||
*/
|
||||
private String msgKey;
|
||||
/**
|
||||
* topic
|
||||
*/
|
||||
private String activeTopic;
|
||||
/**
|
||||
* group
|
||||
*/
|
||||
private String activeGroup;
|
||||
/**
|
||||
* tag
|
||||
*/
|
||||
private Integer activeTag;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package org.springblade.modules.order.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springblade.core.boot.ctrl.BladeController;
|
||||
import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springblade.modules.order.entity.AbnormalOrder;
|
||||
import org.springblade.modules.order.service.IAbnormalOrderService;
|
||||
import org.springblade.modules.order.vo.AbnormalOrderVO;
|
||||
import org.springblade.modules.order.wrapper.AbnormalOrderWrapper;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 异常订单 控制器
|
||||
*
|
||||
* @author 刘玮杰
|
||||
* @since 2023-06-12
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/order/abnormal-order")
|
||||
@Api(value = "异常订单", tags = "异常订单接口")
|
||||
public class AbnormalOrderController extends BladeController {
|
||||
|
||||
private final IAbnormalOrderService abnormalOrderService;
|
||||
|
||||
/**
|
||||
* 异常订单 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@ApiOperation(value = "详情", notes = "传入abnormalOrder")
|
||||
public R<AbnormalOrderVO> detail(AbnormalOrder abnormalOrder) {
|
||||
AbnormalOrder detail = abnormalOrderService.getOne(Condition.getQueryWrapper(abnormalOrder));
|
||||
return R.data(AbnormalOrderWrapper.build().entityVO(detail));
|
||||
}
|
||||
/**
|
||||
* 异常订单 分页
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@ApiOperation(value = "分页", notes = "传入abnormalOrder")
|
||||
public R<IPage<AbnormalOrderVO>> list(AbnormalOrder abnormalOrder, Query query) {
|
||||
IPage<AbnormalOrder> pages = abnormalOrderService.page(Condition.getPage(query), Condition.getQueryWrapper(abnormalOrder).orderByDesc("id"));
|
||||
return R.data(AbnormalOrderWrapper.build().pageVO(pages));
|
||||
}
|
||||
|
||||
/**
|
||||
* 异常订单 自定义分页
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@ApiOperation(value = "分页", notes = "传入abnormalOrder")
|
||||
public R<IPage<AbnormalOrderVO>> page(AbnormalOrderVO abnormalOrder, Query query) {
|
||||
IPage<AbnormalOrderVO> pages = abnormalOrderService.selectAbnormalOrderPage(Condition.getPage(query), abnormalOrder);
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
/**
|
||||
* 异常订单 新增
|
||||
*/
|
||||
@PostMapping("/save")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@ApiOperation(value = "新增", notes = "传入abnormalOrder")
|
||||
public R save(@Valid @RequestBody AbnormalOrder abnormalOrder) {
|
||||
return R.status(abnormalOrderService.save(abnormalOrder));
|
||||
}
|
||||
|
||||
/**
|
||||
* 异常订单 修改
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@ApiOperation(value = "修改", notes = "传入abnormalOrder")
|
||||
public R update(@Valid @RequestBody AbnormalOrder abnormalOrder) {
|
||||
return R.status(abnormalOrderService.updateById(abnormalOrder));
|
||||
}
|
||||
|
||||
/**
|
||||
* 异常订单 新增或修改
|
||||
*/
|
||||
@PostMapping("/submit")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@ApiOperation(value = "新增或修改", notes = "传入abnormalOrder")
|
||||
public R submit(@Valid @RequestBody AbnormalOrder abnormalOrder) {
|
||||
return R.status(abnormalOrderService.saveOrUpdate(abnormalOrder));
|
||||
}
|
||||
|
||||
/**
|
||||
* 异常订单 删除
|
||||
*/
|
||||
@PostMapping("/remove")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@ApiOperation(value = "逻辑删除", notes = "传入ids")
|
||||
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
|
||||
return R.status(abnormalOrderService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package org.springblade.modules.order.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springblade.modules.order.entity.AbnormalOrder;
|
||||
|
||||
/**
|
||||
* 异常订单 数据传输对象实体类
|
||||
*
|
||||
* @author 刘玮杰
|
||||
* @since 2023-06-12
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class AbnormalOrderDTO extends AbnormalOrder {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package org.springblade.modules.order.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springblade.core.mp.base.BaseEntity;
|
||||
|
||||
/**
|
||||
* 异常订单 实体类
|
||||
*
|
||||
* @author 刘玮杰
|
||||
* @since 2023-06-12
|
||||
*/
|
||||
@Data
|
||||
@TableName("abnormal_order")
|
||||
@ApiModel(value = "AbnormalOrder对象", description = "异常订单")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class AbnormalOrder extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
@ApiModelProperty(value = "订单id")
|
||||
private Long orderId;
|
||||
/**
|
||||
* 订单类型 1-商城订单 2-库存订单 3-带货认证 4-入驻认证 5-押金订单 6-运费订单 7-otc订单 8-活动订单
|
||||
*/
|
||||
@ApiModelProperty(value = "订单类型 1-商城订单 2-库存订单 3-带货认证 4-入驻认证 5-押金订单 6-运费订单 7-otc订单 8-活动订单")
|
||||
private Integer orderType;
|
||||
/**
|
||||
* 异常描述
|
||||
*/
|
||||
@ApiModelProperty(value = "异常描述")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 是否完成
|
||||
*/
|
||||
@ApiModelProperty(value = "是否完成")
|
||||
private Integer isCompleted;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package org.springblade.modules.order.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springblade.core.mp.base.BaseEntity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 售后订单 实体类
|
||||
*
|
||||
* @author 刘玮杰
|
||||
* @since 2023-05-17
|
||||
*/
|
||||
@Data
|
||||
@TableName("after_service_order")
|
||||
@ApiModel(value = "AfterServiceOrder对象", description = "售后订单")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
public class AfterServiceOrder extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
@ApiModelProperty(value = "订单id")
|
||||
private Long orderId;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private Long userId;
|
||||
/**
|
||||
* 供应商订单号
|
||||
*/
|
||||
@ApiModelProperty(value = "供应商订单号")
|
||||
private String supplierOrderSn;
|
||||
/**
|
||||
* 商品编码
|
||||
*/
|
||||
@ApiModelProperty(value = "商品编码")
|
||||
private String skuSn;
|
||||
/**
|
||||
* 供应商售后单号
|
||||
*/
|
||||
@ApiModelProperty(value = "供应商售后单号")
|
||||
private String supplierAfterServiceSn;
|
||||
/**
|
||||
* 退货原因
|
||||
*/
|
||||
@ApiModelProperty(value = "退货原因")
|
||||
private String reason;
|
||||
/**
|
||||
* 数量数量
|
||||
*/
|
||||
@ApiModelProperty(value = "数量数量")
|
||||
private Integer quantity;
|
||||
/**
|
||||
* 售后类型
|
||||
*/
|
||||
@ApiModelProperty(value = "售后类型 1=未收货退款,2=退货退款,3=换货补发,4=不退货仅退款")
|
||||
private Integer afterServiceType;
|
||||
/**
|
||||
* 售后状态
|
||||
*/
|
||||
@ApiModelProperty(value = "售后状态 1=待审核,2=售后中,3=已完成,4=已关闭,5=取消审核,6=已取消")
|
||||
private Integer orderStatus;
|
||||
|
||||
/**
|
||||
* 总退款金额
|
||||
*/
|
||||
private BigDecimal totalRefund;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package org.springblade.modules.order.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.modules.order.entity.AbnormalOrder;
|
||||
import org.springblade.modules.order.vo.AbnormalOrderVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 异常订单 Mapper 接口
|
||||
*
|
||||
* @author 刘玮杰
|
||||
* @since 2023-06-12
|
||||
*/
|
||||
public interface AbnormalOrderMapper extends BaseMapper<AbnormalOrder> {
|
||||
|
||||
/**
|
||||
* 自定义分页
|
||||
*
|
||||
* @param page
|
||||
* @param abnormalOrder
|
||||
* @return
|
||||
*/
|
||||
List<AbnormalOrderVO> selectAbnormalOrderPage(IPage page, AbnormalOrderVO abnormalOrder);
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.springblade.modules.order.mapper.AbnormalOrderMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="abnormalOrderResultMap" type="org.springblade.modules.order.entity.AbnormalOrder">
|
||||
<result column="id" property="id"/>
|
||||
<result column="order_id" property="orderId"/>
|
||||
<result column="order_type" property="orderType"/>
|
||||
<result column="remark" property="remark"/>
|
||||
<result column="is_completed" property="isCompleted"/>
|
||||
<result column="create_user" property="createUser"/>
|
||||
<result column="create_dept" property="createDept"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_user" property="updateUser"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="status" property="status"/>
|
||||
<result column="is_deleted" property="isDeleted"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="selectAbnormalOrderPage" resultMap="abnormalOrderResultMap">
|
||||
select * from abnormal_order where is_deleted = 0
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,27 @@
|
||||
package org.springblade.modules.order.service.impl;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.core.mp.base.BaseServiceImpl;
|
||||
import org.springblade.modules.order.entity.AbnormalOrder;
|
||||
import org.springblade.modules.order.mapper.AbnormalOrderMapper;
|
||||
import org.springblade.modules.order.service.IAbnormalOrderService;
|
||||
import org.springblade.modules.order.vo.AbnormalOrderVO;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 异常订单 服务实现类
|
||||
*
|
||||
* @author 刘玮杰
|
||||
* @since 2023-06-12
|
||||
*/
|
||||
@Service
|
||||
public class AbnormalOrderServiceImpl extends BaseServiceImpl<AbnormalOrderMapper, AbnormalOrder> implements IAbnormalOrderService {
|
||||
|
||||
@Override
|
||||
public IPage<AbnormalOrderVO> selectAbnormalOrderPage(IPage<AbnormalOrderVO> page, AbnormalOrderVO abnormalorder) {
|
||||
return page.setRecords(baseMapper.selectAbnormalOrderPage(page, abnormalorder));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package org.springblade.modules.order.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springblade.modules.order.entity.AbnormalOrder;
|
||||
|
||||
/**
|
||||
* 异常订单 视图实体类
|
||||
*
|
||||
* @author 刘玮杰
|
||||
* @since 2023-06-12
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class AbnormalOrderVO extends AbnormalOrder {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package org.springblade.modules.order.wrapper;
|
||||
|
||||
|
||||
import org.springblade.core.mp.support.BaseEntityWrapper;
|
||||
import org.springblade.core.tool.utils.BeanUtil;
|
||||
import org.springblade.modules.order.entity.AbnormalOrder;
|
||||
import org.springblade.modules.order.vo.AbnormalOrderVO;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 异常订单 包装类,返回视图层所需的字段
|
||||
*
|
||||
* @author 刘玮杰
|
||||
* @since 2023-06-12
|
||||
*/
|
||||
public class AbnormalOrderWrapper extends BaseEntityWrapper<AbnormalOrder, AbnormalOrderVO> {
|
||||
|
||||
public static AbnormalOrderWrapper build() {
|
||||
return new AbnormalOrderWrapper();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbnormalOrderVO entityVO(AbnormalOrder abnormalorder) {
|
||||
AbnormalOrderVO abnormalorderVO = Objects.requireNonNull(BeanUtil.copy(abnormalorder, AbnormalOrderVO.class));
|
||||
|
||||
//User createUser = UserCache.getUser(abnormalorder.getCreateUser());
|
||||
//User updateUser = UserCache.getUser(abnormalorder.getUpdateUser());
|
||||
//abnormalorderVO.setCreateUserName(createUser.getName());
|
||||
//abnormalorderVO.setUpdateUserName(updateUser.getName());
|
||||
|
||||
return abnormalorderVO;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -6,12 +6,8 @@ import java.math.BigDecimal;
|
||||
|
||||
public abstract class AbstractPayService {
|
||||
public abstract String pay(BigDecimal paymentAmount, String tradeNo) throws Exception;
|
||||
|
||||
public abstract Boolean query(String tradeNo) throws Exception;
|
||||
|
||||
public abstract String refund(BigDecimal refundAmount, String tradeNo) throws Exception;
|
||||
|
||||
public abstract Boolean queryRefund(String tradeNo, String refundNo) throws Exception;
|
||||
|
||||
public abstract void closeOrder(String tradeNo) throws Exception;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package org.springblade.modules.remote.request.shengtian;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class AfterSaleAntiRequest implements Serializable {
|
||||
|
||||
private String orderSn;
|
||||
|
||||
private Integer sku;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package org.springblade.modules.remote.request.shengtian;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class AfterSaleApplyRequest implements Serializable {
|
||||
|
||||
private String orderSn;
|
||||
|
||||
private Long sku;
|
||||
|
||||
private Integer num;
|
||||
|
||||
//期望退还的商品金额(分),仅退款时不用填写。
|
||||
//退货退款时,需要填写
|
||||
private Integer goodsFee;
|
||||
|
||||
//期望退还的运费金额(分)
|
||||
//仅做参考作用,具体以实际为准。
|
||||
private Integer logisticFee;
|
||||
|
||||
//售后类型code
|
||||
//必须填写校验接口中serviceType项返回的code
|
||||
private String serviceTypeCode;
|
||||
|
||||
//取件类型code
|
||||
//必须返回校验接口中pickType返回的code
|
||||
private String pickTypeCode;
|
||||
|
||||
//包装情况code
|
||||
//必须根据校验接口的返回情况,决定该项是否必须
|
||||
//如果必须,必须填写校验接口packageType中返回的code
|
||||
private String packageTypeCode;
|
||||
|
||||
//反件情况code必须根据校验接口的返回情况,决定该项是否必须如果必须,必须填写校验接口returnType中返回的code
|
||||
private String returnTypeCode;
|
||||
|
||||
//原因类型code
|
||||
//必须根据校验接口的返回情况,决定该项是否必须
|
||||
//如果必须,必须填写校验接口reasonsType中返回的code
|
||||
private String reasonsTypeCode;
|
||||
|
||||
//申请售后的原因,详细说明。
|
||||
//限制最长150个文字
|
||||
private String reasonsDescription;
|
||||
|
||||
//苏宁 上门维修服务时间
|
||||
private String serviceTime;
|
||||
|
||||
//凭证图片列表
|
||||
//必须根据校验接口的返回情况,决定该项是否必须
|
||||
//如果必须,必须填写上传售后凭证接口返回的url
|
||||
//最多填写5个url
|
||||
private List<String> vouchers;
|
||||
|
||||
//个人信息
|
||||
//仅当取件方式为上门取件、售后类型为维修、换货 需要传递此项
|
||||
private UserInfo userInfo;
|
||||
|
||||
@Data
|
||||
class UserInfo implements Serializable {
|
||||
|
||||
private String consignee;
|
||||
|
||||
private String phone;
|
||||
|
||||
private String province;
|
||||
|
||||
private String city;
|
||||
|
||||
private String area;
|
||||
|
||||
private String Street;
|
||||
|
||||
private String description;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package org.springblade.modules.remote.request.shengtian;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class AfterSaleUploadVoucherRequest extends AfterSaleAntiRequest {
|
||||
|
||||
List<String> pictures;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
package org.springblade.modules.remote.response.shengtian;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class AfterSaleDetail implements Serializable {
|
||||
|
||||
// 售后来源
|
||||
private Integer source;
|
||||
|
||||
// 订单号(三方)
|
||||
private String orderSn;
|
||||
|
||||
// 三级订单号
|
||||
private String orderSn3;
|
||||
|
||||
// 规格id
|
||||
private Integer sku;
|
||||
|
||||
// 申请售后的数量
|
||||
private Integer num;
|
||||
|
||||
// 实际退款金额(分)
|
||||
private Integer refundFee;
|
||||
|
||||
// 申请的退货款金额(分)
|
||||
private Integer goodsFee;
|
||||
|
||||
// 申请的退运费金额(分)
|
||||
private Integer logisticsFee;
|
||||
|
||||
// 售后类型code
|
||||
private String serviceTypeCode;
|
||||
|
||||
// 反件方式code
|
||||
private String pickTypeCode;
|
||||
|
||||
// 包装情况code
|
||||
private String packageTypeCode;
|
||||
|
||||
// 换货维修等期望商家的寄件方式code
|
||||
private String returnTypeCode;
|
||||
|
||||
// 售后原因code
|
||||
private String reasonsTypeCode;
|
||||
|
||||
// 售后原因描述
|
||||
private String reasonsDescription;
|
||||
|
||||
// 审核结果:直赔积分 (11),直赔余额 (12),直赔优惠卷 (13),直赔京豆 (14),直赔商品 (21),上门换新 (22),自营取件 (31),客户送货(32),客户发货 (33),闪电退款 (34),虚拟退款 (35),大家电检测 (80),大家电安装 (81),大家电移机 (82),大家电维修 (83),大家电其它(84);
|
||||
private Integer approvedResult;
|
||||
|
||||
// 售后凭证url
|
||||
private List<String> vouchers;
|
||||
|
||||
// 售后补充个人信息
|
||||
private UserInfo userInfo;
|
||||
|
||||
// 商家信息
|
||||
private SellerInfo sellerInfo;
|
||||
|
||||
// 用户提交的物流信息
|
||||
private SendData sendData;
|
||||
|
||||
private Integer status;
|
||||
|
||||
private Integer createdTime;
|
||||
|
||||
@Data
|
||||
public static class UserInfo implements Serializable {
|
||||
|
||||
private String consignee;
|
||||
|
||||
private String phone;
|
||||
|
||||
private String province;
|
||||
|
||||
private String city;
|
||||
|
||||
private String area;
|
||||
|
||||
private String Street;
|
||||
|
||||
private String description;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class SellerInfo implements Serializable {
|
||||
|
||||
private String address;
|
||||
|
||||
private String realName;
|
||||
|
||||
private String phone;
|
||||
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class SendData implements Serializable{
|
||||
|
||||
private String sn;
|
||||
|
||||
private String company;
|
||||
|
||||
private List<String> vouchers;
|
||||
|
||||
private String description;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user