ZhuDeKang 5 месяцев назад
Родитель
Сommit
e7a5674961

+ 4 - 4
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/controller/PtServiceController.java

@@ -13,8 +13,8 @@ import com.ruoyi.interfaces.domain.*;
 import com.ruoyi.interfaces.domain.vo.MdModelInfoVo;
 import com.ruoyi.interfaces.mapper.PtServiceMapper;
 import com.ruoyi.interfaces.mapper.PtServiceParamMapper;
+import com.ruoyi.interfaces.service.IPtServiceReturnService;
 import com.ruoyi.interfaces.service.PtServiceFileService;
-import com.ruoyi.interfaces.service.PtServiceReturnService;
 import com.ruoyi.interfaces.service.PtServiceService;
 import com.ruoyi.interfaces.service.SysCateService;
 import io.swagger.annotations.ApiOperation;
@@ -42,7 +42,7 @@ public class PtServiceController extends BaseController {
     private PtServiceParamMapper ptServiceParamMapper;
 
     @Autowired
-    private PtServiceReturnService ptServiceReturnService;
+    private IPtServiceReturnService ptServiceReturnService;
 
     @Autowired
     private SysCateService sysCateService;
@@ -105,7 +105,7 @@ public class PtServiceController extends BaseController {
         ptServiceMapper.updateByPrimaryKeySelective(ptService);
 
         List<PtServiceParam> list = ptServiceParamMapper.selectAll(srvId);
-        List<PtServiceReturn> returnList = ptServiceReturnService.listBysrvId(srvId);
+        List<PtServiceReturn> returnList = ptServiceReturnService.selectPtServiceReturnBySrvId(srvId);
         List<PtServiceFile> fileList = ptServiceFileService.selectAll(srvId);
         String url = "/gxpt/api/service/" + ptService.getSrvId() + "/get_data";
         ptService.setUrl(url);
@@ -123,7 +123,7 @@ public class PtServiceController extends BaseController {
     public AjaxResult getById(@PathVariable String srvId) {
         PtService ptService = ptServiceMapper.selectByPrimaryKey(srvId);
         List<PtServiceParam> list = ptServiceParamMapper.selectAll(srvId);
-        List<PtServiceReturn> returnList = ptServiceReturnService.listBysrvId(srvId);
+        List<PtServiceReturn> returnList = ptServiceReturnService.selectPtServiceReturnBySrvId(srvId);
         List<PtServiceFile> fileList = ptServiceFileService.selectAll(srvId);
         Map<String, Object> map = new HashMap<>(3);
         map.put("ptService", ptService);

+ 92 - 36
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/controller/PtServiceReturnController.java

@@ -1,57 +1,113 @@
 package com.ruoyi.interfaces.controller;
 
+import java.util.List;
+import java.util.stream.Collectors;
+import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.common.utils.StringUtils;
+import org.aspectj.weaver.loadtime.Aj;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
-import com.ruoyi.interfaces.core.page.Page;
+import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.interfaces.domain.PtServiceReturn;
-import com.ruoyi.interfaces.service.PtServiceReturnService;
-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.*;
-
-import java.util.List;
+import com.ruoyi.interfaces.service.IPtServiceReturnService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
 
+/**
+ * 返回数据Controller
+ *
+ * @author 朱得糠
+ * @date 2025-08-29
+ */
 @RestController
-@RequestMapping("/pt/service/return")
+@RequestMapping("/service/return")
 public class PtServiceReturnController extends BaseController {
+    @Autowired
+    private IPtServiceReturnService ptServiceReturnService;
 
-    private Logger logger = LoggerFactory.getLogger(getClass());
+    /**
+     * 查询返回数据列表
+     */
+    @GetMapping("/list")
+    public AjaxResult list(PtServiceReturn ptServiceReturn) {
+        if (StringUtils.isEmpty(ptServiceReturn.getSrvId())) return error("服务id不可为空");
+        List<PtServiceReturn> list = ptServiceReturnService.selectPtServiceReturnList(ptServiceReturn);
+        return success(list);
+    }
 
-    @Autowired
-    private PtServiceReturnService ptServiceReturnService;
+    /**
+     * 导出返回数据列表
+     */
+    @Log(title = "返回数据", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, PtServiceReturn ptServiceReturn) {
+        List<PtServiceReturn> list = ptServiceReturnService.selectPtServiceReturnList(ptServiceReturn);
+        ExcelUtil<PtServiceReturn> util = new ExcelUtil<PtServiceReturn>(PtServiceReturn.class);
+        util.exportExcel(response, list, "返回数据数据");
+    }
 
-    @ApiOperation("添加数据")
-    @RequestMapping(value = "/add", method = RequestMethod.POST)
-    public AjaxResult insert(PtServiceReturn ptServiceReturn) {
-        return AjaxResult.check(ptServiceReturnService.insert(ptServiceReturn) > 0);
+    /**
+     * 获取返回数据详细信息
+     */
+    @GetMapping(value = "/{ID}")
+    public AjaxResult getInfo(@PathVariable("ID") Long ID) {
+        return success(ptServiceReturnService.selectPtServiceReturnByID(ID));
     }
 
-    @ApiOperation("添加数据")
-    @RequestMapping(value = "/addList", method = RequestMethod.POST)
-    public AjaxResult inserts(@RequestBody List<PtServiceReturn> returnList) {
-        return AjaxResult.check(ptServiceReturnService.inserts(returnList) > 0);
+    /**
+     * 新增返回数据
+     */
+    @Log(title = "返回数据", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody PtServiceReturn ptServiceReturn) {
+        return toAjax(ptServiceReturnService.insertPtServiceReturn(ptServiceReturn));
     }
 
-    @ApiOperation("数据列表")
-    @RequestMapping(value = "/list")
-    public Page list(@RequestParam String srvId,
-                     @RequestParam(required = false, defaultValue = "1") int page,
-                     @RequestParam(required = false, defaultValue = "100") int rows) {
-        return ptServiceReturnService.list(srvId, page, rows);
+    @PostMapping("/addList")
+    public AjaxResult addList(@RequestBody List<PtServiceReturn> list) {
+        List<PtServiceReturn> collect = list.stream().filter(p -> StringUtils.isNotNull(p.getSrvId()))
+                .filter(p -> StringUtils.isNotNull(p.getParentId()))
+                .filter(p -> StringUtils.isNotNull(p.getParamCode()))
+                .filter(p -> StringUtils.isNotNull(p.getParamType())).collect(Collectors.toList());
+        if (StringUtils.isEmpty(collect)) return error("数据为空");
+
+        ptServiceReturnService.deletePtServiceReturnBySrvID(collect.get(0).getSrvId());
+
+        for (int i = 0; i < collect.size(); i++) {
+            collect.get(i).setSort(i);
+        }
+
+        collect.stream().forEach(ptServiceReturnService::insertPtServiceReturn);
+        return success();
     }
 
-    @ApiOperation("数据列表")
-    @GetMapping(value = "/list/{srvId}")
-    public AjaxResult listBysrvId(@PathVariable String srvId) {
-        return AjaxResult.success(ptServiceReturnService.listBysrvId(srvId));
+    /**
+     * 修改返回数据
+     */
+    @Log(title = "返回数据", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody PtServiceReturn ptServiceReturn) {
+        return toAjax(ptServiceReturnService.updatePtServiceReturn(ptServiceReturn));
     }
 
-    @ApiOperation("根据主键删除数据")
-    @RequestMapping(value = "/delete", method = RequestMethod.GET)
-    public AjaxResult delete(@RequestParam String srvId, @RequestParam String paramCode) {
-        return AjaxResult.check(ptServiceReturnService.delete(srvId, paramCode) > 0);
+    /**
+     * 删除返回数据
+     */
+    @Log(title = "返回数据", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{IDs}")
+    public AjaxResult remove(@PathVariable Long[] IDs) {
+        return toAjax(ptServiceReturnService.deletePtServiceReturnByIDs(IDs));
     }
 }

+ 1 - 1
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/controller/PtTreeCateController.java

@@ -159,7 +159,7 @@ public class PtTreeCateController extends BaseController {
      * @return
      */
     @GetMapping(value = "/modelTreeSelect")
-    public AjaxResult modelTreeSelect(PtTreeCate ptTreeCate) {
+    public AjaxResult modelTreeSelect(PtTreeCate ptTreeCate)    {
         ptTreeCate.setTreeType("MODEL");
         String level = StringUtils.isNull(ptTreeCate.getParams().get("level")) ? "3" : ptTreeCate.getParams().get("level").toString();
 

+ 142 - 33
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/domain/PtServiceReturn.java

@@ -1,82 +1,191 @@
 package com.ruoyi.interfaces.domain;
 
-import java.io.Serializable;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 返回数据对象 pt_service_return
+ * 
+ * @author 朱得糠
+ * @date 2025-08-29
+ */
+public class PtServiceReturn extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** ID */
+    private Long id;
+
+    /** 父id */
+    @Excel(name = "父id")
+    private Long parentId;
 
-public class PtServiceReturn extends PtServiceParamKey implements Serializable {
+    /** 服务ID */
+    @Excel(name = "服务ID")
     private String srvId;
+
+    /** CODE */
+    @Excel(name = "CODE")
     private String paramCode;
 
+    /** 字段名称 */
+    @Excel(name = "字段名称")
     private String paramName;
 
+    /** 字段类型 */
+    @Excel(name = "字段类型")
     private String paramType;
 
+    /** 示例值 */
+    @Excel(name = "示例值")
     private String paramValue;
 
+    /** 参数格式 */
+    @Excel(name = "参数格式")
     private String paramFormat;
 
+    /** 备注 */
+    @Excel(name = "备注")
     private String paramNote;
 
-    private static final long serialVersionUID = 1L;
+    /** 是否数组 0 = 否;1 = 是 */
+    @Excel(name = "是否数组 0 = 否;1 = 是")
+    private String isArray;
 
-    @Override
-    public String getSrvId() {
-        return srvId;
+    /** 数组坐标 */
+    @Excel(name = "数组坐标")
+    private Long arrayIndex;
+
+    /** 排序 */
+    @Excel(name = "排序")
+    private Integer sort;
+
+    public void setId(Long id)
+    {
+        this.id = id;
     }
 
-    @Override
-    public void setSrvId(String srvId) {
-        this.srvId = srvId;
+    public Long getId()
+    {
+        return id;
+    }
+    public void setParentId(Long parentId) 
+    {
+        this.parentId = parentId;
     }
 
-    @Override
-    public String getParamCode() {
-        return paramCode;
+    public Long getParentId() 
+    {
+        return parentId;
+    }
+    public void setSrvId(String srvId) 
+    {
+        this.srvId = srvId;
     }
 
-    @Override
-    public void setParamCode(String paramCode) {
+    public String getSrvId() 
+    {
+        return srvId;
+    }
+    public void setParamCode(String paramCode) 
+    {
         this.paramCode = paramCode;
     }
 
-    public String getParamName() {
-        return paramName;
+    public String getParamCode() 
+    {
+        return paramCode;
+    }
+    public void setParamName(String paramName) 
+    {
+        this.paramName = paramName;
     }
 
-    public void setParamName(String paramName) {
-        this.paramName = paramName == null ? null : paramName.trim();
+    public String getParamName() 
+    {
+        return paramName;
+    }
+    public void setParamType(String paramType) 
+    {
+        this.paramType = paramType;
     }
 
-    public String getParamType() {
+    public String getParamType() 
+    {
         return paramType;
     }
-
-    public void setParamType(String paramType) {
-        this.paramType = paramType == null ? null : paramType.trim();
+    public void setParamValue(String paramValue) 
+    {
+        this.paramValue = paramValue;
     }
 
-    public String getParamValue() {
+    public String getParamValue() 
+    {
         return paramValue;
     }
-
-    public void setParamValue(String paramValue) {
-        this.paramValue = paramValue == null ? null : paramValue.trim();
+    public void setParamFormat(String paramFormat) 
+    {
+        this.paramFormat = paramFormat;
     }
 
-    public String getParamFormat() {
+    public String getParamFormat() 
+    {
         return paramFormat;
     }
-
-    public void setParamFormat(String paramFormat) {
-        this.paramFormat = paramFormat == null ? null : paramFormat.trim();
+    public void setParamNote(String paramNote) 
+    {
+        this.paramNote = paramNote;
     }
 
-    public String getParamNote() {
+    public String getParamNote() 
+    {
         return paramNote;
     }
+    public void setIsArray(String isArray) 
+    {
+        this.isArray = isArray;
+    }
+
+    public String getIsArray() 
+    {
+        return isArray;
+    }
+    public void setArrayIndex(Long arrayIndex) 
+    {
+        this.arrayIndex = arrayIndex;
+    }
 
-    public void setParamNote(String paramNote) {
-        this.paramNote = paramNote == null ? null : paramNote.trim();
+    public Long getArrayIndex() 
+    {
+        return arrayIndex;
+    }
+    public void setSort(Integer sort)
+    {
+        this.sort = sort;
     }
 
+    public Integer getSort()
+    {
+        return sort;
+    }
 
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("ID", getId())
+            .append("parentId", getParentId())
+            .append("srvId", getSrvId())
+            .append("paramCode", getParamCode())
+            .append("paramName", getParamName())
+            .append("paramType", getParamType())
+            .append("paramValue", getParamValue())
+            .append("paramFormat", getParamFormat())
+            .append("paramNote", getParamNote())
+            .append("isArray", getIsArray())
+            .append("arrayIndex", getArrayIndex())
+            .append("SORT", getSort())
+            .toString();
+    }
 }

+ 53 - 24
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/mapper/PtServiceReturnMapper.java

@@ -1,40 +1,69 @@
 package com.ruoyi.interfaces.mapper;
 
+import java.util.List;
+
 import com.ruoyi.common.annotation.DataSource;
 import com.ruoyi.common.enums.DataSourceType;
-import com.ruoyi.interfaces.domain.PtServiceParamKey;
 import com.ruoyi.interfaces.domain.PtServiceReturn;
-import org.apache.ibatis.annotations.Param;
-import org.springframework.stereotype.Repository;
+import org.apache.ibatis.annotations.Mapper;
 
-import java.util.List;
-
-@Repository
+/**
+ * 返回数据Mapper接口
+ * 
+ * @author 朱得糠
+ * @date 2025-08-29
+ */
 @DataSource(DataSourceType.SLAVE)
-public interface PtServiceReturnMapper {
-
-    int deleteByPrimaryKey(PtServiceParamKey key);
-
-    int insert(PtServiceReturn record);
-
-    int insertSelective(PtServiceReturn record);
-
-    PtServiceReturn selectByPrimaryKey(PtServiceParamKey key);
+@Mapper
+public interface PtServiceReturnMapper 
+{
+    /**
+     * 查询返回数据
+     * 
+     * @param ID 返回数据主键
+     * @return 返回数据
+     */
+    public PtServiceReturn selectPtServiceReturnByID(Long ID);
 
-    int updateByPrimaryKeySelective(PtServiceReturn record);
+    /**
+     * 查询返回数据列表
+     * 
+     * @param ptServiceReturn 返回数据
+     * @return 返回数据集合
+     */
+    public List<PtServiceReturn> selectPtServiceReturnList(PtServiceReturn ptServiceReturn);
 
-    int updateByPrimaryKey(PtServiceReturn record);
+    /**
+     * 新增返回数据
+     * 
+     * @param ptServiceReturn 返回数据
+     * @return 结果
+     */
+    public int insertPtServiceReturn(PtServiceReturn ptServiceReturn);
 
-    List<PtServiceReturn> selectAll(String srvid);
+    /**
+     * 修改返回数据
+     * 
+     * @param ptServiceReturn 返回数据
+     * @return 结果
+     */
+    public int updatePtServiceReturn(PtServiceReturn ptServiceReturn);
 
     /**
-     * 查询数据列表
-     *
-     * @param srvId
-     * @return
+     * 删除返回数据
+     * 
+     * @param ID 返回数据主键
+     * @return 结果
      */
-    List<PtServiceReturn> listBySrvId(@Param("srvId") String srvId);
+    public int deletePtServiceReturnByID(Long ID);
 
-    int deleteBySrvId(@Param("srvId") String srvId);
+    /**
+     * 批量删除返回数据
+     * 
+     * @param IDs 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deletePtServiceReturnByIDs(Long[] IDs);
 
+    int deletePtServiceReturnBySrvID(String srvId);
 }

+ 65 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/service/IPtServiceReturnService.java

@@ -0,0 +1,65 @@
+package com.ruoyi.interfaces.service;
+
+import java.util.List;
+import com.ruoyi.interfaces.domain.PtServiceReturn;
+
+/**
+ * 返回数据Service接口
+ * 
+ * @author 朱得糠
+ * @date 2025-08-29
+ */
+public interface IPtServiceReturnService 
+{
+    /**
+     * 查询返回数据
+     * 
+     * @param ID 返回数据主键
+     * @return 返回数据
+     */
+    public PtServiceReturn selectPtServiceReturnByID(Long ID);
+
+    /**
+     * 查询返回数据列表
+     * 
+     * @param ptServiceReturn 返回数据
+     * @return 返回数据集合
+     */
+    public List<PtServiceReturn> selectPtServiceReturnList(PtServiceReturn ptServiceReturn);
+
+    /**
+     * 新增返回数据
+     * 
+     * @param ptServiceReturn 返回数据
+     * @return 结果
+     */
+    public int insertPtServiceReturn(PtServiceReturn ptServiceReturn);
+
+    /**
+     * 修改返回数据
+     * 
+     * @param ptServiceReturn 返回数据
+     * @return 结果
+     */
+    public int updatePtServiceReturn(PtServiceReturn ptServiceReturn);
+
+    /**
+     * 批量删除返回数据
+     * 
+     * @param IDs 需要删除的返回数据主键集合
+     * @return 结果
+     */
+    public int deletePtServiceReturnByIDs(Long[] IDs);
+
+    /**
+     * 删除返回数据信息
+     * 
+     * @param ID 返回数据主键
+     * @return 结果
+     */
+    public int deletePtServiceReturnByID(Long ID);
+
+    List<PtServiceReturn> selectPtServiceReturnBySrvId(String srvId);
+
+    int deletePtServiceReturnBySrvID(String srvId);
+}

+ 0 - 25
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/service/PtServiceReturnService.java

@@ -1,25 +0,0 @@
-package com.ruoyi.interfaces.service;
-
-import com.ruoyi.interfaces.domain.PtServiceReturn;
-import com.ruoyi.interfaces.core.page.Page;
-
-import java.util.List;
-
-/**
- * @author LinQiLong
- * @date 2022/1/26 11:37
- */
-public interface PtServiceReturnService {
-
-    public int insert(PtServiceReturn ptServiceReturn);
-
-    public int update(PtServiceReturn ptServiceReturn);
-
-    public int inserts(List<PtServiceReturn> serviceParamList);
-
-    public Page list(String srvId, int page, int rows);
-
-    public List<PtServiceReturn> listBysrvId(String srvId);
-
-    public int delete(String srvId, String paramCode);
-}

+ 77 - 55
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/service/impl/PtServiceReturnServiceImpl.java

@@ -1,84 +1,106 @@
 package com.ruoyi.interfaces.service.impl;
 
-import com.alibaba.fastjson2.JSON;
-import com.github.pagehelper.PageHelper;
-import com.ruoyi.interfaces.core.page.Page;
-import com.ruoyi.interfaces.core.page.PageUtils;
-import com.ruoyi.interfaces.domain.PtServiceParamKey;
-import com.ruoyi.interfaces.domain.PtServiceReturn;
-import com.ruoyi.interfaces.mapper.PtServiceReturnMapper;
-import com.ruoyi.interfaces.service.PtServiceReturnService;
-import org.apache.commons.collections4.CollectionUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Service;
-
 import java.util.List;
-import java.util.stream.Collectors;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.interfaces.mapper.PtServiceReturnMapper;
+import com.ruoyi.interfaces.domain.PtServiceReturn;
+import com.ruoyi.interfaces.service.IPtServiceReturnService;
 
 /**
- * @author LinQiLong
- * @date 2022/1/26 11:37
+ * 返回数据Service业务层处理
+ * 
+ * @author 朱得糠
+ * @date 2025-08-29
  */
 @Service
-public class PtServiceReturnServiceImpl implements PtServiceReturnService {
-
-    private Logger logger = LoggerFactory.getLogger(getClass());
+public class PtServiceReturnServiceImpl implements IPtServiceReturnService 
+{
+    @Autowired
+    private PtServiceReturnMapper ptServiceReturnMapper;
 
-    private final PtServiceReturnMapper ptServiceReturnMapper;
-
-    public PtServiceReturnServiceImpl(PtServiceReturnMapper ptServiceReturnMapper) {
-        this.ptServiceReturnMapper = ptServiceReturnMapper;
+    /**
+     * 查询返回数据
+     * 
+     * @param ID 返回数据主键
+     * @return 返回数据
+     */
+    @Override
+    public PtServiceReturn selectPtServiceReturnByID(Long ID)
+    {
+        return ptServiceReturnMapper.selectPtServiceReturnByID(ID);
     }
 
+    /**
+     * 查询返回数据列表
+     * 
+     * @param ptServiceReturn 返回数据
+     * @return 返回数据
+     */
     @Override
-    public int insert(PtServiceReturn ptServiceReturn) {
-        logger.info("insert:{}", JSON.toJSONString(ptServiceReturn));
-        return ptServiceReturnMapper.insert(ptServiceReturn);
+    public List<PtServiceReturn> selectPtServiceReturnList(PtServiceReturn ptServiceReturn)
+    {
+        return ptServiceReturnMapper.selectPtServiceReturnList(ptServiceReturn);
     }
 
+    /**
+     * 新增返回数据
+     * 
+     * @param ptServiceReturn 返回数据
+     * @return 结果
+     */
     @Override
-    public int update(PtServiceReturn ptServiceReturn) {
-        logger.info("update:{}", JSON.toJSONString(ptServiceReturn));
-        return ptServiceReturnMapper.updateByPrimaryKeySelective(ptServiceReturn);
+    public int insertPtServiceReturn(PtServiceReturn ptServiceReturn)
+    {
+        return ptServiceReturnMapper.insertPtServiceReturn(ptServiceReturn);
     }
 
+    /**
+     * 修改返回数据
+     * 
+     * @param ptServiceReturn 返回数据
+     * @return 结果
+     */
     @Override
-    public int inserts(List<PtServiceReturn> serviceParamList) {
-        List<PtServiceReturn> ptServiceParamList = serviceParamList.stream()
-                .filter(p -> StringUtils.isNotBlank(p.getSrvId()))
-                .filter(p -> StringUtils.isNotBlank(p.getParamCode()))
-                .filter(p -> StringUtils.isNotBlank(p.getParamName()))
-                .filter(p -> StringUtils.isNotBlank(p.getParamType()))
-                .collect(Collectors.toList());
-
-        if (CollectionUtils.isEmpty(ptServiceParamList)) {
-            return 0;
-        }
-
-        String srvId = ptServiceParamList.get(0).getSrvId();
-        ptServiceReturnMapper.deleteBySrvId(srvId);
-        ptServiceParamList.forEach(ptServiceReturnMapper::insert);
-        return 1;
+    public int updatePtServiceReturn(PtServiceReturn ptServiceReturn)
+    {
+        return ptServiceReturnMapper.updatePtServiceReturn(ptServiceReturn);
     }
 
+    /**
+     * 批量删除返回数据
+     * 
+     * @param IDs 需要删除的返回数据主键
+     * @return 结果
+     */
     @Override
-    public Page list(String srvId, int page, int rows) {
-        PageHelper.startPage(page, rows);
-        List<PtServiceReturn> list = ptServiceReturnMapper.listBySrvId(srvId);
-        return PageUtils.convert(list);
+    public int deletePtServiceReturnByIDs(Long[] IDs)
+    {
+        return ptServiceReturnMapper.deletePtServiceReturnByIDs(IDs);
     }
 
+    /**
+     * 删除返回数据信息
+     * 
+     * @param ID 返回数据主键
+     * @return 结果
+     */
     @Override
-    public List<PtServiceReturn> listBysrvId(String srvId) {
-        return ptServiceReturnMapper.listBySrvId(srvId);
+    public int deletePtServiceReturnByID(Long ID)
+    {
+        return ptServiceReturnMapper.deletePtServiceReturnByID(ID);
     }
 
+    @Override
+    public List<PtServiceReturn> selectPtServiceReturnBySrvId(String srvId) {
+        PtServiceReturn ptServiceReturn = new PtServiceReturn();
+        ptServiceReturn.setSrvId(srvId);
+        return ptServiceReturnMapper.selectPtServiceReturnList(ptServiceReturn);
+    }
 
     @Override
-    public int delete(String srvId, String paramCode) {
-        PtServiceParamKey key = PtServiceParamKey.builder().srvId(srvId).paramCode(paramCode).build();
-        return ptServiceReturnMapper.deleteByPrimaryKey(key);
+    public int deletePtServiceReturnBySrvID(String srvId) {
+
+        return ptServiceReturnMapper.deletePtServiceReturnBySrvID(srvId);
     }
 }

+ 3 - 3
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/service/impl/ServiceDataViewServiceImpl.java

@@ -6,7 +6,7 @@ import com.ruoyi.common.exception.CheckException;
 import com.ruoyi.common.utils.OkHttpUtils;
 import com.ruoyi.interfaces.domain.PtService;
 import com.ruoyi.interfaces.domain.PtServiceReturn;
-import com.ruoyi.interfaces.service.PtServiceReturnService;
+import com.ruoyi.interfaces.service.IPtServiceReturnService;
 import com.ruoyi.interfaces.service.PtServiceService;
 import com.ruoyi.interfaces.service.ServiceDataViewService;
 import org.slf4j.Logger;
@@ -34,7 +34,7 @@ public class ServiceDataViewServiceImpl implements ServiceDataViewService {
     private PtServiceService ptServiceService;
 
     @Autowired
-    private PtServiceReturnService ptServiceReturnService;
+    private IPtServiceReturnService ptServiceReturnService;
 
     @Override
     public Map<String, Object> getDataView(String srvId) {
@@ -42,7 +42,7 @@ public class ServiceDataViewServiceImpl implements ServiceDataViewService {
 
         PtService ptService = ptServiceService.get(srvId);
         Optional.ofNullable(ptService).orElseThrow(() -> new CheckException("url invalid"));
-        List<PtServiceReturn> ptServiceReturnList = ptServiceReturnService.listBysrvId(srvId);
+        List<PtServiceReturn> ptServiceReturnList = ptServiceReturnService.selectPtServiceReturnBySrvId(srvId);
 
         //第二步:设置请求参数 ptService.getUrl()
         Map<String, Object> queryParams = new HashMap<>();

+ 97 - 130
ruoyi-api-patform/src/main/resources/mapper/interfaces/PtServiceReturnMapper.xml

@@ -1,144 +1,111 @@
-<?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">
+<?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="com.ruoyi.interfaces.mapper.PtServiceReturnMapper">
-    <resultMap id="BaseResultMap" type="com.ruoyi.interfaces.domain.PtServiceReturn">
-        <id column="SRV_ID" jdbcType="VARCHAR" property="srvId"/>
-        <id column="PARAM_CODE" jdbcType="VARCHAR" property="paramCode"/>
-        <result column="PARAM_NAME" jdbcType="VARCHAR" property="paramName"/>
-        <result column="PARAM_TYPE" jdbcType="VARCHAR" property="paramType"/>
-        <result column="PARAM_VALUE" jdbcType="VARCHAR" property="paramValue"/>
-        <result column="PARAM_FORMAT" jdbcType="VARCHAR" property="paramFormat"/>
-        <result column="PARAM_NOTE" jdbcType="VARCHAR" property="paramNote"/>
+
+    <resultMap type="com.ruoyi.interfaces.domain.PtServiceReturn" id="PtServiceReturnResult">
+        <result property="id"    column="ID"    />
+        <result property="parentId"    column="PARENT_ID"    />
+        <result property="srvId"    column="SRV_ID"    />
+        <result property="paramCode"    column="PARAM_CODE"    />
+        <result property="paramName"    column="PARAM_NAME"    />
+        <result property="paramType"    column="PARAM_TYPE"    />
+        <result property="paramValue"    column="PARAM_VALUE"    />
+        <result property="paramFormat"    column="PARAM_FORMAT"    />
+        <result property="paramNote"    column="PARAM_NOTE"    />
+        <result property="isArray"    column="IS_ARRAY"    />
+        <result property="arrayIndex"    column="ARRAY_INDEX"    />
+        <result property="sort"    column="SORT"    />
     </resultMap>
-    <sql id="Base_Column_List">
-        SRV_ID
-        , PARAM_CODE, PARAM_NAME, PARAM_TYPE, PARAM_VALUE, PARAM_FORMAT, PARAM_NOTE
-    </sql>
-    <select id="selectByPrimaryKey" parameterType="com.ruoyi.interfaces.domain.PtServiceParamKey"
-            resultMap="BaseResultMap">
-        select
-        <include refid="Base_Column_List"/>
-        from PT_SERVICE_RETURN
-        where SRV_ID = #{srvId,jdbcType=VARCHAR}
-        and PARAM_CODE = #{paramCode,jdbcType=VARCHAR}
-    </select>
 
-    <delete id="deleteByPrimaryKey" parameterType="com.ruoyi.interfaces.domain.PtServiceParamKey">
-        delete
-        from PT_SERVICE_RETURN
-        where SRV_ID = #{srvId,jdbcType=VARCHAR}
-          and PARAM_CODE = #{paramCode,jdbcType=VARCHAR}
-    </delete>
+    <sql id="selectPtServiceReturnVo">
+        select ID, PARENT_ID, SRV_ID, PARAM_CODE, PARAM_NAME, PARAM_TYPE, PARAM_VALUE, PARAM_FORMAT, PARAM_NOTE, IS_ARRAY, ARRAY_INDEX, SORT from pt_service_return
+    </sql>
 
-    <delete id="deleteBySrvId" parameterType="string">
-        delete
-        from PT_SERVICE_RETURN
-        where SRV_ID = #{srvId,jdbcType=VARCHAR}
-    </delete>
+    <select id="selectPtServiceReturnList" parameterType="com.ruoyi.interfaces.domain.PtServiceReturn" resultMap="PtServiceReturnResult">
+        <include refid="selectPtServiceReturnVo"/>
+        <where>
+            <if test="parentId != null "> and PARENT_ID = #{parentId}</if>
+            <if test="srvId != null  and srvId != ''"> and SRV_ID = #{srvId}</if>
+            <if test="paramCode != null  and paramCode != ''"> and PARAM_CODE = #{paramCode}</if>
+            <if test="paramName != null  and paramName != ''"> and PARAM_NAME like concat('%', #{paramName}, '%')</if>
+            <if test="paramType != null  and paramType != ''"> and PARAM_TYPE = #{paramType}</if>
+            <if test="paramValue != null  and paramValue != ''"> and PARAM_VALUE = #{paramValue}</if>
+            <if test="paramFormat != null  and paramFormat != ''"> and PARAM_FORMAT = #{paramFormat}</if>
+            <if test="paramNote != null  and paramNote != ''"> and PARAM_NOTE = #{paramNote}</if>
+            <if test="isArray != null  and isArray != ''"> and IS_ARRAY = #{isArray}</if>
+            <if test="arrayIndex != null "> and ARRAY_INDEX = #{arrayIndex}</if>
+            <if test="sort != null "> and SORT = #{sort}</if>
+        </where>
+    </select>
 
-    <insert id="insert" parameterType="com.ruoyi.interfaces.domain.PtServiceReturn">
-        insert into PT_SERVICE_RETURN (SRV_ID, PARAM_CODE, PARAM_NAME,
-                                       PARAM_TYPE, PARAM_VALUE, PARAM_FORMAT,
-                                       PARAM_NOTE)
-        values (#{srvId,jdbcType=VARCHAR}, #{paramCode,jdbcType=VARCHAR}, #{paramName,jdbcType=VARCHAR},
-                #{paramType,jdbcType=VARCHAR}, #{paramValue,jdbcType=VARCHAR}, #{paramFormat,jdbcType=VARCHAR},
-                #{paramNote,jdbcType=VARCHAR})
-    </insert>
+    <select id="selectPtServiceReturnByID" parameterType="Long" resultMap="PtServiceReturnResult">
+        <include refid="selectPtServiceReturnVo"/>
+        where ID = #{ID}
+    </select>
 
-    <insert id="insertSelective" parameterType="com.ruoyi.interfaces.domain.PtServiceReturn">
-        insert into PT_SERVICE_RETURN
+    <insert id="insertPtServiceReturn" parameterType="com.ruoyi.interfaces.domain.PtServiceReturn" useGeneratedKeys="true" keyProperty="ID">
+        insert into pt_service_return
         <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="srvId != null">
-                SRV_ID,
-            </if>
-            <if test="paramCode != null">
-                PARAM_CODE,
-            </if>
-            <if test="paramName != null">
-                PARAM_NAME,
-            </if>
-            <if test="paramType != null">
-                PARAM_TYPE,
-            </if>
-            <if test="paramValue != null">
-                PARAM_VALUE,
-            </if>
-            <if test="paramFormat != null">
-                PARAM_FORMAT,
-            </if>
-            <if test="paramNote != null">
-                PARAM_NOTE,
-            </if>
+            <if test="id != null">ID,</if>
+            <if test="parentId != null">PARENT_ID,</if>
+            <if test="srvId != null and srvId != ''">SRV_ID,</if>
+            <if test="paramCode != null and paramCode != ''">PARAM_CODE,</if>
+            <if test="paramName != null and paramName != ''">PARAM_NAME,</if>
+            <if test="paramType != null">PARAM_TYPE,</if>
+            <if test="paramValue != null">PARAM_VALUE,</if>
+            <if test="paramFormat != null">PARAM_FORMAT,</if>
+            <if test="paramNote != null">PARAM_NOTE,</if>
+            <if test="isArray != null">IS_ARRAY,</if>
+            <if test="arrayIndex != null">ARRAY_INDEX,</if>
+            <if test="sort != null">SORT,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="srvId != null">
-                #{srvId,jdbcType=VARCHAR},
-            </if>
-            <if test="paramCode != null">
-                #{paramCode,jdbcType=VARCHAR},
-            </if>
-            <if test="paramName != null">
-                #{paramName,jdbcType=VARCHAR},
-            </if>
-            <if test="paramType != null">
-                #{paramType,jdbcType=VARCHAR},
-            </if>
-            <if test="paramValue != null">
-                #{paramValue,jdbcType=VARCHAR},
-            </if>
-            <if test="paramFormat != null">
-                #{paramFormat,jdbcType=VARCHAR},
-            </if>
-            <if test="paramNote != null">
-                #{paramNote,jdbcType=VARCHAR},
-            </if>
+            <if test="id != null">#{id},</if>
+            <if test="parentId != null">#{parentId},</if>
+            <if test="srvId != null and srvId != ''">#{srvId},</if>
+            <if test="paramCode != null and paramCode != ''">#{paramCode},</if>
+            <if test="paramName != null and paramName != ''">#{paramName},</if>
+            <if test="paramType != null">#{paramType},</if>
+            <if test="paramValue != null">#{paramValue},</if>
+            <if test="paramFormat != null">#{paramFormat},</if>
+            <if test="paramNote != null">#{paramNote},</if>
+            <if test="isArray != null">#{isArray},</if>
+            <if test="arrayIndex != null">#{arrayIndex},</if>
+            <if test="sort != null">#{sort},</if>
         </trim>
     </insert>
-    <update id="updateByPrimaryKeySelective" parameterType="com.ruoyi.interfaces.domain.PtServiceReturn">
-        update PT_SERVICE_RETURN
-        <set>
-            <if test="paramName != null">
-                PARAM_NAME = #{paramName,jdbcType=VARCHAR},
-            </if>
-            <if test="paramType != null">
-                PARAM_TYPE = #{paramType,jdbcType=VARCHAR},
-            </if>
-            <if test="paramValue != null">
-                PARAM_VALUE = #{paramValue,jdbcType=VARCHAR},
-            </if>
-            <if test="paramFormat != null">
-                PARAM_FORMAT = #{paramFormat,jdbcType=VARCHAR},
-            </if>
-            <if test="paramNote != null">
-                PARAM_NOTE = #{paramNote,jdbcType=VARCHAR},
-            </if>
-        </set>
-        where SRV_ID = #{srvId,jdbcType=VARCHAR}
-        and PARAM_CODE = #{paramCode,jdbcType=VARCHAR}
-    </update>
-    <update id="updateByPrimaryKey" parameterType="com.ruoyi.interfaces.domain.PtServiceReturn">
-        update PT_SERVICE_RETURN
-        set PARAM_NAME   = #{paramName,jdbcType=VARCHAR},
-            PARAM_TYPE   = #{paramType,jdbcType=VARCHAR},
-            PARAM_VALUE  = #{paramValue,jdbcType=VARCHAR},
-            PARAM_FORMAT = #{paramFormat,jdbcType=VARCHAR},
-            PARAM_NOTE   = #{paramNote,jdbcType=VARCHAR}
-        where SRV_ID = #{srvId,jdbcType=VARCHAR}
-          and PARAM_CODE = #{paramCode,jdbcType=VARCHAR}
-    </update>
 
-    <!--查询数据列表-->
-    <select id="selectAll" parameterType="string" resultMap="BaseResultMap">
-        select
-        <include refid="Base_Column_List"/>
-        from PT_SERVICE_RETURN where SRV_ID = #{srvId,jdbcType=VARCHAR}
-    </select>
+    <update id="updatePtServiceReturn" parameterType="com.ruoyi.interfaces.domain.PtServiceReturn">
+        update pt_service_return
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="parentId != null">PARENT_ID = #{parentId},</if>
+            <if test="srvId != null and srvId != ''">SRV_ID = #{srvId},</if>
+            <if test="paramCode != null and paramCode != ''">PARAM_CODE = #{paramCode},</if>
+            <if test="paramName != null and paramName != ''">PARAM_NAME = #{paramName},</if>
+            <if test="paramType != null">PARAM_TYPE = #{paramType},</if>
+            <if test="paramValue != null">PARAM_VALUE = #{paramValue},</if>
+            <if test="paramFormat != null">PARAM_FORMAT = #{paramFormat},</if>
+            <if test="paramNote != null">PARAM_NOTE = #{paramNote},</if>
+            <if test="isArray != null">IS_ARRAY = #{isArray},</if>
+            <if test="arrayIndex != null">ARRAY_INDEX = #{arrayIndex},</if>
+            <if test="sort != null">SORT = #{sort},</if>
+        </trim>
+        where ID = #{ID}
+    </update>
 
-    <select id="listBySrvId" parameterType="string" resultMap="BaseResultMap">
-        SELECT
-        <include refid="Base_Column_List"/>
-        FROM PT_SERVICE_RETURN
-        WHERE SRV_ID = #{srvId,jdbcType=VARCHAR}
-    </select>
+    <delete id="deletePtServiceReturnByID" parameterType="Long">
+        delete from pt_service_return where ID = #{id}
+    </delete>
 
-</mapper>
+    <delete id="deletePtServiceReturnByIDs" parameterType="String">
+        delete from pt_service_return where ID in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+    <delete id="deletePtServiceReturnBySrvID">
+        delete from pt_service_return where SRV_ID = #{srvId}
+    </delete>
+</mapper>