From b6ad0f29932c0a4f6053a765723aa4d80adcc706 Mon Sep 17 00:00:00 2001
From: KKSU <15274802129@163.com>
Date: Mon, 11 Dec 2023 15:01:20 +0800
Subject: [PATCH] 用户留言

---
 src/main/java/cc/mrbird/febs/mall/vo/ApiOrderBuyRecordInfoVo.java             |    2 
 src/main/java/cc/mrbird/febs/mall/dto/ApiOrderSellComplainDto.java            |   21 +++++++
 src/main/java/cc/mrbird/febs/mall/service/impl/MallNewsInfoServiceImpl.java   |   40 ++++++------
 src/main/java/cc/mrbird/febs/mall/service/impl/AgentServiceImpl.java          |   37 ++++++++++++
 src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallProductServiceImpl.java |   31 ++++++++++
 src/main/java/cc/mrbird/febs/mall/service/IApiMallProductService.java         |    2 
 src/main/java/cc/mrbird/febs/mall/vo/ApiOrderSellRecordInfoVo.java            |    2 
 src/main/java/cc/mrbird/febs/mall/controller/ApiMallProductController.java    |    7 ++
 src/main/java/cc/mrbird/febs/common/enumerates/ProductEnum.java               |    3 
 9 files changed, 122 insertions(+), 23 deletions(-)

diff --git a/src/main/java/cc/mrbird/febs/common/enumerates/ProductEnum.java b/src/main/java/cc/mrbird/febs/common/enumerates/ProductEnum.java
index 9310b8a..74dd466 100644
--- a/src/main/java/cc/mrbird/febs/common/enumerates/ProductEnum.java
+++ b/src/main/java/cc/mrbird/febs/common/enumerates/ProductEnum.java
@@ -23,8 +23,9 @@
     PRODUCT_SELL_FAIL(0,"失败"),
 
     /**
-     * 匹配状态0:失败 1:匹配中 2:待支付 3:已支付 4:对方已确认 5:已完成
+     * 匹配状态0:失败 1:匹配中 2:待支付 3:已支付 4:对方已确认 5:已完成 6已投诉
      */
+    PRODUCT_MATE_STATE_COMPLAIN(6,"已投诉"),
     PRODUCT_MATE_STATE_FINISH(5,"已完成"),
     PRODUCT_MATE_STATE_CONFIRM(4,"对方已确认"),
     PRODUCT_MATE_STATE_PAY(3,"已支付"),
diff --git a/src/main/java/cc/mrbird/febs/mall/controller/ApiMallProductController.java b/src/main/java/cc/mrbird/febs/mall/controller/ApiMallProductController.java
index b9a57f1..b265991 100644
--- a/src/main/java/cc/mrbird/febs/mall/controller/ApiMallProductController.java
+++ b/src/main/java/cc/mrbird/febs/mall/controller/ApiMallProductController.java
@@ -78,6 +78,13 @@
         return iApiMallProductService.orderSellInsure(apiOrderSellInsureDto);
     }
 
+
+    @ApiOperation(value = "FCM-订单管理-查看提现详情-投诉", notes = "FCM-订单管理-查看提现详情-投诉")
+    @PostMapping(value = "/orderSellComplain")
+    public FebsResponse orderSellComplain(@RequestBody @Valid ApiOrderSellComplainDto apiOrderSellComplainDto) {
+        return iApiMallProductService.orderSellComplain(apiOrderSellComplainDto);
+    }
+
     @ApiOperation(value = "FCM-FCM提现", notes = "FCM-FCM提现")
     @PostMapping(value = "/outFcm")
     public FebsResponse outFcm(@RequestBody @Valid ApiOutFcmDto outFcmDto) {
diff --git a/src/main/java/cc/mrbird/febs/mall/dto/ApiOrderSellComplainDto.java b/src/main/java/cc/mrbird/febs/mall/dto/ApiOrderSellComplainDto.java
new file mode 100644
index 0000000..ce5be86
--- /dev/null
+++ b/src/main/java/cc/mrbird/febs/mall/dto/ApiOrderSellComplainDto.java
@@ -0,0 +1,21 @@
+package cc.mrbird.febs.mall.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+@Data
+@ApiModel(value = "ApiOrderSellComplainDto", description = "参数接收类")
+public class ApiOrderSellComplainDto {
+
+    @NotNull(message = "交易密码不能为空")
+    private Long sellRecordId;//ApiOrderSellRecordInfoVo的id,提现子表的ID
+
+    @NotBlank(message = "内容不能为空")
+    @ApiModelProperty(value = "内容", example = "1")
+    private String description;
+
+}
diff --git a/src/main/java/cc/mrbird/febs/mall/service/IApiMallProductService.java b/src/main/java/cc/mrbird/febs/mall/service/IApiMallProductService.java
index 909d7c7..a2f3bcb 100644
--- a/src/main/java/cc/mrbird/febs/mall/service/IApiMallProductService.java
+++ b/src/main/java/cc/mrbird/febs/mall/service/IApiMallProductService.java
@@ -31,4 +31,6 @@
     FebsResponse orderBuyList(ApiOrderBuyDto apiOrderBuyDto);
 
     Boolean operationPermissionMemberFrozen(Long memberId);
+
+    FebsResponse orderSellComplain(ApiOrderSellComplainDto apiOrderSellComplainDto);
 }
diff --git a/src/main/java/cc/mrbird/febs/mall/service/impl/AgentServiceImpl.java b/src/main/java/cc/mrbird/febs/mall/service/impl/AgentServiceImpl.java
index 11c321e..ed4153e 100644
--- a/src/main/java/cc/mrbird/febs/mall/service/impl/AgentServiceImpl.java
+++ b/src/main/java/cc/mrbird/febs/mall/service/impl/AgentServiceImpl.java
@@ -1041,4 +1041,41 @@
         mallProductSellMapper.insert(mallProductSell);
     }
 
+    public static List<Integer> findMissingNumbers(int[] nums) {
+        //定义一个标记数组,标记出现过的下表为true
+        boolean[] flag = new boolean[nums.length+1];
+        for(int temp:nums){
+            flag[temp] = true;
+        }
+        List<Integer> arr = new ArrayList<Integer>();
+        //以连续的i作为本应该的下标,查找之前的标记数组,没有被标记过的下标,就是消失的数字
+        for(int i = 1;i <= nums.length; i++){
+            if(!flag[i]){
+                arr.add(i);
+            }
+        }
+        return arr;
+    }
+
+    public static List<Integer> findDisappearedNumbers(int[] nums) {
+        Set<Integer> set = new HashSet<>(); // 利用Set对象元素不重复的特性
+        // 把nums里的每一个数字都添加至set中
+        for(int i = 0; i < nums.length; ++i) {
+            set.add(nums[i]);
+        }
+        List<Integer> list = new ArrayList<>();
+        // 把1~n的每一个数字都添加至set中,若添加成功则说明原数组不存在该数字,加入list即可
+        for(int i = 1; i <= nums.length; ++i) {
+            if(set.add(i)) {
+                list.add(i);
+            }
+        }
+        return list;
+    }
+    public static void main(String[] args) {
+        int[] nums = {1, 2, 2, 5, 2};
+        List<Integer> missingNumbers = findDisappearedNumbers(nums);
+        System.out.println("缺失的数字为:" + missingNumbers);
+    }
+
 }
diff --git a/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallProductServiceImpl.java b/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallProductServiceImpl.java
index 1f2f630..96a505e 100644
--- a/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallProductServiceImpl.java
+++ b/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallProductServiceImpl.java
@@ -46,6 +46,7 @@
     private final MallProductSellMapper mallProductSellMapper;
     private final MallProductSellRecordMapper mallProductSellRecordMapper;
     private final MallProductBuyRecordMapper mallProductBuyRecordMapper;
+    private final MallMemberSpeakMapper mallMemberSpeakMapper;
 
     @Override
     public List<ApiMallProductNftVo> productNFTList() {
@@ -547,4 +548,34 @@
         }
         return false;
     }
+
+    @Override
+    public FebsResponse orderSellComplain(ApiOrderSellComplainDto apiOrderSellComplainDto) {
+        Long memberId = LoginUserUtil.getLoginUser().getId();
+        Long sellRecordId = apiOrderSellComplainDto.getSellRecordId();
+        MallProductSellRecord mallProductSellRecord = mallProductSellRecordMapper.selectById(sellRecordId);
+        if(ObjectUtil.isEmpty(mallProductSellRecord)){
+            throw new FebsException("记录不存在");
+        }
+
+        MallProductBuyRecord mallProductBuyRecord = mallProductBuyRecordMapper.selectById(mallProductSellRecord.getBuyRecordId());
+        if(ObjectUtil.isEmpty(mallProductBuyRecord)){
+            throw new FebsException("记录不存在");
+        }
+
+        mallProductBuyRecord.setState(ProductEnum.PRODUCT_MATE_STATE_COMPLAIN.getValue());
+        mallProductBuyRecordMapper.updateById(mallProductBuyRecord);
+
+        mallProductSellRecord.setState(ProductEnum.PRODUCT_MATE_STATE_COMPLAIN.getValue());
+        mallProductSellRecordMapper.updateById(mallProductSellRecord);
+
+        MallMemberSpeak mallMemberSpeak = new MallMemberSpeak();
+        mallMemberSpeak.setMemberId(memberId);
+        mallMemberSpeak.setState(ProductEnum.SPEAK_NO_DEAL.getValue());
+        String description = apiOrderSellComplainDto.getDescription();
+        String buyOrderNo = mallProductBuyRecord.getBuyOrderNo();
+        mallMemberSpeak.setDescription("编号:"+buyOrderNo+","+description);
+        mallMemberSpeakMapper.insert(mallMemberSpeak);
+        return new FebsResponse().success();
+    }
 }
diff --git a/src/main/java/cc/mrbird/febs/mall/service/impl/MallNewsInfoServiceImpl.java b/src/main/java/cc/mrbird/febs/mall/service/impl/MallNewsInfoServiceImpl.java
index f202122..5b392b1 100644
--- a/src/main/java/cc/mrbird/febs/mall/service/impl/MallNewsInfoServiceImpl.java
+++ b/src/main/java/cc/mrbird/febs/mall/service/impl/MallNewsInfoServiceImpl.java
@@ -314,19 +314,19 @@
         if(ObjectUtil.isEmpty(mallProductBuyRecord)){
             throw new FebsException("记录不存在");
         }
-        Integer state = mallProductBuyRecord.getState();
-        if(ProductEnum.PRODUCT_MATE_STATE_WAIT_PAY.getValue() != state){
-            throw new FebsException("记录不是待支付状态");
-        }
+//        Integer state = mallProductBuyRecord.getState();
+//        if(ProductEnum.PRODUCT_MATE_STATE_WAIT_PAY.getValue() != state){
+//            throw new FebsException("记录不是待支付状态");
+//        }
 
         MallProductSellRecord mallProductSellRecord = mallProductSellRecordMapper.selectById(mallProductBuyRecord.getSellRecordId());
         if(ObjectUtil.isEmpty(mallProductSellRecord)){
             throw new FebsException("记录不存在");
         }
-        Integer stateSell = mallProductSellRecord.getState();
-        if(ProductEnum.PRODUCT_MATE_STATE_WAIT_PAY.getValue() != stateSell){
-            throw new FebsException("记录不是待支付状态");
-        }
+//        Integer stateSell = mallProductSellRecord.getState();
+//        if(ProductEnum.PRODUCT_MATE_STATE_WAIT_PAY.getValue() != stateSell){
+//            throw new FebsException("记录不是待支付状态");
+//        }
 
         DateTime payTime = DateUtil.date();
         mallProductBuyRecord.setState(ProductEnum.PRODUCT_MATE_STATE_PAY.getValue());
@@ -365,19 +365,19 @@
         if(ObjectUtil.isEmpty(mallProductBuyRecord)){
             throw new FebsException("记录不存在");
         }
-        Integer state = mallProductBuyRecord.getState();
-        if(ProductEnum.PRODUCT_MATE_STATE_PAY.getValue() != state){
-            throw new FebsException("记录不是已支付状态");
-        }
+//        Integer state = mallProductBuyRecord.getState();
+//        if(ProductEnum.PRODUCT_MATE_STATE_PAY.getValue() != state){
+//            throw new FebsException("记录不是已支付状态");
+//        }
         Long sellRecordId = mallProductBuyRecord.getSellRecordId();
         MallProductSellRecord mallProductSellRecord = mallProductSellRecordMapper.selectById(mallProductBuyRecord.getSellRecordId());
         if(ObjectUtil.isEmpty(mallProductSellRecord)){
             throw new FebsException("记录不存在");
         }
-        Integer stateSell = mallProductSellRecord.getState();
-        if(ProductEnum.PRODUCT_MATE_STATE_PAY.getValue() != stateSell){
-            throw new FebsException("记录不是已支付状态");
-        }
+//        Integer stateSell = mallProductSellRecord.getState();
+//        if(ProductEnum.PRODUCT_MATE_STATE_PAY.getValue() != stateSell){
+//            throw new FebsException("记录不是已支付状态");
+//        }
 
         mallProductBuyRecord.setState(ProductEnum.PRODUCT_MATE_STATE_CONFIRM.getValue());
         mallProductBuyRecordMapper.updateById(mallProductBuyRecord);
@@ -395,10 +395,10 @@
         if(ObjectUtil.isEmpty(mallProductBuyRecord)){
             throw new FebsException("记录不存在");
         }
-        Integer state = mallProductBuyRecord.getState();
-        if(ProductEnum.PRODUCT_MATE_STATE_WAIT_PAY.getValue() != state){
-            throw new FebsException("记录不是待支付状态");
-        }
+//        Integer state = mallProductBuyRecord.getState();
+//        if(ProductEnum.PRODUCT_MATE_STATE_WAIT_PAY.getValue() != state){
+//            throw new FebsException("记录不是待支付状态");
+//        }
         Long sellRecordId = mallProductBuyRecord.getSellRecordId();
         //更新买单子表的数据
         mallProductBuyRecord.setState(ProductEnum.PRODUCT_MATE_STATE_FAIL.getValue());
diff --git a/src/main/java/cc/mrbird/febs/mall/vo/ApiOrderBuyRecordInfoVo.java b/src/main/java/cc/mrbird/febs/mall/vo/ApiOrderBuyRecordInfoVo.java
index 01d80ae..597face 100644
--- a/src/main/java/cc/mrbird/febs/mall/vo/ApiOrderBuyRecordInfoVo.java
+++ b/src/main/java/cc/mrbird/febs/mall/vo/ApiOrderBuyRecordInfoVo.java
@@ -15,7 +15,7 @@
     private String accountLogin;//
     @ApiModelProperty(value = "分配额度、支付金额")
     private BigDecimal pickNftCnt;//分配额度、支付金额
-    @ApiModelProperty(value = "匹配状态0:失败 1:匹配中 2:待支付 3:已支付 4:对方已确认 5:已完成")
+    @ApiModelProperty(value = "匹配状态0:失败 1:匹配中 2:待支付 3:已支付 4:对方已确认 5:已完成 6已投诉")
     private Integer state;//匹配状态0:失败 1:匹配中 2:待支付 3:已支付 4:对方已确认 5:已完成
     @ApiModelProperty(value = "匹配时间")
     private Date orderTime;//匹配时间
diff --git a/src/main/java/cc/mrbird/febs/mall/vo/ApiOrderSellRecordInfoVo.java b/src/main/java/cc/mrbird/febs/mall/vo/ApiOrderSellRecordInfoVo.java
index 60d1004..3e9761d 100644
--- a/src/main/java/cc/mrbird/febs/mall/vo/ApiOrderSellRecordInfoVo.java
+++ b/src/main/java/cc/mrbird/febs/mall/vo/ApiOrderSellRecordInfoVo.java
@@ -23,7 +23,7 @@
     private String nftImg;//支付凭证
     @ApiModelProperty(value = "支付类型 1:微信 2:支付宝 3:银行转账 4:USDT转账")
     private Integer type;//支付类型 1:微信 2:支付宝 3:银行转账 4:USDT转账
-    @ApiModelProperty(value = "匹配状态0:失败 1:匹配中 2:待支付 3:已支付 4:对方已确认 5:已完成")
+    @ApiModelProperty(value = "匹配状态0:失败 1:匹配中 2:待支付 3:已支付 4:对方已确认 5:已完成 6已投诉")
     private Integer state;//匹配状态0:失败 1:匹配中 2:待支付 3:已支付 4:对方已确认 5:已完成
     @ApiModelProperty(value = "微信收款码")
     private String wxQrcode;//微信收款码

--
Gitblit v1.9.1