xucaiqin 1 tuần trước cách đây
mục cha
commit
d661ef929d

+ 4 - 2
sckw-modules/sckw-system/src/main/java/com/sckw/system/controller/KwsComplaintController.java

@@ -41,6 +41,7 @@ public class KwsComplaintController {
     }
 
     @GetMapping(value = "/scan", produces = "text/html;charset=UTF-8")
+    @Operation(summary = "h5投诉页面", description = "扫码打开h5页面")
     public String scanPage() {
         return """
                 <!doctype html>
@@ -161,7 +162,7 @@ public class KwsComplaintController {
                   });
                 
                   document.getElementById("resetBtn").addEventListener("click", () => {
-                    document.getElementById("typeCode").value = "2";
+                    document.getElementById("typeCode").value = "1";
                     document.getElementById("targetName").value = "";
                     document.getElementById("content").value = "";
                     initDate();
@@ -185,7 +186,7 @@ public class KwsComplaintController {
                       typeCode,
                       targetName,
                       content,
-                      occurTime: occurTime.length === 16 ? (occurTime + ":00") : occurTime,
+                      occurTime: occurTime.length === 16 ? (occurTime.replace('T', ' ') + ":00") : occurTime.replace('T', ' '),
                       isAnonymous: true,
                       fileUrl: state.fileUrl || "",
                       fileName: state.fileName || "",
@@ -213,6 +214,7 @@ public class KwsComplaintController {
     }
 
     @PostMapping("/scan/submit")
+    @Operation(summary = "h5投诉接口", description = "h5投诉接口")
     public BaseResult<ComplaintDetailResVo> scanSubmit(@RequestBody @Valid ComplaintAppSubmitReqVo reqVo) {
         return BaseResult.success(kwsComplaintService.submitScanComplaint(reqVo));
     }

+ 34 - 0
sckw-modules/sckw-system/src/main/java/com/sckw/system/model/pojo/ChannelEnum.java

@@ -0,0 +1,34 @@
+package com.sckw.system.model.pojo;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+import java.util.Arrays;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+
+@AllArgsConstructor
+@Getter
+public enum ChannelEnum {
+
+
+    APP(1, "APP"),
+    SCAN(2, "扫码");
+
+    private final Integer code;
+    private final String msg;
+
+
+    public static String getNameByCode(Integer code) {
+        ChannelEnum[] enums = ChannelEnum.values();
+        for (ChannelEnum instance : enums) {
+            if (Objects.equals(instance.getCode(), code)) {
+                return instance.getMsg();
+            }
+        }
+        return null;
+    }
+}

+ 3 - 0
sckw-modules/sckw-system/src/main/java/com/sckw/system/model/vo/res/ComplaintManageItemResVo.java

@@ -18,6 +18,9 @@ public class ComplaintManageItemResVo implements Serializable {
     @Schema(description = "投诉ID", example = "1")
     private Long id;
 
+    @Schema(description = "来源", example = "app")
+    private String channel;
+
     @Schema(description = "投诉编号", example = "CT20260603000001")
     private String complaintNo;
 

+ 2 - 0
sckw-modules/sckw-system/src/main/java/com/sckw/system/service/KwsComplaintService.java

@@ -13,6 +13,7 @@ import com.sckw.core.web.response.result.PageDataResult;
 import com.sckw.system.model.TComplaint;
 import com.sckw.system.model.TComplaintAttachment;
 import com.sckw.system.model.TComplaintHandleLog;
+import com.sckw.system.model.pojo.ChannelEnum;
 import com.sckw.system.model.vo.req.ComplaintAppListReqVo;
 import com.sckw.system.model.vo.req.ComplaintAppSubmitReqVo;
 import com.sckw.system.model.vo.req.ComplaintManagePageReqVo;
@@ -269,6 +270,7 @@ public class KwsComplaintService {
         ComplaintManageItemResVo vo = new ComplaintManageItemResVo();
         vo.setId(complaint.getId());
         vo.setComplaintNo(complaint.getComplaintNo());
+        vo.setChannel(ChannelEnum.getNameByCode(complaint.getChannel()));
         vo.setTypeCode(complaint.getTypeCode());
         vo.setTypeName(typeName(complaint.getTypeCode()));
         vo.setTargetName(complaint.getTargetName());