Commit c58f6e3d authored by shiyu's avatar shiyu

修改商品

parent fdf75da7
...@@ -185,14 +185,13 @@ public class ConsignSaleServiceImpl implements ConsignSaleService { ...@@ -185,14 +185,13 @@ public class ConsignSaleServiceImpl implements ConsignSaleService {
//卖出后商品下架 //卖出后商品下架
itemDao.updateOnSale(itemId); itemDao.updateOnSale(itemId);
//插入操作记录 //插入操作记录
ConsignSaleRecord consignSaleRecord = new ConsignSaleRecord(); ConsignSaleRecord consignSaleRecord = new ConsignSaleRecord();
consignSaleRecord.setSaleId(dto.getSaleId()); consignSaleRecord.setSaleId(dto.getSaleId());
consignSaleRecord.setCreateTime(new Date()); consignSaleRecord.setCreateTime(new Date());
consignSaleRecord.setContent("成交金额: " + dto.getDealPrice() + " 元"); consignSaleRecord.setContent("成交金额: " + dto.getDealPrice() + " 元");
consignSaleRecord.setRemark("成交平台: " + dto.getRemark()); consignSaleRecord.setRemark("成交平台: " + dto.getRemark() == null ? "" : dto.getRemark());
consignSaleRecord.setType(ConsignSaleEnum.OperateTypeEnum.VALUATE.getCode()); consignSaleRecord.setType(ConsignSaleEnum.OperateTypeEnum.FINISH.getCode());
consignSaleRecordDao.insert(consignSaleRecord); consignSaleRecordDao.insert(consignSaleRecord);
return Result.success(); return Result.success();
} catch (Exception e) { } catch (Exception e) {
......
...@@ -90,7 +90,7 @@ public class ConsignSaleEnum { ...@@ -90,7 +90,7 @@ public class ConsignSaleEnum {
public enum OperateTypeEnum { public enum OperateTypeEnum {
VALUATE(1, "图文估价"), VALUATE(1, "图文估价"),
IDENTIFY(4, "实物鉴定"), IDENTIFY(4, "实物鉴定"),
WAIT_TAKE(10, "寄售单完成"), FINISH(10, "寄售单完成"),
CUSTOM_CANCEL(20, "用户取消寄售"), CUSTOM_CANCEL(20, "用户取消寄售"),
SYS_CANCEL(21, "平台取消寄售"), SYS_CANCEL(21, "平台取消寄售"),
; ;
......
...@@ -952,7 +952,7 @@ public class ItemServiceImpl implements ItemService { ...@@ -952,7 +952,7 @@ public class ItemServiceImpl implements ItemService {
if (Objects.isNull(item)) { if (Objects.isNull(item)) {
return Result.failed("数据异常,该藏品不存在"); return Result.failed("数据异常,该藏品不存在");
} }
List<ConsignSale> consignSales = consignSaleDao.findByItemId(dto.getItemId()); List<ConsignSale> consignSales = consignSaleDao.findByItemId(dto.getId());
long count = consignSales.stream().filter(consignSale -> consignSale.getCustomState().intValue() == ConsignSaleEnum.SaleForUserStateEnum.CONSIGN_SALEING.getCode()).count(); long count = consignSales.stream().filter(consignSale -> consignSale.getCustomState().intValue() == ConsignSaleEnum.SaleForUserStateEnum.CONSIGN_SALEING.getCode()).count();
if (count > 0) { if (count > 0) {
return Result.failed("该藏品正在寄售中,不能编辑"); return Result.failed("该藏品正在寄售中,不能编辑");
......
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