Sfoglia il codice sorgente

中台-接口申请-增删改查导出

limeng 2 anni fa
parent
commit
14d8480fcd

+ 3 - 2
leiSP-admin/src/main/java/com/sooka/web/controller/common/CommonController.java

@@ -20,7 +20,7 @@ import com.sooka.common.utils.file.FileUtils;
 
 /**
  * 通用请求处理
- * 
+ *
  * @author lei_wang
  */
 @Controller
@@ -33,7 +33,7 @@ public class CommonController
 
     /**
      * 通用下载请求
-     * 
+     *
      * @param fileName 文件名称
      * @param delete 是否删除
      */
@@ -86,6 +86,7 @@ public class CommonController
         }
         catch (Exception e)
         {
+            e.printStackTrace();
             return AjaxResult.error(e.getMessage());
         }
     }

+ 16 - 11
leiSP-admin/src/main/resources/static/ajax/libs/bootstrap-fileinput/fileinput.js

@@ -49,14 +49,14 @@
         FRAMES: '.kv-preview-thumb',
         SORT_CSS: 'file-sortable',
         OBJECT_PARAMS: '<param name="controller" value="true" />\n' +
-        '<param name="allowFullScreen" value="true" />\n' +
-        '<param name="allowScriptAccess" value="always" />\n' +
-        '<param name="autoPlay" value="false" />\n' +
-        '<param name="autoStart" value="false" />\n' +
-        '<param name="quality" value="high" />\n',
+            '<param name="allowFullScreen" value="true" />\n' +
+            '<param name="allowScriptAccess" value="always" />\n' +
+            '<param name="autoPlay" value="false" />\n' +
+            '<param name="autoStart" value="false" />\n' +
+            '<param name="quality" value="high" />\n',
         DEFAULT_PREVIEW: '<div class="file-preview-other">\n' +
-        '<span class="{previewFileIconClass}">{previewFileIcon}</span>\n' +
-        '</div>',
+            '<span class="{previewFileIconClass}">{previewFileIcon}</span>\n' +
+            '</div>',
         MODAL_ID: 'kvFileinputModal',
         MODAL_EVENTS: ['show', 'shown', 'hide', 'hidden', 'loaded'],
         logMessages: {
@@ -65,7 +65,7 @@
             badExifParser: 'Error loading the piexif.js library. {details}',
             badInputType: 'The input "type" must be set to "file" for initializing the "bootstrap-fileinput" plugin.',
             exifWarning: 'To avoid this warning, either set "autoOrientImage" to "false" OR ensure you have loaded ' +
-            'the "piexif.js" library correctly on your page before the "fileinput.js" script.',
+                'the "piexif.js" library correctly on your page before the "fileinput.js" script.',
             invalidChunkSize: 'Invalid upload chunk size: "{chunkSize}". Resumable uploads are disabled.',
             invalidThumb: 'Invalid thumb frame with id: "{id}".',
             noResumableSupport: 'The browser does not support resumable or chunk uploads.',
@@ -1350,7 +1350,7 @@
         },
         _initTemplateDefaults: function () {
             var self = this, tMain1, tMain2, tPreview, tFileIcon, tClose, tCaption, tBtnDefault, tBtnLink, tBtnBrowse,
-                tModalMain, tModal, tProgress, tSize, tFooter, tActions, tActionDelete, tActionUpload, tActionDownload,
+                tModalMain, tModal, tProgress, tSize, tFooter, tActions, tActionDelete, tActionPrint, tActionUpload, tActionDownload,
                 tActionZoom, tActionDrag, tIndicator, tTagBef, tTagBef1, tTagBef2, tTagAft, tGeneric, tHtml, tImage,
                 tText, tOffice, tGdocs, tVideo, tAudio, tFlash, tObject, tPdf, tOther, tStyle, tZoomCache, vDefaultDim,
                 tStats;
@@ -1433,6 +1433,9 @@
                 '{drag}\n' +
                 '<div class="clearfix"></div>';
             //noinspection HtmlUnknownAttribute
+            //zeq
+            tActionPrint = '<button type="button" class="kv-file-remove {removeClass}" ' +
+                'title="{removeTitle}" {dataUrl}{dataKey}>{removeIcon}</button>\n';
             tActionDelete = '<button type="button" class="kv-file-remove {removeClass}" ' +
                 'title="{removeTitle}" {dataUrl}{dataKey}>{removeIcon}</button>\n';
             tActionUpload = '<button type="button" class="kv-file-upload {uploadClass}" title="{uploadTitle}">' +
@@ -1474,6 +1477,7 @@
             if (self._isPdfRendered()) {
                 tPdf = self.pdfRendererTemplate.replace('{renderer}', self._encodeURI(self.pdfRendererUrl));
             }
+            //zeq
             self.defaults = {
                 layoutTemplates: {
                     main1: tMain1,
@@ -1491,6 +1495,7 @@
                     indicator: tIndicator,
                     actions: tActions,
                     actionDelete: tActionDelete,
+                    actionPrint: tActionPrint,
                     actionUpload: tActionUpload,
                     actionDownload: tActionDownload,
                     actionZoom: tActionZoom,
@@ -5584,7 +5589,7 @@
             close: 'Close detailed preview'
         }
     };
-    
+
     $.fn.fileinputLocales.zh = {
         fileSingle: '文件',
         filePlural: '个文件',
@@ -5694,4 +5699,4 @@
             $input.fileinput();
         }
     });
-}));
+}));

+ 76 - 20
mybusiness/src/main/java/com/sooka/apply/controller/IntRecordController.java

@@ -1,9 +1,12 @@
 package com.sooka.apply.controller;
 
+import java.lang.reflect.Field;
+import java.util.ArrayList;
 import java.util.List;
-import java.util.stream.Collectors;
 
-import com.sooka.apply.domain.IntBo;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.sooka.apply.domain.IntDetailed;
 import com.sooka.common.annotation.Log;
 import com.sooka.common.core.controller.BaseController;
@@ -17,11 +20,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.ModelMap;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.*;
 import com.sooka.apply.domain.IntRecord;
 import com.sooka.apply.service.IIntRecordService;
 
@@ -55,6 +54,9 @@ public class IntRecordController extends BaseController
     @ResponseBody
     public TableDataInfo list(IntRecord intRecord)
     {
+        intRecord.setApplyUserId(ShiroUtils.getUserId());
+        //状态:0新建,政数局通过1,提供部门通过2,政数局待审批3,提供部门待审批4,政数局驳回5,提供部门驳回6
+        intRecord.setStatus("0");
         startPage();
         List<IntRecord> list = intRecordService.selectIntRecordList(intRecord);
         return getDataTable(list);
@@ -63,6 +65,7 @@ public class IntRecordController extends BaseController
     /**
      * 新增申请记录
      */
+    @RequiresPermissions("apply:record:add")
     @GetMapping("/add")
     public String add(ModelMap mmap)
     {
@@ -75,15 +78,80 @@ public class IntRecordController extends BaseController
     /**
      * 新增保存申请记录
      */
-    @RequiresPermissions("apply:record:add")
     @Log(title = "申请记录", businessType = BusinessType.INSERT)
     @PostMapping("/add")
     @ResponseBody
     public AjaxResult addSave(IntRecord intRecord)
     {
+        intRecord.setIntDetailedList(structureSubData(intRecord.getSubData()));
         return toAjax(intRecordService.insertIntRecord(intRecord));
     }
 
+    private List<IntDetailed> structureSubData(String subData){
+        JSONArray jsonArray = JSONArray.parseArray(subData);
+        List<IntDetailed> list = new ArrayList<>();
+        for(int i=0;i< jsonArray.size();i++){
+            JSONArray jsonArray1 = JSONArray.parseArray(jsonArray.get(i).toString());
+            IntDetailed intDetailed = new IntDetailed();
+            for(int j=0;j<jsonArray1.size();j++){
+                JSONObject jsonObject = JSONObject.parseObject(jsonArray1.get(j).toString());
+                String name = jsonObject.getString("name");
+                if(name.equals("intId")){
+                    intDetailed.setIntId(jsonObject.getString("value"));
+                }else if(name.equals("purpose")){
+                    intDetailed.setPurpose(jsonObject.getString("value"));
+                }else if(name.equals("file")){
+                    intDetailed.setFile(jsonObject.getString("value"));
+                }
+            }
+            list.add(intDetailed);
+        }
+        return list;
+    }
+
+    /**
+     * 附件单独用iframe
+     */
+    @GetMapping(value={"/uploadFrame","/uploadFrame/{subId}"})
+    public String uploadFrame(@PathVariable(value = "subId", required = false) String subId, ModelMap mmap)
+    {
+        if(subId != null){
+            IntDetailed intDetailed = intRecordService.selectIntRecordDetailedBySubId(subId);
+            mmap.put("file",intDetailed.getFile());
+        }
+        return prefix + "/uploadFrame";
+    }
+
+    /**
+     * 修改申请记录
+     */
+    @RequiresPermissions("apply:record:edit")
+    @GetMapping("/edit/{id}")
+    public String edit(@PathVariable("id") String id, ModelMap mmap)
+    {
+        IntRecord intRecord = intRecordService.selectIntRecordById(id);
+        JSONArray jsonArray = JSONArray.parseArray(JSON.toJSONString(intRecord.getIntDetailedList()));
+        mmap.put("intRecord", intRecord);
+        mmap.put("intDetailedList", jsonArray);
+        return prefix + "/edit";
+    }
+
+    /**
+     * 修改保存申请记录
+     */
+    @PostMapping("/edit")
+    @ResponseBody
+    public AjaxResult editSave(IntRecord intRecord)
+    {
+        intRecord.setIntDetailedList(structureSubData(intRecord.getSubData()));
+        return toAjax(intRecordService.editIntRecord(intRecord));
+    }
+
+
+
+
+
+
     /**
      * 查询申请记录列表
      */
@@ -111,18 +179,6 @@ public class IntRecordController extends BaseController
         return util.exportExcel(list, "record");
     }
 
-
-    /**
-     * 申请记录
-     */
-    @GetMapping("/edit/{id}")
-    public String edit(@PathVariable("id") String id, ModelMap mmap)
-    {
-        IntRecord intRecord = intRecordService.selectIntRecordById(id);
-        mmap.put("intRecord", intRecord);
-        return prefix + "/edit";
-    }
-
     /**
      * 删除申请记录
      */

+ 13 - 116
mybusiness/src/main/java/com/sooka/apply/domain/IntDetailed.java

@@ -1,146 +1,43 @@
 package com.sooka.apply.domain;
 
-import com.sooka.common.annotation.Excel;
 import com.sooka.common.core.domain.BaseEntity;
-import org.apache.commons.lang3.builder.ToStringBuilder;
-import org.apache.commons.lang3.builder.ToStringStyle;
+import lombok.Data;
 
 /**
  * 申请明细对象 int_detailed
- * 
+ *
  * @author yhliang
  * @date 2021-07-06
  */
+@Data
 public class IntDetailed extends BaseEntity
 {
     private static final long serialVersionUID = 1L;
 
-    /** $column.columnComment */
+    /** 主键 */
     private String id;
 
+    private String subId;
+
     /** 记录表id */
-    @Excel(name = "记录表id")
     private String recordId;
 
     /** 接口表id */
-    @Excel(name = "接口表id")
     private String intId;
 
-    /** 接口编码 */
-    @Excel(name = "接口编码")
-    private String intCode;
-
     /** 接口名称 */
-    @Excel(name = "接口名称")
-    private String intName;
+    private String interfaceName;
 
-    /** 开始时间 */
-    @Excel(name = "开始时间")
-    private String strAt;
-
-    /** 结束时间 */
-    @Excel(name = "结束时间")
-    private String endAt;
+    /** 接口地址 */
+    private String interfaceAddress;
 
     /** secret_key */
-    @Excel(name = "secret_key")
     private String secretKey;
 
-    /** 状态 */
-    @Excel(name = "状态")
-    private String status;
-
-    public void setId(String id)
-    {
-        this.id = id;
-    }
-
-    public String getId()
-    {
-        return id;
-    }
-    public void setRecordId(String recordId) 
-    {
-        this.recordId = recordId;
-    }
-
-    public String getRecordId() 
-    {
-        return recordId;
-    }
-    public void setIntId(String intId)
-    {
-        this.intId = intId;
-    }
-
-    public String getIntId()
-    {
-        return intId;
-    }
-    public void setStrAt(String strAt) 
-    {
-        this.strAt = strAt;
-    }
-
-    public String getStrAt() 
-    {
-        return strAt;
-    }
-    public void setEndAt(String endAt) 
-    {
-        this.endAt = endAt;
-    }
-
-    public String getEndAt() 
-    {
-        return endAt;
-    }
-
-    public void setSecretKey(String secretKey)
-    {
-        this.secretKey = secretKey;
-    }
-
-    public String getSecretKey() 
-    {
-        return secretKey;
-    }
-    public void setStatus(String status) 
-    {
-        this.status = status;
-    }
-
-    public String getStatus() 
-    {
-        return status;
-    }
-
-    public String getIntCode() {
-        return intCode;
-    }
-
-    public void setIntCode(String intCode) {
-        this.intCode = intCode;
-    }
-
-    public String getIntName() {
-        return intName;
-    }
+    /** 用途 */
+    private String purpose;
 
-    public void setIntName(String intName) {
-        this.intName = intName;
-    }
+    /** 附件 */
+    private String file;
 
-    @Override
-    public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("id", getId())
-            .append("recordId", getRecordId())
-            .append("intId", getIntId())
-            .append("strAt", getStrAt())
-            .append("endAt", getEndAt())
-            .append("secretKey", getSecretKey())
-            .append("status", getStatus())
-            .toString();
-    }
 }

+ 10 - 7
mybusiness/src/main/java/com/sooka/apply/domain/IntRecord.java

@@ -1,13 +1,10 @@
 package com.sooka.apply.domain;
 
 import java.util.List;
-import java.util.Date;
-
+import com.alibaba.fastjson.JSONArray;
 import com.sooka.common.annotation.Excel;
 import com.sooka.common.core.domain.BaseEntity;
 import lombok.Data;
-import org.apache.commons.lang3.builder.ToStringBuilder;
-import org.apache.commons.lang3.builder.ToStringStyle;
 
 /**
  * 申请记录对象 int_record
@@ -53,7 +50,7 @@ public class IntRecord extends BaseEntity
     private String provideDeptName;
 
     /** 申请时间 */
-    @Excel(name = "申请时间", width = 30, dateFormat = "yyyy-MM-dd")
+    @Excel(name = "申请时间", width = 30)
     private String applyTime;
 
     /** 调用频率 */
@@ -61,17 +58,23 @@ public class IntRecord extends BaseEntity
     private String frequency;
 
     /** 使用时效开始时间 */
-    @Excel(name = "使用时效开始时间", width = 30, dateFormat = "yyyy-MM-dd")
+    @Excel(name = "使用时效开始时间", width = 30)
     private String startTime;
 
     /** 使用时效结束时间 */
-    @Excel(name = "使用时效结束时间", width = 30, dateFormat = "yyyy-MM-dd")
+    @Excel(name = "使用时效结束时间", width = 30)
     private String endTime;
 
     /** 起止时间 */
     private String duration;
 
+    /** 状态 */
+    private String status;
+
     /** 申请明细信息 */
     private List<IntDetailed> intDetailedList;
 
+    /** 用于接收前台JSONArray **/
+    private String subData;
+
 }

+ 23 - 7
mybusiness/src/main/java/com/sooka/apply/mapper/IntRecordMapper.java

@@ -6,23 +6,31 @@ import com.sooka.apply.domain.IntDetailed;
 
 /**
  * 申请记录Mapper接口
- * 
+ *
  * @author yhliang
  * @date 2021-07-06
  */
-public interface IntRecordMapper 
+public interface IntRecordMapper
 {
     /**
      * 查询申请记录
-     * 
+     *
      * @param id 申请记录ID
      * @return 申请记录
      */
     public IntRecord selectIntRecordById(String id);
 
     /**
+     * 查询申请子表记录
+     *
+     * @param subId 申请子表记录ID
+     * @return 申请记录
+     */
+    public IntDetailed selectIntRecordDetailedBySubId(String subId);
+
+    /**
      * 查询申请记录列表
-     * 
+     *
      * @param intRecord 申请记录
      * @return 申请记录集合
      */
@@ -39,13 +47,21 @@ public interface IntRecordMapper
 
     /**
      * 新增申请记录
-     * 
+     *
      * @param intRecord 申请记录
      * @return 结果
      */
     public int insertIntRecord(IntRecord intRecord);
 
     /**
+     * 修改申请记录
+     *
+     * @param intBo 申请记录
+     * @return 结果
+     */
+    public int editIntRecord(IntRecord intBo);
+
+    /**
      * 批量删除申请记录
      *
      * @param ids 需要删除的数据ID
@@ -60,10 +76,10 @@ public interface IntRecordMapper
      * @return 结果
      */
     public int deleteIntDetailedByRecordIds(String[] ids);
-    
+
     /**
      * 批量新增申请明细
-     * 
+     *
      * @param intDetailedList 申请明细列表
      * @return 结果
      */

+ 16 - 0
mybusiness/src/main/java/com/sooka/apply/service/IIntRecordService.java

@@ -23,6 +23,14 @@ public interface IIntRecordService
     public IntRecord selectIntRecordById(String id);
 
     /**
+     * 查询申请子表记录
+     *
+     * @param subId 申请子表记录ID
+     * @return 申请记录
+     */
+    public IntDetailed selectIntRecordDetailedBySubId(String subId);
+
+    /**
      * 查询申请记录列表
      *
      * @param intRecord 申请记录
@@ -47,6 +55,14 @@ public interface IIntRecordService
     public int insertIntRecord(IntRecord intBo);
 
     /**
+     * 修改申请记录
+     *
+     * @param intBo 申请记录
+     * @return 结果
+     */
+    public int editIntRecord(IntRecord intBo);
+
+    /**
      * 批量删除申请记录
      *
      * @param ids 需要删除的数据ID

+ 59 - 31
mybusiness/src/main/java/com/sooka/apply/service/impl/IntRecordServiceImpl.java

@@ -45,6 +45,17 @@ public class IntRecordServiceImpl implements IIntRecordService
     }
 
     /**
+     * 查询申请子表记录
+     *
+     * @param subId 申请子表记录ID
+     * @return 申请记录
+     */
+    @Override
+    public IntDetailed selectIntRecordDetailedBySubId(String subId){
+        return intRecordMapper.selectIntRecordDetailedBySubId(subId);
+    }
+
+    /**
      * 查询申请记录列表
      *
      * @param intRecord 申请记录
@@ -77,6 +88,33 @@ public class IntRecordServiceImpl implements IIntRecordService
     @Override
     public int insertIntRecord(IntRecord intRecord)
     {
+        /**添加主表**/
+        SysUser sysUser = ShiroUtils.getSysUser();
+        intRecord.setApplyDeptId(sysUser.getDept().getDeptId());
+        intRecord.setApplyDeptName(sysUser.getDept().getDeptName());
+        intRecord.setApplyUserId(sysUser.getUserId());
+        intRecord.setApplyUserName(sysUser.getUserName());
+        intRecord.setApplyTime(DateUtils.dateTimeNow(DateUtils.YYYY_MM_DD));
+        intRecord.setStartTime(intRecord.getDuration().split(" - ")[0]);
+        intRecord.setEndTime(intRecord.getDuration().split(" - ")[1]);
+        //状态:0新建,政数局通过1,提供部门通过2,政数局待审批3,提供部门待审批4,政数局驳回5,提供部门驳回6
+        intRecord.setStatus("0");
+        /**添加后返回主表ID**/
+        intRecordMapper.insertIntRecord(intRecord);
+        /**添加子表**/
+        return insertIntDetailed(intRecord.getId(),intRecord.getIntDetailedList());
+    }
+
+    /**
+     * 修改申请记录
+     *
+     * @param intRecord 申请记录
+     * @return 结果
+     */
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public int editIntRecord(IntRecord intRecord){
+        /**添加主表**/
         SysUser sysUser = ShiroUtils.getSysUser();
         intRecord.setApplyDeptId(sysUser.getDept().getDeptId());
         intRecord.setApplyDeptName(sysUser.getDept().getDeptName());
@@ -85,7 +123,14 @@ public class IntRecordServiceImpl implements IIntRecordService
         intRecord.setApplyTime(DateUtils.dateTimeNow(DateUtils.YYYY_MM_DD));
         intRecord.setStartTime(intRecord.getDuration().split(" - ")[0]);
         intRecord.setEndTime(intRecord.getDuration().split(" - ")[1]);
-        return intRecordMapper.insertIntRecord(intRecord);
+        //状态:0新建,政数局通过1,提供部门通过2,政数局待审批3,提供部门待审批4,政数局驳回5,提供部门驳回6
+        intRecord.setStatus("0");
+        /**修改主表**/
+        intRecordMapper.editIntRecord(intRecord);
+        /**删除子表**/
+        intRecordMapper.deleteIntDetailedByRecordIds(Convert.toStrArray(intRecord.getId()));
+        /**添加子表**/
+        return insertIntDetailed(intRecord.getId(),intRecord.getIntDetailedList());
     }
 
     /**
@@ -94,7 +139,7 @@ public class IntRecordServiceImpl implements IIntRecordService
      * @param ids 需要删除的数据ID
      * @return 结果
      */
-    @Transactional
+    @Transactional(rollbackFor = Exception.class)
     @Override
     public int deleteIntRecordByIds(String ids)
     {
@@ -117,40 +162,23 @@ public class IntRecordServiceImpl implements IIntRecordService
     /**
      * 新增申请明细信息
      *
-     * @param intBo 申请记录对象
+     * @param list 申请记录对象
      */
-    private void insertIntDetailed(IntBo intBo) throws Exception {
-
-        String[] intIds = intBo.getIntIds().split(",");
-        String[] intCodes = intBo.getIntCodes().split(",");
-
-        if (intIds.length != intCodes.length) {
-            throw new Exception("接口信息不全,无法完成申请");
-        }
-
-        String id = intBo.getId();
-        String str_at = intBo.getDatetime().split(" - ")[0];
-        String end_at = intBo.getDatetime().split(" - ")[1];
-
-        List<IntDetailed> list = new ArrayList<IntDetailed>();
-
-        for (int i = 0; i < intIds.length; i++) {
-            String intId = intIds[i];
-            String intCode = intCodes[i];
+    private int insertIntDetailed(String id, List<IntDetailed> list){
+        System.out.println(id);
+        List<IntDetailed> list_ = new ArrayList<IntDetailed>();
+        for (int i = 0; i < list.size(); i++) {
             IntDetailed intDetailed = new IntDetailed();
-            intDetailed.setId(IdUtils.fastSimpleUUID());
-            intDetailed.setIntId(intId);
-            intDetailed.setIntCode(intCode);
             intDetailed.setRecordId(id);
-            intDetailed.setStrAt(str_at);
-            intDetailed.setEndAt(end_at);
+            intDetailed.setIntId(list.get(i).getIntId());
             intDetailed.setSecretKey(IdUtils.fastSimpleUUID());
-            intDetailed.setStatus("1");
-            list.add(intDetailed);
+            intDetailed.setPurpose(list.get(i).getPurpose());
+            intDetailed.setFile(list.get(i).getFile());
+            list_.add(intDetailed);
         }
-
-        if (list.size() > 0) {
-            intRecordMapper.batchIntDetailed(list);
+        if (list_.size() > 0) {
+            return intRecordMapper.batchIntDetailed(list_);
         }
+        return 0;
     }
 }

+ 7 - 6
mybusiness/src/main/java/com/sooka/system/controller/TUInterfaceinfoController.java

@@ -76,6 +76,8 @@ public class TUInterfaceinfoController extends BaseController {
     {
         TUInterfaceinfo tuInterfaceinfo = new TUInterfaceinfo();
         tuInterfaceinfo.setDeptId(deptId);
+        //只查询可用的接口
+        tuInterfaceinfo.setStatus("0");
         startPage();
         List<TUInterfaceinfo> list = tUInterfaceinfoService.selectTUInterfaceinfoList(tuInterfaceinfo);
         mmap.put("list", list.stream().collect(Collectors.toList()));
@@ -85,13 +87,12 @@ public class TUInterfaceinfoController extends BaseController {
     /**
      * 根据部门ID获取接口
      */
-    @RequestMapping("/selectInterfaceByIds/{ids}")
-    public String selectInterfaceByDeptId(@PathVariable("ids") String[] ids, ModelMap mmap)
+    @RequestMapping("/selectInterfaceByIds")
+    @ResponseBody
+    public List<TUInterfaceinfo> selectInterfaceByDeptId(String[] ids)
     {
-        if(ids.length > 0){
-            mmap.put("list", tUInterfaceinfoService.selectTUInterfaceinfoList(ids));
-        }
-        return prefix + "/interfaceFrame";
+        List<TUInterfaceinfo> list = tUInterfaceinfoService.selectTUInterfaceinfoList(ids);
+        return list;
     }
 
 

+ 88 - 44
mybusiness/src/main/resources/mapper/apply/IntRecordMapper.xml

@@ -19,6 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="duration"    column="duration"    />
         <result property="startTime"    column="start_time"    />
         <result property="endTime"    column="end_time"    />
+        <result property="status"    column="status"    />
     </resultMap>
 
     <resultMap id="IntRecordIntDetailedResult" type="IntRecord" extends="IntRecordResult">
@@ -26,16 +27,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <resultMap type="IntDetailed" id="IntDetailedResult">
-        <result property="id"    column="id"    />
+        <result property="subId"    column="sub_id"    />
         <result property="recordId"    column="record_id"    />
         <result property="intId"    column="int_id"    />
-        <result property="intCode"    column="int_code"    />
-        <result property="intName"    column="interface_name"    />
-        <result property="strAt"    column="str_at"    />
-        <result property="endAt"    column="end_at"    />
-        <result property="endAt"    column="end_at"    />
         <result property="secretKey"    column="secret_key"    />
-        <result property="status"    column="status"    />
+        <result property="purpose"    column="purpose"    />
+        <result property="file"    column="file"    />
+        <result property="interfaceName"    column="interface_name"    />
+        <result property="interfaceAddress"    column="interface_address"    />
     </resultMap>
 
     <sql id="selectIntRecordVo">
@@ -58,50 +57,57 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             int_record
     </sql>
 
-    <sql id="selectIntDetailedVo">
-        SELECT
-            b.id,
-            b.record_id,
-            b.int_id,
-            i.interface_name,
-            b.int_code,
-            b.str_at,
-            b.end_at,
-            b.secret_key,
-            b.STATUS
-        FROM
-            int_detailed b,
-            t_u_interfaceinfo i
-        WHERE
-            b.int_id = i.id
-    </sql>
-
     <select id="selectIntRecordList" parameterType="IntRecord" resultMap="IntRecordResult">
         <include refid="selectIntRecordVo"/>
         <where>
             <if test="provideDeptId != null and provideDeptId != ''"> and provide_dept_id = #{provideDeptId}</if>
             <if test="provideDeptName != null and provideDeptName != ''"> and provide_dept_name like concat('%', #{provideDeptName}, '%')</if>
+            <if test="applyUserId != null and applyUserId != ''"> and apply_user_id = #{applyUserId}</if>
+            <if test="status != null and status != ''"> and status = #{status}</if>
         </where>
         ORDER BY
         end_time ASC,
         apply_time DESC
     </select>
 
-    <select id="selectIntDetailedList" parameterType="IntDetailed" resultMap="IntDetailedResult">
-        <include refid="selectIntDetailedVo"/>
-        <if test="recordId != null "> and b.record_id = #{recordId}</if>
-        order by b.int_code
-    </select>
-
     <select id="selectIntRecordById" parameterType="String" resultMap="IntRecordIntDetailedResult">
-        select a.id, a.apply_oid, a.org_id, a.apply_time, a.int_numbers,
-            b.id, b.record_id, b.int_id, b.str_at, b.end_at, b.secret_key, b.status
-        from int_record a
-        left join int_detailed b on b.record_id = a.id
-        where a.id = #{id}
+        SELECT
+            a.id,
+            a.apply_dept_id,
+            a.apply_dept_name,
+            a.apply_user_id,
+            a.apply_user_name,
+            a.tel,
+            a.ip,
+            a.provide_dept_id,
+            a.provide_dept_name,
+            a.apply_time,
+            a.frequency,
+            CONCAT(
+                a.start_time,
+                ' - ',
+                a.end_time
+            ) duration,
+            a.start_time,
+            a.end_time,
+            a.status,
+            b.id sub_id,
+            b.record_id,
+            b.int_id,
+            b.secret_key,
+            b.purpose,
+            b.file,
+            c.interface_name,
+	        c.interface_address
+        FROM
+            int_record a
+        LEFT JOIN int_detailed b ON b.record_id = a.id
+        LEFT JOIN t_u_interfaceinfo c on b.int_id = c.id
+        WHERE a.id = #{id}
     </select>
 
-    <insert id="insertIntRecord" parameterType="IntRecord">
+    <!--新增主表,返回主键-->
+    <insert id="insertIntRecord" parameterType="IntRecord" useGeneratedKeys="true" keyProperty="id">
         insert into int_record
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="applyDeptId != null">apply_dept_id,</if>
@@ -116,6 +122,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="frequency != null">frequency,</if>
             <if test="startTime != null">start_time,</if>
             <if test="endTime != null">end_time,</if>
+            <if test="status != null">status,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="applyDeptId != null">#{applyDeptId},</if>
@@ -130,13 +137,55 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="frequency != null">#{frequency},</if>
             <if test="startTime != null">#{startTime},</if>
             <if test="endTime != null">#{endTime},</if>
+            <if test="status != null">#{status},</if>
          </trim>
     </insert>
 
-    <update id="aa" parameterType="IntDetailed">
+    <select id="selectIntRecordDetailedBySubId" parameterType="String" resultMap="IntDetailedResult">
+        SELECT
+            id,
+            record_id,
+            int_id,
+            secret_key,
+            purpose,
+            file
+        FROM
+            int_detailed
+        WHERE
+            id = #{subId}
+    </select>
 
+    <!--批量新增子表-->
+    <insert id="batchIntDetailed">
+        insert into int_detailed(record_id, int_id, secret_key, purpose, file) values
+        <foreach item="item" index="index" collection="list" separator=",">
+            ( #{item.recordId}, #{item.intId} ,#{item.secretKey}, #{item.purpose}, #{item.file})
+        </foreach>
+    </insert>
+
+    <update id="editIntRecord" parameterType="IntRecord">
+        UPDATE int_record
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="applyDeptId != null">apply_dept_id = #{applyDeptId},</if>
+            <if test="applyDeptName != null">apply_dept_name = #{applyDeptName},</if>
+            <if test="applyUserId != null">apply_user_id = #{applyUserId},</if>
+            <if test="applyUserName != null">apply_user_name = #{applyUserName},</if>
+            <if test="tel != null">tel = #{tel},</if>
+            <if test="ip != null">ip = #{ip},</if>
+            <if test="provideDeptId != null">provide_dept_id = #{provideDeptId},</if>
+            <if test="provideDeptName != null">provide_dept_name = #{provideDeptName},</if>
+            <if test="applyTime != null">apply_time = #{applyTime},</if>
+            <if test="frequency != null">frequency = #{frequency},</if>
+            <if test="startTime != null">start_time = #{startTime},</if>
+            <if test="endTime != null">end_time = #{endTime},</if>
+            <if test="status != null">status = #{status},</if>
+        </trim>
+        WHERE id = #{id}
     </update>
 
+
+
+
     <update id="changeStatus" parameterType="IntDetailed">
         update int_detailed
         <set>
@@ -159,11 +208,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </foreach>
     </delete>
 
-    <insert id="batchIntDetailed">
-        insert into int_detailed( id, record_id, int_id, int_code, str_at, end_at, secret_key, status) values
-		<foreach item="item" index="index" collection="list" separator=",">
-            ( #{item.id}, #{item.recordId}, #{item.intId} ,#{item.intCode}, #{item.strAt}, #{item.endAt}, #{item.secretKey}, #{item.status})
-        </foreach>
-    </insert>
+
 
 </mapper>

+ 80 - 9
mybusiness/src/main/resources/templates/apply/record/add.html

@@ -80,7 +80,6 @@
                 </div>
                 <div class="ibox-content">
                     <div class="panel-group" id="accordion">
-                        <iframe id="interface_frame" src="/system/interfaceinfo/selectInterfaceByIds/1" width="100%" height="100%" frameborder="0" seamless></iframe>
                     </div>
                 </div>
             </div>
@@ -91,7 +90,7 @@
 <div class="row">
     <div class="col-sm-offset-5 col-sm-10">
         <button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>&nbsp;
-        <button type="button" class="btn btn-sm btn-danger" onclick=""><i class="fa fa-reply-all"></i>关 闭 </button>
+        <button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
     </div>
 </div>
 </body>
@@ -109,6 +108,7 @@
     let datas = [[${@dict.getType('share_type')}]];
     let apply_prefix = ctx + "apply/record"
     let deptName = "提供部门";
+    let num = 0;
 
     $(function() {
         /** 范围选择日期框 **/
@@ -121,11 +121,13 @@
         });
     });
 
-    /**表单提交方法**/
-    function submitHandler() {
-        if ($.validate.form()) {
-            let data = $("#form-record-add").serializeArray();
-            $.operate.saveTab(apply_prefix + "/add", data);
+    /**手风琴右侧上下箭头样式变换控制**/
+    function openOrClose(dom) {
+        let name = $(dom).attr("href").substr(1);
+        if($("span[name="+name+"]").hasClass("on")){
+            $("span[name="+name+"]").removeClass("on");
+        }else{
+            $("span[name="+name+"]").eq(0).addClass("on");
         }
     }
 
@@ -149,10 +151,59 @@
 
     /**根据数据渲染接口手风琴**/
     function renderInterfaceHtml(ids) {
-        $("#interface_frame").attr("src","/system/interfaceinfo/selectInterfaceByIds/"+ids);
+        $.post(prefix + "/interfaceinfo/selectInterfaceByIds",{
+            ids:ids
+        },function(res){
+            let html =
+                '<div class="panel panel-default">' +
+                '	<div class="panel-heading">' +
+                '		<h5 class="panel-title">' +
+                '			<a data-toggle="collapse" data-parent="#accordion" href="##id#" onclick="openOrClose(this)">#interfaceName#</a>' +
+                '			<span class="panel_sj on" name="#id#"></span>' +
+                '		</h5>' +
+                '	</div>' +
+                '	<div id="#id#" class="panel-collapse collapse">' +
+                '		<div class="panel-body">' +
+                '			<form class="form-horizontal" id="#formId#">' +
+                '           <input type="hidden" name="intId" value="#id#">' +
+                '				<div class="form-group">' +
+                '					<label class="col-sm-2 control-label">接口地址</label>' +
+                '					<div class="col-sm-10">' +
+                '						<input type="text" class="form-control" disabled value="#interfaceAddress#">' +
+                '					</div>' +
+                '				</div>' +
+                '				<div class="form-group">' +
+                '					<label class="col-sm-2 control-label">接口用途</label>' +
+                '					<div class="col-sm-10">' +
+                '						<input type="text" class="form-control" name="purpose">' +
+                '					</div>' +
+                '				</div>' +
+                '				<div class="form-group">' +
+                '                   <label class="col-sm-2 control-label">附件</label>' +
+                '                   <div class="col-sm-10">' +
+                '					    <iframe id="#file_upload#" src="/apply/record/uploadFrame" width="100%" height="412px" frameborder="0" seamless></iframe>' +
+                '				    </div>' +
+                '				</div>' +
+                '			</form>' +
+                '		</div>' +
+                '	</div>' +
+                '</div>';
+            if(res.length > 0){
+                $("#accordion").html("");
+                num = 0;
+                for(let i=0;i<res.length;i++){
+                    let docm = html.replace(/#interfaceName#/g,res[i].interfaceName);
+                    docm = docm.replace(/#interfaceAddress#/g,res[i].interfaceAddress);
+                    docm = docm.replace(/#id#/g,res[i].id);
+                    docm = docm.replace(/#formId#/g,"sub-form"+num);
+                    docm = docm.replace(/#file_upload#/g,"file_upload"+num);
+                    $("#accordion").append(docm);
+                    num += 1;
+                }
+            }
+        });
     }
 
-
     /**选择部门树**/
     function selectDeptTree() {
         var treeId = $("#treeId").val();
@@ -185,6 +236,26 @@
     let dom = $('#luStep');
     dom.stepInit(data);
 
+
+    /**表单提交方法**/
+    function submitHandler() {
+        let subData = [];
+        let formData = $("#form-record-add").serializeArray();
+        for (let i = 0; i < num; i++) {
+            let data = $("#sub-form"+i).serializeArray();
+            let elem = {};
+            elem.name = "file";
+            elem.value = $("#file_upload"+i).contents().find("input[name='_file']").val();
+            data.push(elem);
+            subData.push(data);
+        }
+        if ($.validate.form()) {
+            let sub = {"name":"subData","value":JSON.stringify(subData)};
+            formData.push(sub);
+            $.operate.saveTab(apply_prefix + "/add", formData);
+        }
+    }
+
 </script>
 </body>
 </html>

+ 294 - 83
mybusiness/src/main/resources/templates/apply/record/edit.html

@@ -1,105 +1,316 @@
 <!DOCTYPE html>
-<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
 <head>
-    <th:block th:include="include :: header('申请记录')" />
+    <th:block th:include="include :: header('用户列表')" />
+    <th:block th:include="include :: layout-latest-css" />
+    <th:block th:include="include :: ztree-css" />
     <th:block th:include="include :: datetimepicker-css" />
+    <th:block th:include="include :: lustep-css" />
+    <th:block th:include="include :: select2-css" />
+    <th:block th:include="include :: bootstrap-fileinput-css" />
 </head>
-<body class="white-bg">
-    <div class="container-div">
-        <div class="row">
-            <div class="col-sm-12 search-collapse">
-                <form id="record_form">
-                    <input type="hidden" id="recordId" name="recordId" th:value="${intRecord.id}">
-                </form>
+<body class="gray-bg">
+<div class="wrapper wrapper-content animated fadeInRight">
+    <div class="row">
+        <div class="col-sm-12">
+            <!--步骤条start-->
+            <div class="ibox">
+                <div class="ibox-title">
+                    <div id="test" style="height: 40px; padding: 36px 0px;">
+                        <div id="luStep"></div>
+                    </div>
+                </div>
             </div>
-            <div class="col-sm-12">
-                <div class="col-sm-12 select-table table-striped">
-                    <table id="bootstrap-table"></table>
+            <!--步骤条end-->
+            <!--主表字段start-->
+            <div class="ibox">
+                <div class="ibox-content">
+                    <form method="get" class="form-horizontal" id="form-record-edit">
+                        <input type="hidden" name="id" th:value="${intRecord.id}">
+                        <div class="form-group">
+                            <label class="col-sm-2 control-label is-required">申请部门名称</label>
+                            <div class="col-sm-4">
+                                <input type="text" disabled class="form-control" th:value="${intRecord.applyDeptName}">
+                            </div>
+                            <label class="col-sm-2 control-label is-required">申请人</label>
+                            <div class="col-sm-4">
+                                <input type="text" disabled class="form-control" th:value="${intRecord.applyUserName}">
+                            </div>
+                        </div>
+                        <div class="form-group">
+                            <label class="col-sm-2 control-label is-required">联系方式</label>
+                            <div class="col-sm-4">
+                                <input type="text" name="tel" class="form-control" maxlength="11" th:value="${intRecord.tel}" required>
+                            </div>
+                            <label class="col-sm-2 control-label is-required">调用者IP</label>
+                            <div class="col-sm-4">
+                                <input type="input" name="ip" class="form-control" maxlength="15" th:value="${intRecord.ip}" required>
+                            </div>
+                        </div>
+                        <div class="form-group">
+                            <label class="col-sm-2 control-label is-required">接口提供部门</label>
+                            <div class="col-sm-10">
+                                <div class="input-group">
+                                    <input name="provideDeptName" th:value="${intRecord.provideDeptName}" onclick="selectDeptTree()" id="treeName" type="text" placeholder="请选择归属部门" class="form-control" required>
+                                    <input name="provideDeptId" th:value="${intRecord.provideDeptId}" type="hidden" id="treeId"/>
+                                    <span class="input-group-addon"><i class="fa fa-search"></i></span>
+                                </div>
+                            </div>
+                        </div>
+                        <div class="form-group">
+                            <label class="col-sm-2 control-label is-required">每天调用频率</label>
+                            <div class="col-sm-4">
+                                <input type="input" class="form-control" name="frequency" maxlength="10" th:value="${intRecord.frequency}" required>
+                            </div>
+                            <label class="col-sm-2 control-label is-required">使用时效</label>
+                            <div class="col-sm-4">
+                                <div class="input-group date">
+                                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
+                                    <input type="text" class="form-control" id="duration" name="duration" placeholder="从 - 至" th:value="${intRecord.duration}" required>
+                                </div>
+                            </div>
+                        </div>
+                    </form>
                 </div>
             </div>
+            <!--主表字段end-->
+            <!--子表字段start-->
+            <div class="ibox">
+                <div class="ibox-title">
+                    <button type="button" class="btn btn-w-m btn-success" onclick="selectInterface()">获取部门接口</button>
+                </div>
+                <div class="ibox-content">
+                    <div class="panel-group" id="accordion">
+                    </div>
+                </div>
+            </div>
+            <!--子表字段end-->
         </div>
     </div>
-    <th:block th:include="include :: footer" />
-    <script th:inline="javascript">
+</div>
+<div class="row">
+    <div class="col-sm-offset-5 col-sm-10">
+        <button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>&nbsp;
+        <button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
+    </div>
+</div>
+</body>
+
+<th:block th:include="include :: footer" />
+<th:block th:include="include :: layout-latest-js" />
+<th:block th:include="include :: ztree-js" />
+<th:block th:include="include :: datetimepicker-js" />
+<th:block th:include="include :: lustep-js" />
+<th:block th:include="include :: select2-js" />
+<th:block th:include="include :: bootstrap-fileinput-js" />
+<script th:inline="javascript">
 
-        var editFlag = [[${@permission.hasPermi('apply:record:edit')}]];
-        var prefix = ctx + "apply/record";
+    let prefix = ctx + "system";
+    let datas = [[${@dict.getType('share_type')}]];
+    let apply_prefix = ctx + "apply/record"
+    let deptName = "提供部门";
+    let num = 0;
+    let interfaces = [[${intDetailedList}]];
 
-        function submitHandler() {
+    $(function() {
+        /** 范围选择日期框 **/
+        layui.use('laydate', function(){
+            let laydate = layui.laydate;
+            laydate.render({
+                elem: '#duration',
+                range: true
+            });
+        });
+        /** 回显接口 **/
+        renderInterface(interfaces);
+        console.log(interfaces);
+    });
 
+    /** 回显接口 **/
+    function renderInterface(data){
+        let html =
+            '<div class="panel panel-default">' +
+            '	<div class="panel-heading">' +
+            '		<h5 class="panel-title">' +
+            '			<a data-toggle="collapse" data-parent="#accordion" href="##id#" onclick="openOrClose(this)">#interfaceName#</a>' +
+            '			<span class="panel_sj on" name="#id#"></span>' +
+            '		</h5>' +
+            '	</div>' +
+            '	<div id="#id#" class="panel-collapse collapse">' +
+            '		<div class="panel-body">' +
+            '			<form class="form-horizontal" id="#formId#">' +
+            '           <input type="hidden" name="intId" value="#id#">' +
+            '				<div class="form-group">' +
+            '					<label class="col-sm-2 control-label">接口地址</label>' +
+            '					<div class="col-sm-10">' +
+            '						<input type="text" class="form-control" disabled value="#interfaceAddress#">' +
+            '					</div>' +
+            '				</div>' +
+            '				<div class="form-group">' +
+            '					<label class="col-sm-2 control-label">接口用途</label>' +
+            '					<div class="col-sm-10">' +
+            '						<input type="text" class="form-control" name="purpose" value="#purpose#">' +
+            '					</div>' +
+            '				</div>' +
+            '				<div class="form-group">' +
+            '                   <label class="col-sm-2 control-label">附件</label>' +
+            '                   <div class="col-sm-10">' +
+            '					    <iframe id="#file_upload#" src="/apply/record/uploadFrame/#subId#" width="100%" height="412px" frameborder="0" seamless></iframe>' +
+            '				    </div>' +
+            '				</div>' +
+            '			</form>' +
+            '		</div>' +
+            '	</div>' +
+            '</div>';
+        for(let i=0;i<data.length;i++){
+            let docm = html.replace(/#interfaceName#/g,data[i].interfaceName);
+            docm = docm.replace(/#interfaceAddress#/g,data[i].interfaceAddress);
+            docm = docm.replace(/#purpose#/g,data[i].purpose);
+            docm = docm.replace(/#id#/g,data[i].intId);
+            docm = docm.replace(/#subId#/g,data[i].subId);
+            docm = docm.replace(/#formId#/g,"sub-form"+num);
+            docm = docm.replace(/#file_upload#/g,"file_upload"+num);
+            $("#accordion").append(docm);
+            num += 1;
         }
+    }
 
-        $(function() {
-            var options = {
-                url: prefix + "/intDetailedList",
-                pagination: false,
-                showSearch: false,
-                showRefresh: false,
-                showToggle: false,
-                showColumns: false,
-                columns: [{
-                    field: 'index',
-                    align: 'center',
-                    title: "序号",
-                    formatter: function (value, row, index) {
-                    	var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index));
-                    	return columnIndex + $.table.serialNumber(index);
-                    }
-                },{
-                    field: 'intName',
-                    align: 'center',
-                    title: '接口名称'
-                },{
-                    field: 'intCode',
-                    align: 'center',
-                    title: '接口编码'
-                },{
-                    field: 'strAt',
-                    align: 'center',
-                    title: '开始时间'
-				},{
-                    field: 'endAt',
-                    align: 'center',
-                    title: '结束时间'
-				},{
-                    field: 'secretKey',
-                    align: 'center',
-                    title: 'secret_key'
-				},{
-                    visible: editFlag !== 'hidden',
-                    title: '状态',
-                    align: 'center',
-                    formatter: function (value, row, index) {
-                        return statusTools(row);
-                    }
-                }]
-            };
-            $.table.init(options);
-        });
+    /**手风琴右侧上下箭头样式变换控制**/
+    function openOrClose(dom) {
+        let name = $(dom).attr("href").substr(1);
+        if($("span[name="+name+"]").hasClass("on")){
+            $("span[name="+name+"]").removeClass("on");
+        }else{
+            $("span[name="+name+"]").eq(0).addClass("on");
+        }
+    }
 
-        /* 状态显示 */
-        function statusTools(row) {
-            if (row.status === '0') {
-                return '<i class=\"fa fa-toggle-off text-info fa-2x\" onclick="enable(\'' + row.id + '\')"></i> ';
-            } else {
-                return '<i class=\"fa fa-toggle-on text-info fa-2x\" onclick="disable(\'' + row.id + '\')"></i> ';
-            }
+    /**获取部门接口弹窗**/
+    function selectInterface() {
+        let deptId = $("#treeId").val();
+        if(deptId == "" || deptId == null){
+            $.modal.alertError('请先选择接口提供部门');
+        }else{
+            let url = prefix + '/interfaceinfo/selectInterfaceByDeptId/' + deptId;
+            $.modal.open("请选择接口", url,1050,380,interfaceCallback);
         }
+    }
+
+    /**取得子页面选择的接口ids**/
+    function interfaceCallback(index, layero) {
+        let rows = layero.find("iframe")[0].contentWindow.$.table.selectFirstColumns();
+        renderInterfaceHtml(rows.join());
+        layer.close(index);
+    }
+
+    /**根据数据渲染接口手风琴**/
+    function renderInterfaceHtml(ids) {
+        $.post(prefix + "/interfaceinfo/selectInterfaceByIds",{
+            ids:ids
+        },function(res){
+            if(res.length > 0){
+                let html =
+                    '<div class="panel panel-default">' +
+                    '	<div class="panel-heading">' +
+                    '		<h5 class="panel-title">' +
+                    '			<a data-toggle="collapse" data-parent="#accordion" href="##id#" onclick="openOrClose(this)">#interfaceName#</a>' +
+                    '			<span class="panel_sj on" name="#id#"></span>' +
+                    '		</h5>' +
+                    '	</div>' +
+                    '	<div id="#id#" class="panel-collapse collapse">' +
+                    '		<div class="panel-body">' +
+                    '			<form class="form-horizontal" id="#formId#">' +
+                    '           <input type="hidden" name="intId" value="#id#">' +
+                    '				<div class="form-group">' +
+                    '					<label class="col-sm-2 control-label">接口地址</label>' +
+                    '					<div class="col-sm-10">' +
+                    '						<input type="text" class="form-control" disabled value="#interfaceAddress#">' +
+                    '					</div>' +
+                    '				</div>' +
+                    '				<div class="form-group">' +
+                    '					<label class="col-sm-2 control-label">接口用途</label>' +
+                    '					<div class="col-sm-10">' +
+                    '						<input type="text" class="form-control" name="purpose">' +
+                    '					</div>' +
+                    '				</div>' +
+                    '				<div class="form-group">' +
+                    '                   <label class="col-sm-2 control-label">附件</label>' +
+                    '                   <div class="col-sm-10">' +
+                    '					    <iframe id="#file_upload#" src="/apply/record/uploadFrame" width="100%" height="412px" frameborder="0" seamless></iframe>' +
+                    '				    </div>' +
+                    '				</div>' +
+                    '			</form>' +
+                    '		</div>' +
+                    '	</div>' +
+                    '</div>';
+                $("#accordion").html("");
+                num = 0;
+                for(let i=0;i<res.length;i++){
+                    let docm = html.replace(/#interfaceName#/g,res[i].interfaceName);
+                    docm = docm.replace(/#interfaceAddress#/g,res[i].interfaceAddress);
+                    docm = docm.replace(/#id#/g,res[i].id);
+                    docm = docm.replace(/#formId#/g,"sub-form"+num);
+                    docm = docm.replace(/#file_upload#/g,"file_upload"+num);
+                    $("#accordion").append(docm);
+                    num += 1;
+                }
+            }
+        });
+    }
 
-        /* 接口管理-停用 */
-        function disable(id) {
-            $.modal.confirm("确认要停用该接口吗?", function() {
-                $.operate.post(prefix + "/changeStatus", { "id": id, "status": 0 });
-            })
+    /**选择部门树**/
+    function selectDeptTree() {
+        var treeId = $("#treeId").val();
+        var deptId = $.common.isEmpty(treeId) ? "100" : $("#treeId").val();
+        var url = ctx + "system/dept/selectDeptTree/" + deptId;
+        var options = {
+            title: '选择部门',
+            width: "380",
+            url: url,
+            callBack: doSubmit
+        };
+        $.modal.openOptions(options);
+    }
+
+    /**选择部门树回调方法**/
+    function doSubmit(index, layero){
+        var tree = layero.find("iframe")[0].contentWindow.$._tree;
+        if ($.tree.notAllowParents(tree)) {
+            var body = layer.getChildFrame('body', index);
+            $("#treeId").val(body.find('#treeId').val());
+            $("#treeName").val(body.find('#treeName').val());
+            layer.close(index);
         }
+    }
+
+    /**step步骤条**/
+    let data = {
+        data: ['开始', '政数局审批', deptName+'审批', '完成'],
+        index: 1 //0是第一步(0~3)
+    };
+    let dom = $('#luStep');
+    dom.stepInit(data);
 
-        /* 接口管理-启用 */
-        function enable(id) {
-            $.modal.confirm("确认要启用该接口吗?", function() {
-                $.operate.post(prefix + "/changeStatus", { "id": id, "status": 1 });
-            })
+
+    /**表单提交方法**/
+    function submitHandler() {
+        let subData = [];
+        let formData = $("#form-record-edit").serializeArray();
+        for (let i = 0; i < num; i++) {
+            let data = $("#sub-form"+i).serializeArray();
+            let elem = {};
+            elem.name = "file";
+            elem.value = $("#file_upload"+i).contents().find("input[name='_file']").val();
+            data.push(elem);
+            subData.push(data);
+        }
+        if ($.validate.form()) {
+            let sub = {"name":"subData","value":JSON.stringify(subData)};
+            formData.push(sub);
+            $.operate.saveTab(apply_prefix + "/edit", formData);
         }
+    }
 
-    </script>
+</script>
 </body>
-</html>
+</html>

+ 105 - 0
mybusiness/src/main/resources/templates/apply/record/edit_bk.html

@@ -0,0 +1,105 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
+<head>
+    <th:block th:include="include :: header('申请记录')" />
+    <th:block th:include="include :: datetimepicker-css" />
+</head>
+<body class="white-bg">
+    <div class="container-div">
+        <div class="row">
+            <div class="col-sm-12 search-collapse">
+                <form id="record_form">
+                    <input type="hidden" id="recordId" name="recordId" th:value="${intRecord.id}">
+                </form>
+            </div>
+            <div class="col-sm-12">
+                <div class="col-sm-12 select-table table-striped">
+                    <table id="bootstrap-table"></table>
+                </div>
+            </div>
+        </div>
+    </div>
+    <th:block th:include="include :: footer" />
+    <script th:inline="javascript">
+
+        var editFlag = [[${@permission.hasPermi('apply:record:edit')}]];
+        var prefix = ctx + "apply/record";
+
+        function submitHandler() {
+
+        }
+
+        $(function() {
+            var options = {
+                url: prefix + "/intDetailedList",
+                pagination: false,
+                showSearch: false,
+                showRefresh: false,
+                showToggle: false,
+                showColumns: false,
+                columns: [{
+                    field: 'index',
+                    align: 'center',
+                    title: "序号",
+                    formatter: function (value, row, index) {
+                    	var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index));
+                    	return columnIndex + $.table.serialNumber(index);
+                    }
+                },{
+                    field: 'intName',
+                    align: 'center',
+                    title: '接口名称'
+                },{
+                    field: 'intCode',
+                    align: 'center',
+                    title: '接口编码'
+                },{
+                    field: 'strAt',
+                    align: 'center',
+                    title: '开始时间'
+				},{
+                    field: 'endAt',
+                    align: 'center',
+                    title: '结束时间'
+				},{
+                    field: 'secretKey',
+                    align: 'center',
+                    title: 'secret_key'
+				},{
+                    visible: editFlag !== 'hidden',
+                    title: '状态',
+                    align: 'center',
+                    formatter: function (value, row, index) {
+                        return statusTools(row);
+                    }
+                }]
+            };
+            $.table.init(options);
+        });
+
+        /* 状态显示 */
+        function statusTools(row) {
+            if (row.status === '0') {
+                return '<i class=\"fa fa-toggle-off text-info fa-2x\" onclick="enable(\'' + row.id + '\')"></i> ';
+            } else {
+                return '<i class=\"fa fa-toggle-on text-info fa-2x\" onclick="disable(\'' + row.id + '\')"></i> ';
+            }
+        }
+
+        /* 接口管理-停用 */
+        function disable(id) {
+            $.modal.confirm("确认要停用该接口吗?", function() {
+                $.operate.post(prefix + "/changeStatus", { "id": id, "status": 0 });
+            })
+        }
+
+        /* 接口管理-启用 */
+        function enable(id) {
+            $.modal.confirm("确认要启用该接口吗?", function() {
+                $.operate.post(prefix + "/changeStatus", { "id": id, "status": 1 });
+            })
+        }
+
+    </script>
+</body>
+</html>

+ 2 - 2
mybusiness/src/main/resources/templates/apply/record/record.html

@@ -27,7 +27,7 @@
                 <a class="btn btn-success" onclick="$.operate.addTab()" shiro:hasPermission="apply:record:add">
                     <i class="fa fa-plus"></i> 添加
                 </a>
-                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="apply:record:edit">
+                <a class="btn btn-primary single disabled" onclick="$.operate.editTab()" shiro:hasPermission="apply:record:edit">
                     <i class="fa fa-edit"></i> 修改
                 </a>
                 <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="apply:record:remove">
@@ -85,7 +85,7 @@
                     align: 'center',
                     formatter: function(value, row, index) {
                         var actions = [];
-                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
+                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.editTab(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                         actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                         return actions.join('');
                     }

+ 146 - 0
mybusiness/src/main/resources/templates/apply/record/uploadFrame.html

@@ -0,0 +1,146 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org">
+<head>
+    <th:block th:include="include :: header('用户列表')" />
+    <th:block th:include="include :: bootstrap-fileinput-css" />
+</head>
+    <input class="file-upload" id="file" name="file" type="file" data-min-file-count="1">
+    <input type="hidden" name="_file" th:value="${file}">
+<th:block th:include="include :: footer" />
+<th:block th:include="include :: bootstrap-fileinput-js" />
+<script>
+
+    /**附件组件多图片回显JS**/
+    let newFilePs = []; //图片回显
+    let imgConfig = []; //预览参数
+    let uploadImageArray = [];//所有已上传的图片路径
+    let fileP=$("input[name='_file']").val();
+    let urlsArr = ($("input[name='_file']").val()).split(",");
+    for(let i in urlsArr) {
+        if (urlsArr[i] != "") {
+            uploadImageArray.push(urlsArr[i]);
+            newFilePs[i] = urlsArr[i];
+            let fileType = urlsArr[i].substr(urlsArr[i].lastIndexOf(".")+1,urlsArr[i].length-1);
+            let ftype ="image"; //文件类型
+            if(fileType=="pdf"){
+                ftype = "pdf";
+            }
+            imgConfig[i] = {
+                url: "/common/removeFile",
+                downloadUrl:urlsArr[i], //下载路径,此项不设置的话下载按钮不显示
+                type:ftype,             //文件类型
+                key: urlsArr[i],        //参数,用于文件删除向后台传参
+                caption:urlsArr[i].substr(urlsArr[i].lastIndexOf("/")+1,urlsArr[i].length-1)    //文件名,用于预览文件显示的文件名
+            };
+        }
+    }
+
+
+    $(".file-upload").each(function (i) {
+        $(this).fileinput({
+            language: 'zh', //设置语言
+            uploadUrl: '/common/upload',
+            deleteUrl: '/common/removeFile',
+            allowedFileExtensions: ['pdf','docx','doc','jpg','png'],//接收的文件后缀
+            showUpload: false, //是否显示上传按钮
+            showRemove: false, //显示移除按钮
+            showPreview: true, //是否显示预览
+            showCaption: false,//是否显示标题
+            browseClass: "btn btn-primary", //按钮样式
+            dropZoneEnabled: true,//是否显示拖拽区域
+            initialPreviewAsData: true,
+            enctype: 'multipart/form-data',
+            initialPreview: newFilePs,
+            uploadAsync: true, //默认异步上传(true),回调fileuploaded,false为同步上传,回调filebatchuploadsuccess
+            maxFileCount: 6,
+            overwriteInitial:false,    //不覆盖已存在的图片
+            initialPreviewConfig: imgConfig, //配置预览的参数
+            autoReplace: true,
+            preferIconicPreview: true,// 强制缩略图显示以下文件扩展名的图标
+            previewFileIconSettings: {
+                'doc': '<i class="fa fa-file-word-o text-primary"></i>',
+                'xls': '<i class="fa fa-file-excel-o text-success"></i>',
+                'ppt': '<i class="fa fa-file-powerpoint-o text-danger"></i>',
+                'zip': '<i class="fa fa-file-archive-o text-muted"></i>',
+                'htm': '<i class="fa fa-file-code-o text-info"></i>',
+                'txt': '<i class="fa fa-file-text-o text-info"></i>',
+                'mov': '<i class="fa fa-file-movie-o text-warning"></i>',
+                'mp3': '<i class="fa fa-file-audio-o text-warning"></i>',
+            },
+            previewFileExtSettings: { // configure the logic for determining icon file extensions
+                'doc': function(ext) {
+                    return ext.match(/(doc|docx)$/i);
+                },
+                'xls': function(ext) {
+                    return ext.match(/(xls|xlsx)$/i);
+                },
+                'ppt': function(ext) {
+                    return ext.match(/(ppt|pptx)$/i);
+                },
+                'zip': function(ext) {
+                    return ext.match(/(zip|rar|tar|gzip|gz|7z)$/i);
+                },
+                'htm': function(ext) {
+                    return ext.match(/(htm|html)$/i);
+                },
+                'txt': function(ext) {
+                    return ext.match(/(txt|ini|csv|java|php|js|css)$/i);
+                },
+                'mov': function(ext) {
+                    return ext.match(/(avi|mpg|mkv|mov|mp4|3gp|webm|wmv)$/i);
+                },
+                'mp3': function(ext) {
+                    return ext.match(/(mp3|wav)$/i);
+                }
+            }
+        }).on('fileuploaded', function (event, data, previewId, index) {
+            fileP += data.response.fileName+",";
+            $('#zoom-'+previewId).find(".kv-preview-data").attr("src",data.response.fileName);//上传成功后替换文件路径(替换为实际数据库的存储路径)
+            $("input[name='_" + event.currentTarget.id + "']").val(data.response.fileName);
+        }).on("filebatchselected", function (event, previewId, files) {//选中文件后执行
+            $(".file-upload").fileinput("upload");
+        }).on('fileremoved', function (event, id, index) {//预览时点击缩略图上的删除按钮才能触发的
+            console.log('fileremoved');
+            getMeg();
+        }).on("filepredelete", function (event, key, jqXHR, data) {   //预览图片删除
+            console.log('filepredelete')
+            getMeg();
+        }).on("filesuccessremove", function (event, id) {   //使用缩略图删除按钮删除成功上传的缩略图后
+            console.log('filesuccessremove')
+            getMeg();
+        })
+        $(this).fileinput('_initFileActions');
+    });
+
+    function nowImgTotal() {
+        return $(".file-preview-thumbnails").find('.file-preview-frame').length / 2;
+    }
+
+    function getMeg() {
+        if (nowImgTotal() >= 6) {
+            $('#file').attr('disabled', 'disabled');
+            $.modal.alert("图片允许上传的最大数值为6,请删除需要被替换的图片后再进行上传操作!")
+            return false;
+        }else{
+            $('#file').removeAttr("disabled");
+        }
+    }
+
+    /*
+        获取当前页面图片附件的存储路径
+     */
+    function getImgUrl(){
+        var initFileDiv = $(".kv-zoom-cache");
+        var imgUrl = [];
+        initFileDiv.each(function(i,e){
+            debugger
+            var fullPath = $(this).find(".kv-preview-data").attr("src");
+            if(fullPath!=null&&fullPath!=""&&fullPath.length>=2)
+                imgUrl[i]="/profile/upload/"+(fullPath.split("upload/",fullPath.length-1))[1];
+        });
+        return imgUrl;
+    }
+
+</script>
+</html>
+

+ 4 - 34
mybusiness/src/main/resources/templates/system/interfaceinfo/interfaceFrame.html

@@ -4,40 +4,10 @@
     <th:block th:include="include :: header('用户列表')" />
     <th:block th:include="include :: bootstrap-fileinput-css" />
 </head>
-    <div class="panel-group" id="accordion">
-        <div class="panel panel-default" th:each="interface : ${list}">
-            <div class="panel-heading">
-                <h5 class="panel-title">
-                    <a data-toggle="collapse" data-parent="#accordion" onclick="openOrClose(this)" th:href="|#${interface.id}|">[[${interface.interfaceName}]]</a>
-                    <span class="panel_sj on"></span>
-                </h5>
-            </div>
-            <div th:id="${interface.id}" class="panel-collapse collapse">
-                <div class="panel-body">
-                    <form class="form-horizontal">
-                        <div class="form-group">
-                            <label class="col-sm-2 control-label">接口地址</label>
-                            <div class="col-sm-10">
-                                <input type="text" class="form-control"  disabled th:value="${interface.interfaceAddress}">
-                            </div>
-                        </div>
-                        <div class="form-group">
-                            <label class="col-sm-2 control-label">接口用途</label>
-                            <div class="col-sm-10">
-                                <input type="text" class="form-control"  disabled name="">
-                            </div>
-                        </div>
-                        <div class="form-group">
-                            <label class="col-sm-2 control-label">附件</label>
-                            <div class="col-sm-10">
-                                <input class="file" type="file" multiple data-min-file-count="1" data-theme="fas">
-                            </div>
-                        </div>
-                    </form>
-                </div>
-            </div>
-        </div>
-    </div>
+<label class="col-sm-2 control-label">附件</label>
+<div class="col-sm-10">
+    <input class="file" type="file" multiple data-min-file-count="1" data-theme="fas">
+</div>
 <th:block th:include="include :: footer" />
 <th:block th:include="include :: bootstrap-fileinput-js" />
 <script>

+ 11 - 3
mybusiness/src/main/resources/templates/system/interfaceinfo/selectInterface.html

@@ -18,7 +18,9 @@
 <th:block th:include="include :: footer" />
 <script th:inline="javascript">
     let prefix = ctx + "system/interfaceinfo";
-    let list = [[${list}]]
+    let list = [[${list}]];
+    let shareType_datas = [[${@dict.getType('share_type')}]];
+    let interfaceType_datas = [[${@dict.getType('interface_type')}]];
     let shareType = [[${shareType}]];
 
     $(function() {
@@ -73,11 +75,17 @@
             },
             {
                 field: 'shareType',
-                title: '接口方式'
+                title: '接口方式',
+                formatter: function (value, item, index) {
+                    return $.table.selectDictLabel(shareType_datas, item.shareType);
+                }
             },
             {
                 field: 'interfaceType',
-                title: '请求方式'
+                title: '请求方式',
+                formatter: function (value, item, index) {
+                    return $.table.selectDictLabel(interfaceType_datas, item.interfaceType);
+                }
             },
             {
                 field: 'env',