Commit d064ec23 authored by shiyu's avatar shiyu

藏品详情加上是否为官方商品的字段

parent 50065c7d
package com.wwdz.ch.admin.controller;
import com.alibaba.fastjson.JSON;
import com.wwdz.ch.admin.service.SysExchangeApplyOrderService;
import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.db.dto.request.exchange.ExchangeApplyOrderRequestDto;
import com.xxdxxs.service.FormHandler;
import com.xxdxxs.validation.Validator;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
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;
@RestController
@RequestMapping("/admin/exchangeApplyOrder")
public class SysExchangeApplyOrderController {
private static final Logger logger = LoggerFactory.getLogger(SysExchangeApplyOrderController.class);
@Autowired
SysExchangeApplyOrderService sysExchangeApplyOrderService;
@ApiOperation(value = "平台审核申请单")
@PostMapping("/handleApplyOrder")
public Result handleApplyOrder(@RequestBody ExchangeApplyOrderRequestDto dto) {
logger.info("处理申请单,请求参数:{}", JSON.toJSONString(dto));
Validator validator = new Validator(FormHandler.ofEntity(dto));
validator.set("exchangeApplyOrderId", "交换申请单号").must().string()
.set("state", "状态").must().number()
.end();
if (!validator.isValid()) {
return Result.failed(validator.getErrorInfo());
}
return sysExchangeApplyOrderService.handleApplyOrder(dto);
}
@ApiOperation(value = "查询交换单列表")
@PostMapping("/findList")
public Result findList(@RequestBody ExchangeApplyOrderRequestDto dto) {
logger.info("查询交换单列表,请求参数:{}", JSON.toJSONString(dto));
return sysExchangeApplyOrderService.findList(dto);
}
@ApiOperation(value = "查询交换单详情")
@PostMapping("/findDetail")
public Result findDetail(@RequestBody ExchangeApplyOrderRequestDto dto) {
logger.info("查询交换单详情,请求参数:{}", JSON.toJSONString(dto));
Validator validator = new Validator(FormHandler.ofEntity(dto));
validator.set("exchangeApplyOrderId", "交换申请单号").must().string()
.end();
if (!validator.isValid()) {
return Result.failed(validator.getErrorInfo());
}
return sysExchangeApplyOrderService.findDetail(dto);
}
}
package com.wwdz.ch.admin.service;
import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.db.dto.request.exchange.ExchangeApplyOrderRequestDto;
public interface SysExchangeApplyOrderService {
/**
* 处理申请单
* @param dto
* @return
*/
Result handleApplyOrder(ExchangeApplyOrderRequestDto dto);
/**
* 查询交换单列表
* @param dto
* @return
*/
Result findList(ExchangeApplyOrderRequestDto dto);
/**
* 查询交换单详情
* @param dto
* @return
*/
Result findDetail(ExchangeApplyOrderRequestDto dto);
}
...@@ -6,7 +6,8 @@ public class ExchangeApplyOrderEnum { ...@@ -6,7 +6,8 @@ public class ExchangeApplyOrderEnum {
PRE_HANDLE(0, "待处理"), PRE_HANDLE(0, "待处理"),
AGREE(1, "同意"), AGREE(1, "同意"),
DISAGREE(2, "拒绝"), DISAGREE(2, "拒绝"),
SYSTEM_DISAGREE(3, "平台鉴定后拒绝"), SYSTEM_AGREE(3, "平台鉴定后通过"),
SYSTEM_DISAGREE(4, "平台鉴定后拒绝"),
CANCEL(-1, "取消"), CANCEL(-1, "取消"),
; ;
......
...@@ -28,7 +28,7 @@ public class ExchangeApplyOrderVo implements Entity { ...@@ -28,7 +28,7 @@ public class ExchangeApplyOrderVo implements Entity {
/** /**
* 想要换的目标商品id * 想要换的目标商品id
*/ */
private SupplierItemVo targetItemInfo; private List<SupplierItemVo> targetItemList;
/** /**
* 目标用户id * 目标用户id
......
...@@ -34,16 +34,13 @@ import org.springframework.util.CollectionUtils; ...@@ -34,16 +34,13 @@ import org.springframework.util.CollectionUtils;
import java.time.Duration; import java.time.Duration;
import java.time.Instant; import java.time.Instant;
import java.util.ArrayList; import java.util.*;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Service @Service
public class ExchangeApplyOrderServiceImpl implements ExchangeApplyOrderService { public class ExchangeApplyOrderServiceImpl implements ExchangeApplyOrderService {
private static final Logger logger = LoggerFactory.getLogger(DistributorProfitServiceImpl.class); private static final Logger logger = LoggerFactory.getLogger(ExchangeApplyOrderServiceImpl.class);
@Autowired @Autowired
ExchangeApplyOrderDetailDao exchangeApplyOrderDetailDao; ExchangeApplyOrderDetailDao exchangeApplyOrderDetailDao;
...@@ -252,7 +249,7 @@ public class ExchangeApplyOrderServiceImpl implements ExchangeApplyOrderService ...@@ -252,7 +249,7 @@ public class ExchangeApplyOrderServiceImpl implements ExchangeApplyOrderService
targetItemVo.setDistributionPrice(PriceUtil.convertPriceFenToYuan(targetItem.getDistributionPrice())); targetItemVo.setDistributionPrice(PriceUtil.convertPriceFenToYuan(targetItem.getDistributionPrice()));
targetItemVo.setOfficialEstimatedPrice(PriceUtil.convertPriceFenToYuan(targetItem.getOfficialEstimatedPrice())); targetItemVo.setOfficialEstimatedPrice(PriceUtil.convertPriceFenToYuan(targetItem.getOfficialEstimatedPrice()));
targetItemVo.setHomePageImage(MediaUtil.getHomePageImage(targetItem.getImages(), targetItem.getVideos())); targetItemVo.setHomePageImage(MediaUtil.getHomePageImage(targetItem.getImages(), targetItem.getVideos()));
exchangeApplyOrderVo.setTargetItemInfo(targetItemVo); exchangeApplyOrderVo.setTargetItemList(Arrays.asList(targetItemVo));
List<ExchangeApplyOrderDetail> detailList = exchangeApplyOrderDetailDao.findByOrderId(exchangeApplyOrder.getExchangeApplyOrderId()); List<ExchangeApplyOrderDetail> detailList = exchangeApplyOrderDetailDao.findByOrderId(exchangeApplyOrder.getExchangeApplyOrderId());
List<SupplierItemVo> userItemList = new ArrayList<>(); List<SupplierItemVo> userItemList = new ArrayList<>();
...@@ -310,7 +307,7 @@ public class ExchangeApplyOrderServiceImpl implements ExchangeApplyOrderService ...@@ -310,7 +307,7 @@ public class ExchangeApplyOrderServiceImpl implements ExchangeApplyOrderService
targetItemVo.setDistributionPrice(PriceUtil.convertPriceFenToYuan(targetItem.getDistributionPrice())); targetItemVo.setDistributionPrice(PriceUtil.convertPriceFenToYuan(targetItem.getDistributionPrice()));
targetItemVo.setOfficialEstimatedPrice(PriceUtil.convertPriceFenToYuan(targetItem.getOfficialEstimatedPrice())); targetItemVo.setOfficialEstimatedPrice(PriceUtil.convertPriceFenToYuan(targetItem.getOfficialEstimatedPrice()));
targetItemVo.setHomePageImage(MediaUtil.getHomePageImage(targetItem.getImages(), targetItem.getVideos())); targetItemVo.setHomePageImage(MediaUtil.getHomePageImage(targetItem.getImages(), targetItem.getVideos()));
exchangeApplyOrderVo.setTargetItemInfo(targetItemVo); exchangeApplyOrderVo.setTargetItemList(Arrays.asList(targetItemVo));
List<ExchangeApplyOrderDetail> detailList = exchangeApplyOrderDetailDao.findByOrderId(exchangeApplyOrder.getExchangeApplyOrderId()); List<ExchangeApplyOrderDetail> detailList = exchangeApplyOrderDetailDao.findByOrderId(exchangeApplyOrder.getExchangeApplyOrderId());
List<SupplierItemVo> userItemList = new ArrayList<>(); List<SupplierItemVo> userItemList = new ArrayList<>();
......
...@@ -1020,6 +1020,10 @@ public class SupplierItemServiceImpl implements SupplierItemService { ...@@ -1020,6 +1020,10 @@ public class SupplierItemServiceImpl implements SupplierItemService {
String shareTip = "分享藏品,成交最高可得3%(" + PriceUtil.convertDoubleToString(introduceCost ) + ")的介绍佣金"; String shareTip = "分享藏品,成交最高可得3%(" + PriceUtil.convertDoubleToString(introduceCost ) + ")的介绍佣金";
supplierItemVo.setShareTip(shareTip); supplierItemVo.setShareTip(shareTip);
if (CommConsts.SELF_SUPPORT_ACCOUNT.longValue() == supplierItem.getCreatorId()) {
supplierItemVo.setIsOfficialItem(true);
}
//查询商品所属标签 //查询商品所属标签
List<CollectionItemsRelation> collectionItemsRelations = collectionItemsRelationDao.findByItemId(itemId); List<CollectionItemsRelation> collectionItemsRelations = collectionItemsRelationDao.findByItemId(itemId);
List<Long> collectBookIds = collectionItemsRelations.stream().map(CollectionItemsRelation::getCollectionBookId).collect(Collectors.toList()); List<Long> collectBookIds = collectionItemsRelations.stream().map(CollectionItemsRelation::getCollectionBookId).collect(Collectors.toList());
......
...@@ -60,7 +60,7 @@ public class ExchangeApplyOrderController { ...@@ -60,7 +60,7 @@ public class ExchangeApplyOrderController {
@ApiOperation(value = "用户取消交换申请") @ApiOperation(value = "用户取消交换申请")
@PostMapping("/cancel") @PostMapping("/cancel")
public Result cancel(@RequestBody ExchangeApplyOrderRequestDto dto) { public Result cancel(@RequestBody ExchangeApplyOrderRequestDto dto) {
logger.info("用户申请以物换物,请求参数:{}", JSON.toJSONString(dto)); logger.info("用户取消交换申请,请求参数:{}", JSON.toJSONString(dto));
Validator validator = new Validator(FormHandler.ofEntity(dto)); Validator validator = new Validator(FormHandler.ofEntity(dto));
validator.set("exchangeApplyOrderId", "交换申请单号").must().string() validator.set("exchangeApplyOrderId", "交换申请单号").must().string()
.end(); .end();
...@@ -74,7 +74,7 @@ public class ExchangeApplyOrderController { ...@@ -74,7 +74,7 @@ public class ExchangeApplyOrderController {
@ApiOperation(value = "查询交换单列表") @ApiOperation(value = "查询交换单列表")
@PostMapping("/findList") @PostMapping("/findList")
public Result findList(@RequestBody ExchangeApplyOrderRequestDto dto) { public Result findList(@RequestBody ExchangeApplyOrderRequestDto dto) {
logger.info("用户申请以物换物,请求参数:{}", JSON.toJSONString(dto)); logger.info("查询交换单列表,请求参数:{}", JSON.toJSONString(dto));
Validator validator = new Validator(FormHandler.ofEntity(dto)); Validator validator = new Validator(FormHandler.ofEntity(dto));
validator.set("userId", "用户ID").must().number() validator.set("userId", "用户ID").must().number()
.set("type", "类型").must().number() .set("type", "类型").must().number()
......
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