Browse Source

接口应用审批管理 数据应用审批管理

wangzhe 2 years ago
parent
commit
9648135f4c
24 changed files with 3537 additions and 5 deletions
  1. 4 0
      mybusiness/src/main/java/com/sooka/apply/domain/IntRecord.java
  2. 79 0
      mybusiness/src/main/java/com/sooka/applyData/controller/DataApprovalController.java
  3. 81 0
      mybusiness/src/main/java/com/sooka/applyData/controller/DataExamineController.java
  4. 263 0
      mybusiness/src/main/java/com/sooka/applyData/controller/DataRecordController.java
  5. 80 0
      mybusiness/src/main/java/com/sooka/applyData/domain/DataBo.java
  6. 46 0
      mybusiness/src/main/java/com/sooka/applyData/domain/DataDetailed.java
  7. 116 0
      mybusiness/src/main/java/com/sooka/applyData/domain/DataRecord.java
  8. 137 0
      mybusiness/src/main/java/com/sooka/applyData/mapper/DataRecordMapper.java
  9. 106 0
      mybusiness/src/main/java/com/sooka/applyData/service/IDataRecordService.java
  10. 269 0
      mybusiness/src/main/java/com/sooka/applyData/service/impl/DataRecordServiceImpl.java
  11. 3 0
      mybusiness/src/main/resources/mapper/apply/IntRecordMapper.xml
  12. 577 0
      mybusiness/src/main/resources/mapper/applyData/DataRecordMapper.xml
  13. 9 3
      mybusiness/src/main/resources/templates/apply/record/add.html
  14. 5 1
      mybusiness/src/main/resources/templates/apply/record/detail.html
  15. 5 1
      mybusiness/src/main/resources/templates/apply/record/edit.html
  16. 126 0
      mybusiness/src/main/resources/templates/applyData/approval/approval.html
  17. 208 0
      mybusiness/src/main/resources/templates/applyData/approval/approvalDetail.html
  18. 126 0
      mybusiness/src/main/resources/templates/applyData/examine/examine.html
  19. 208 0
      mybusiness/src/main/resources/templates/applyData/examine/examineDetail.html
  20. 285 0
      mybusiness/src/main/resources/templates/applyData/record/add.html
  21. 275 0
      mybusiness/src/main/resources/templates/applyData/record/detail.html
  22. 316 0
      mybusiness/src/main/resources/templates/applyData/record/edit.html
  23. 54 0
      mybusiness/src/main/resources/templates/applyData/record/provideDeptTree.html
  24. 159 0
      mybusiness/src/main/resources/templates/applyData/record/record.html

+ 4 - 0
mybusiness/src/main/java/com/sooka/apply/domain/IntRecord.java

@@ -45,6 +45,10 @@ public class IntRecord extends BaseEntity
     /** 提供部门ID */
     private String provideDeptId;
 
+    /** 共享类型 */
+    @Excel(name = "数据来源")
+    private String shareType;
+
     /** 提供部门 */
     @Excel(name = "提供部门")
     private String provideDeptName;

+ 79 - 0
mybusiness/src/main/java/com/sooka/applyData/controller/DataApprovalController.java

@@ -0,0 +1,79 @@
+package com.sooka.applyData.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.sooka.applyData.domain.DataRecord;
+import com.sooka.applyData.service.IDataRecordService;
+import com.sooka.common.core.controller.BaseController;
+import com.sooka.common.core.domain.AjaxResult;
+import com.sooka.common.core.page.TableDataInfo;
+import com.sooka.common.utils.poi.ExcelUtil;
+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.*;
+
+import java.util.List;
+
+/**
+ * 政数局 -- 我的审批Controller
+ *
+ * @author limeng
+ * @date 2022-10-19
+ */
+@Controller
+@RequestMapping("/applyData/approval")
+public class DataApprovalController extends BaseController {
+
+    private String prefix = "applyData/approval";
+
+    @Autowired
+    private IDataRecordService DataRecordService;
+
+    @RequiresPermissions("apply:approval:view")
+    @GetMapping()
+    public String approval()
+    {
+        return prefix + "/approval";
+    }
+
+    /**
+     * 查询我的审批
+     */
+    @PostMapping("/list")
+    @ResponseBody
+    public TableDataInfo list(DataRecord DataRecord)
+    {
+        //只查政数局待审批的数据
+        DataRecord.setStatus("3");
+        startPage();
+        List<DataRecord> list = DataRecordService.selectDataRecordList(DataRecord);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出我的审批
+     */
+    @PostMapping("/export")
+    @ResponseBody
+    public AjaxResult export(DataRecord DataRecord)
+    {
+        List<DataRecord> list = DataRecordService.selectDataRecordList(DataRecord);
+        ExcelUtil<DataRecord> util = new ExcelUtil<DataRecord>(DataRecord.class);
+        return util.exportExcel(list, "approval");
+    }
+
+    /**
+     * 审批页面
+     */
+    @GetMapping("/approval/{id}")
+    public String approval(@PathVariable("id") String id, ModelMap mmap)
+    {
+        DataRecord DataRecord = DataRecordService.selectDataRecordById(id);
+        JSONArray jsonArray = JSONArray.parseArray(JSON.toJSONString(DataRecord.getDataDetailedList()));
+        mmap.put("DataRecord", DataRecord);
+        mmap.put("DataDetailedList", jsonArray);
+        return prefix + "/approvalDetail";
+    }
+}

+ 81 - 0
mybusiness/src/main/java/com/sooka/applyData/controller/DataExamineController.java

@@ -0,0 +1,81 @@
+package com.sooka.applyData.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.sooka.applyData.domain.DataRecord;
+import com.sooka.applyData.service.IDataRecordService;
+import com.sooka.common.core.controller.BaseController;
+import com.sooka.common.core.domain.AjaxResult;
+import com.sooka.common.core.page.TableDataInfo;
+import com.sooka.common.utils.poi.ExcelUtil;
+import com.sooka.framework.util.ShiroUtils;
+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.*;
+
+import java.util.List;
+
+/**
+ * 我的审核Controller
+ *
+ * @author limeng
+ * @date 2022-10-19
+ */
+@Controller
+@RequestMapping("/applyData/examine")
+public class DataExamineController extends BaseController {
+
+    private String prefix = "applyData/examine";
+
+    @Autowired
+    private IDataRecordService DataRecordService;
+
+    @RequiresPermissions("apply:examine:view")
+    @GetMapping()
+    public String examine()
+    {
+        return prefix + "/examine";
+    }
+
+    /**
+     * 查询我的审批
+     */
+    @PostMapping("/list")
+    @ResponseBody
+    public TableDataInfo list(DataRecord DataRecord)
+    {
+        //只查提供部门待审批的数据
+        DataRecord.setStatus("4");
+        DataRecord.setProvideDeptId(ShiroUtils.getSysUser().getDeptId().toString());
+        startPage();
+        List<DataRecord> list = DataRecordService.selectDataRecordList(DataRecord);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出我的审批
+     */
+    @PostMapping("/export")
+    @ResponseBody
+    public AjaxResult export(DataRecord DataRecord)
+    {
+        List<DataRecord> list = DataRecordService.selectDataRecordList(DataRecord);
+        ExcelUtil<DataRecord> util = new ExcelUtil<DataRecord>(DataRecord.class);
+        return util.exportExcel(list, "examine");
+    }
+
+    /**
+     * 审批页面
+     */
+    @GetMapping("/examine/{id}")
+    public String examine(@PathVariable("id") String id, ModelMap mmap)
+    {
+        DataRecord DataRecord = DataRecordService.selectDataRecordById(id);
+        JSONArray jsonArray = JSONArray.parseArray(JSON.toJSONString(DataRecord.getDataDetailedList()));
+        mmap.put("DataRecord", DataRecord);
+        mmap.put("DataDetailedList", jsonArray);
+        return prefix + "/examineDetail";
+    }
+}

+ 263 - 0
mybusiness/src/main/java/com/sooka/applyData/controller/DataRecordController.java

@@ -0,0 +1,263 @@
+package com.sooka.applyData.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.sooka.applyData.domain.DataDetailed;
+import com.sooka.applyData.domain.DataRecord;
+import com.sooka.applyData.service.IDataRecordService;
+import com.sooka.common.annotation.Log;
+import com.sooka.common.core.controller.BaseController;
+import com.sooka.common.core.domain.AjaxResult;
+import com.sooka.common.core.page.TableDataInfo;
+import com.sooka.common.enums.BusinessType;
+import com.sooka.common.utils.poi.ExcelUtil;
+import com.sooka.framework.util.ShiroUtils;
+import com.sooka.system.domain.SysUser;
+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.*;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 申请记录Controller
+ *
+ * @author yhliang
+ * @date 2021-07-06
+ */
+@Controller
+@RequestMapping("/applyData/record")
+public class DataRecordController extends BaseController
+{
+    private String prefix = "applyData/record";
+
+    @Autowired
+    private IDataRecordService DataRecordService;
+
+    @RequiresPermissions("apply:record:view")
+    @GetMapping()
+    public String record()
+    {
+        return prefix + "/record";
+    }
+
+    /**
+     * 查询申请记录列表
+     */
+    @RequiresPermissions("apply:record:list")
+    @PostMapping("/list")
+    @ResponseBody
+    public TableDataInfo list(DataRecord DataRecord)
+    {
+        DataRecord.setApplyUserId(ShiroUtils.getUserId());
+        startPage();
+        List<DataRecord> list = DataRecordService.selectDataRecordList(DataRecord);
+        return getDataTable(list);
+    }
+
+    /**
+     * 新增申请记录
+     */
+    @RequiresPermissions("apply:record:add")
+    @GetMapping("/add")
+    public String add(ModelMap mmap)
+    {
+        SysUser sysUser = ShiroUtils.getSysUser();
+        mmap.put("applyDeptName", sysUser.getDept().getDeptName());
+        mmap.put("applyUserName", sysUser.getUserName());
+        return prefix + "/add";
+    }
+
+    /**
+     * 新增保存申请记录
+     */
+    @Log(title = "申请记录", businessType = BusinessType.INSERT)
+    @PostMapping("/add")
+    @ResponseBody
+    public AjaxResult addSave(DataRecord DataRecord)
+    {
+        DataRecord.setDataDetailedList(structureSubData(DataRecord.getSubData()));
+        return toAjax(DataRecordService.insertDataRecord(DataRecord));
+    }
+
+    private List<DataDetailed> structureSubData(String subData){
+        JSONArray jsonArray = JSONArray.parseArray(subData);
+        List<DataDetailed> list = new ArrayList<>();
+        for(int i=0;i< jsonArray.size();i++){
+            JSONArray jsonArray1 = JSONArray.parseArray(jsonArray.get(i).toString());
+            DataDetailed DataDetailed = new DataDetailed();
+            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")){
+                    DataDetailed.setIntId(jsonObject.getString("value"));
+                }else if(name.equals("purpose")){
+                    DataDetailed.setPurpose(jsonObject.getString("value"));
+                }else if(name.equals("file")){
+                    DataDetailed.setFile(jsonObject.getString("value"));
+                }
+            }
+            list.add(DataDetailed);
+        }
+        return list;
+    }
+
+    /**
+     * 附件单独用iframe
+     */
+    @GetMapping(value={"/uploadFrame","/uploadFrame/{subId}"})
+    public String uploadFrame(@PathVariable(value = "subId", required = false) String subId, ModelMap mmap)
+    {
+        if(subId != null){
+            DataDetailed DataDetailed = DataRecordService.selectDataRecordDetailedBySubId(subId);
+            mmap.put("file",DataDetailed.getFile());
+        }
+        return prefix + "/uploadFrame";
+    }
+
+    /**
+     * 附件单独用iframe
+     */
+    @GetMapping(value={"/uploadFrameDisabled/{subId}"})
+    public String uploadFrameDisabled(@PathVariable(value = "subId", required = false) String subId, ModelMap mmap)
+    {
+        if(subId != null){
+            DataDetailed DataDetailed = DataRecordService.selectDataRecordDetailedBySubId(subId);
+            mmap.put("file",DataDetailed.getFile());
+        }
+        return prefix + "/uploadFrameDisabled";
+    }
+
+    /**
+     * 修改申请记录
+     */
+    @RequiresPermissions("apply:record:edit")
+    @GetMapping("/edit/{id}")
+    public String edit(@PathVariable("id") String id, ModelMap mmap)
+    {
+        DataRecord DataRecord = DataRecordService.selectDataRecordById(id);
+        JSONArray jsonArray = JSONArray.parseArray(JSON.toJSONString(DataRecord.getDataDetailedList()));
+        mmap.put("DataRecord", DataRecord);
+        mmap.put("DataDetailedList", jsonArray);
+        return prefix + "/edit";
+    }
+
+    /**
+     * 修改保存申请记录
+     */
+    @PostMapping("/edit")
+    @ResponseBody
+    public AjaxResult editSave(DataRecord DataRecord)
+    {
+        DataRecord.setDataDetailedList(structureSubData(DataRecord.getSubData()));
+        return toAjax(DataRecordService.editDataRecord(DataRecord));
+    }
+
+    /**
+     * 保存驳回信息字段
+     */
+    @PostMapping("/reject")
+    @ResponseBody
+    public AjaxResult reject(DataRecord DataRecord)
+    {
+        return toAjax(DataRecordService.rejectDataRecord(DataRecord));
+    }
+
+    /**
+     * 导出申请记录列表
+     */
+    @RequiresPermissions("apply:record:export")
+    @Log(title = "申请记录", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    @ResponseBody
+    public AjaxResult export(DataRecord DataRecord)
+    {
+        List<DataRecord> list = DataRecordService.selectDataRecordList(DataRecord);
+        ExcelUtil<DataRecord> util = new ExcelUtil<DataRecord>(DataRecord.class);
+        return util.exportExcel(list, "record");
+    }
+
+    /**
+     * 删除申请记录
+     */
+    @RequiresPermissions("apply:record:remove")
+    @Log(title = "申请记录", businessType = BusinessType.DELETE)
+    @PostMapping( "/remove")
+    @ResponseBody
+    public AjaxResult remove(String ids)
+    {
+        return toAjax(DataRecordService.deleteDataRecordByIds(ids));
+    }
+
+    /**
+     * 修改状态
+     */
+    @PostMapping("/updateStatus")
+    @ResponseBody
+    public AjaxResult updateStatus(String id,String status)
+    {
+        return toAjax(DataRecordService.updateStatus(id,status));
+    }
+
+    /**
+     * 查看详情
+     */
+    @GetMapping("/detail/{id}")
+    public String detail(@PathVariable("id") String id, ModelMap mmap)
+    {
+        DataRecord DataRecord = DataRecordService.selectDataRecordById(id);
+        JSONArray jsonArray = JSONArray.parseArray(JSON.toJSONString(DataRecord.getDataDetailedList()));
+        mmap.put("DataRecord", DataRecord);
+        mmap.put("DataDetailedList", jsonArray);
+        return prefix + "/detail";
+    }
+
+    /**
+     * 驳回原因弹框
+     */
+    @GetMapping("/rejectDialog/{id}")
+    public String rejectDialog(@PathVariable("id") String id, ModelMap mmap)
+    {
+        DataRecord DataRecord = DataRecordService.selectDataRecordById(id);
+        mmap.put("DataRecord", DataRecord);
+        return prefix + "/rejectDialog";
+    }
+
+
+
+
+
+
+/***********************以下为一期原有方法******************************/
+
+    /**
+     * 查询申请记录列表
+     */
+    @RequiresPermissions("apply:record:list")
+    @PostMapping("/DataDetailedList")
+    @ResponseBody
+    public TableDataInfo DataDetailedList(DataDetailed DataDetailed)
+    {
+        startPage();
+        List<DataDetailed> list = DataRecordService.selectDataDetailedList(DataDetailed);
+        return getDataTable(list);
+    }
+
+    /**
+     * 状态修改
+     */
+    @Log(title = "接口管理", businessType = BusinessType.UPDATE)
+    @RequiresPermissions("apply:record:edit")
+    @PostMapping("/changeStatus")
+    @ResponseBody
+    public AjaxResult changeStatus(DataDetailed DataDetailed)
+    {
+        return toAjax(DataRecordService.changeStatus(DataDetailed));
+    }
+
+
+}

+ 80 - 0
mybusiness/src/main/java/com/sooka/applyData/domain/DataBo.java

@@ -0,0 +1,80 @@
+package com.sooka.applyData.domain;
+
+import com.sooka.common.utils.StringUtils;
+
+/******************************
+ * TODO
+ * @author yanhongliang
+ * @date 2021-07-07 1:20 PM
+ ******************************/
+
+public class DataBo {
+
+    private String id;
+
+    private String intIds;
+
+    private String intCodes;
+
+    private Long deptId;
+
+    private String datetime;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getIntIds() {
+        return intIds;
+    }
+
+    public void setIntIds(String intIds) {
+        this.intIds = intIds;
+    }
+
+    public String getIntCodes() {
+        return intCodes;
+    }
+
+    public void setIntCodes(String intCodes) {
+        this.intCodes = intCodes;
+    }
+
+    public Long getDeptId() {
+        return deptId;
+    }
+
+    public void setDeptId(Long deptId) {
+        this.deptId = deptId;
+    }
+
+    public String getDatetime() {
+        return datetime;
+    }
+
+    public void setDatetime(String datetime) {
+        this.datetime = datetime;
+    }
+
+    public static boolean check(DataBo DataBo) {
+
+        return DataBo != null &&
+                StringUtils.isNotEmpty(DataBo.getIntIds()) &&
+                DataBo.getDeptId() != 0 &&
+                StringUtils.isNotEmpty(DataBo.getDatetime()) &&
+                DataBo.datetime.split("-").length > 2;
+    }
+
+    @Override
+    public String toString() {
+        return "DataBo{" +
+                "id='" + id + '\'' +
+                ", deptId='" + deptId + '\'' +
+                ", datetime='" + datetime + '\'' +
+                '}';
+    }
+}

+ 46 - 0
mybusiness/src/main/java/com/sooka/applyData/domain/DataDetailed.java

@@ -0,0 +1,46 @@
+package com.sooka.applyData.domain;
+
+import com.sooka.common.core.domain.BaseEntity;
+import lombok.Data;
+
+/**
+ * 申请明细对象 int_detailed
+ *
+ * @author yhliang
+ * @date 2021-07-06
+ */
+@Data
+public class DataDetailed extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 主键 */
+    private String id;
+
+    private String subId;
+
+    /** 记录表id */
+    private String recordId;
+
+    /** 接口表id */
+    private String intId;
+
+    /** 接口名称 */
+    private String interfaceName;
+
+    /** 接口地址 */
+    private String interfaceAddress;
+
+    /** 接口编码 */
+    private String code;
+
+    /** secret_key */
+    private String secretKey;
+
+    /** 用途 */
+    private String purpose;
+
+    /** 附件 */
+    private String file;
+
+}

+ 116 - 0
mybusiness/src/main/java/com/sooka/applyData/domain/DataRecord.java

@@ -0,0 +1,116 @@
+package com.sooka.applyData.domain;
+
+import com.sooka.common.annotation.Excel;
+import com.sooka.common.core.domain.BaseEntity;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * 申请记录对象 int_record
+ *
+ * @author yhliang
+ * @date 2021-07-06
+ */
+@Data
+public class DataRecord extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** null */
+    private String id;
+
+    /** 申请部门ID */
+    private Long applyDeptId;
+
+    /** 申请部门 */
+    @Excel(name = "申请部门")
+    private String applyDeptName;
+
+    /** 申请人ID */
+    private Long applyUserId;
+
+    /** 申请人 */
+    @Excel(name = "申请人")
+    private String applyUserName;
+
+    /** 联系方式 */
+    @Excel(name = "联系方式")
+    private String tel;
+
+    /** 调用者IP */
+    @Excel(name = "调用者IP")
+    private String ip;
+
+    /** 提供部门ID */
+    private String provideDeptId;
+
+    /** 提供部门 */
+    @Excel(name = "提供部门")
+    private String provideDeptName;
+
+    /** 申请时间 */
+    @Excel(name = "申请时间", width = 30)
+    private String applyTime;
+
+    /** 调用频率 */
+    @Excel(name = "调用频率")
+    private String frequency;
+
+    /** 使用时效开始时间 */
+    @Excel(name = "使用时效开始时间", width = 30)
+    private String startTime;
+
+    /** 使用时效结束时间 */
+    @Excel(name = "使用时效结束时间", width = 30)
+    private String endTime;
+
+    /** 起止时间 */
+    private String duration;
+
+    /** 状态 */
+    private String status;
+
+    /** 申请明细信息 */
+    private List<DataDetailed> DataDetailedList;
+
+    /** 用于接收前台JSONArray **/
+    private String subData;
+
+    /** 政数局审批人ID */
+    private String approvalUserId;
+
+    /** 政数局审批人 */
+    private String approvalUserName;
+
+    /** 政数局审批时间 */
+    private String approvalTime;
+
+    /** 政数局审批附件 */
+    private String approvalFile;
+
+    /** 政数局审批内容 */
+    private String approvalContent;
+
+    /** 接口提供部门审批人ID */
+    private String examineUserId;
+
+    /** 接口提供部门审批人 */
+    private String examineUserName;
+
+    /** 接口提供部门审批时间 */
+    private String examineTime;
+
+    /** 接口提供部门审批附件 */
+    private String examineFile;
+
+    /** 接口提供部门审批内容 */
+    private String examineContent;
+
+    /** 仅用于接收驳回弹窗里的通用file字段 */
+    private String file;
+
+    /** 仅用于接收驳回弹窗里的通用content字段 */
+    private String content;
+
+}

+ 137 - 0
mybusiness/src/main/java/com/sooka/applyData/mapper/DataRecordMapper.java

@@ -0,0 +1,137 @@
+package com.sooka.applyData.mapper;
+
+import com.sooka.applyData.domain.DataDetailed;
+import com.sooka.applyData.domain.DataRecord;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 申请记录Mapper接口
+ *
+ * @author yhliang
+ * @date 2021-07-06
+ */
+public interface DataRecordMapper
+{
+    /**
+     * 查询申请记录
+     *
+     * @param id 申请记录ID
+     * @return 申请记录
+     */
+    public DataRecord selectDataRecordById(String id);
+
+    /**
+     * 查询申请子表记录
+     *
+     * @param subId 申请子表记录ID
+     * @return 申请记录
+     */
+    public DataDetailed selectDataRecordDetailedBySubId(String subId);
+
+    /**
+     * 根据接口ID查询子表记录
+     *
+     * @param intId 申请子表记录ID
+     * @return 申请记录
+     */
+    public List<DataDetailed> selectDataDetailedByIntId(String intId);
+
+    /**
+     * 查询申请记录列表
+     *
+     * @param DataRecord 申请记录
+     * @return 申请记录集合
+     */
+    public List<DataRecord> selectDataRecordList(DataRecord DataRecord);
+
+    /**
+     * 查询申请记录明细
+     *
+     * @param DataDetailed 查询条件
+     * @return 申请明细集合
+     */
+    public List<DataDetailed> selectDataDetailedList(DataDetailed DataDetailed);
+
+
+    /**
+     * 新增申请记录
+     *
+     * @param DataRecord 申请记录
+     * @return 结果
+     */
+    public int insertDataRecord(DataRecord DataRecord);
+
+    /**
+     * 新增申请明细
+     *
+     * @param DataDetailed 申请明细
+     * @return 结果
+     */
+    public int insertDataDetailed(DataDetailed DataDetailed);
+
+    /**
+     * 修改申请记录
+     *
+     * @param intBo 申请记录
+     * @return 结果
+     */
+    public int editDataRecord(DataRecord intBo);
+
+    /**
+     * 批量删除申请记录
+     *
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteDataRecordByIds(String[] ids);
+
+    /**
+     * 批量删除申请明细
+     *
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteDataDetailedByRecordIds(String[] ids);
+
+    /**
+     * 批量新增申请明细
+     *
+     * @param DataDetailedList 申请明细列表
+     * @return 结果
+     */
+    public int batchDataDetailed(List<DataDetailed> DataDetailedList);
+
+    /**
+     * 状态修改
+     *
+     * @param DataDetailed 接口信息
+     * @return 结果
+     */
+    public int changeStatus(DataDetailed DataDetailed);
+
+    /**
+     * 提交审核
+     * @return 结果
+     */
+    public int updateStatus(@Param("id") String id, @Param("status") String status);
+
+    /**
+     * 接口申请频次
+     * @param shareTypes 接口类型
+     * @return 结果
+     */
+    public Map applyFrequency(String[] shareTypes);
+
+    /**
+     * 接口申请数量
+     * @param provideDeptId 提供部门ID
+     * @return 结果
+     */
+    public Map applyCount(@Param("year") String year, @Param("provideDeptId") String provideDeptId);
+
+
+
+}

+ 106 - 0
mybusiness/src/main/java/com/sooka/applyData/service/IDataRecordService.java

@@ -0,0 +1,106 @@
+package com.sooka.applyData.service;
+
+
+import com.sooka.applyData.domain.DataDetailed;
+import com.sooka.applyData.domain.DataRecord;
+
+import java.util.List;
+
+/**
+ * 申请记录Service接口
+ *
+ * @author yhliang
+ * @date 2021-07-06
+ */
+public interface IDataRecordService
+{
+    /**
+     * 查询申请记录
+     *
+     * @param id 申请记录ID
+     * @return 申请记录
+     */
+    public DataRecord selectDataRecordById(String id);
+
+    /**
+     * 查询申请子表记录
+     *
+     * @param subId 申请子表记录ID
+     * @return 申请记录
+     */
+    public DataDetailed selectDataRecordDetailedBySubId(String subId);
+
+    /**
+     * 查询申请记录列表
+     *
+     * @param DataRecord 申请记录
+     * @return 申请记录集合
+     */
+    public List<DataRecord> selectDataRecordList(DataRecord DataRecord);
+
+    /**
+     * 查询申请记录明细
+     *
+     * @param DataDetailed 查询条件
+     * @return 申请明细集合
+     */
+    public List<DataDetailed> selectDataDetailedList(DataDetailed DataDetailed);
+
+    /**
+     * 新增申请记录
+     *
+     * @param intBo 申请记录
+     * @return 结果
+     */
+    public int insertDataRecord(DataRecord intBo);
+
+    /**
+     * 修改申请记录
+     *
+     * @param intBo 申请记录
+     * @return 结果
+     */
+    public int editDataRecord(DataRecord intBo);
+
+    /**
+     * 保存驳回信息字段
+     */
+    public int rejectDataRecord(DataRecord intBo);
+
+    /**
+     * 批量删除申请记录
+     *
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteDataRecordByIds(String ids);
+
+    /**
+     * 状态修改
+     *
+     * @param DataDetailed 接口信息
+     * @return 结果
+     */
+    public int changeStatus(DataDetailed DataDetailed);
+
+    /**
+     * 提交审核
+     * @return 结果
+     */
+    public int updateStatus(String id, String status);
+
+    /**
+     * 接口申请频次
+     * @param shareTypes 接口类型
+     * @return 结果
+     */
+    public String[] applyFrequency(String[] shareTypes);
+
+    /**
+     * 接口申请数量
+     * @param deptId 部门ID
+     * @return 结果
+     */
+    public String[] applyCount(String year, String deptId);
+
+}

+ 269 - 0
mybusiness/src/main/java/com/sooka/applyData/service/impl/DataRecordServiceImpl.java

@@ -0,0 +1,269 @@
+package com.sooka.applyData.service.impl;
+
+import com.sooka.applyData.domain.DataDetailed;
+import com.sooka.applyData.domain.DataRecord;
+import com.sooka.applyData.mapper.DataRecordMapper;
+import com.sooka.applyData.service.IDataRecordService;
+import com.sooka.common.core.text.Convert;
+import com.sooka.common.utils.DateUtils;
+import com.sooka.common.utils.uuid.IdUtils;
+import com.sooka.framework.util.ShiroUtils;
+import com.sooka.system.domain.SysUser;
+import com.util.SecretKeyUtil;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 申请记录Service业务层处理
+ *
+ * @author yhliang
+ * @date 2021-07-06
+ */
+@Service
+public class DataRecordServiceImpl implements IDataRecordService
+{
+    @Resource
+    private DataRecordMapper DataRecordMapper;
+
+    /**
+     * 查询申请记录
+     *
+     * @param id 申请记录ID
+     * @return 申请记录
+     */
+    @Override
+    public DataRecord selectDataRecordById(String id)
+    {
+        return DataRecordMapper.selectDataRecordById(id);
+    }
+
+    /**
+     * 查询申请子表记录
+     *
+     * @param subId 申请子表记录ID
+     * @return 申请记录
+     */
+    @Override
+    public DataDetailed selectDataRecordDetailedBySubId(String subId){
+        return DataRecordMapper.selectDataRecordDetailedBySubId(subId);
+    }
+
+    /**
+     * 查询申请记录列表
+     *
+     * @param DataRecord 申请记录
+     * @return 申请记录
+     */
+    @Override
+    public List<DataRecord> selectDataRecordList(DataRecord DataRecord)
+    {
+        return DataRecordMapper.selectDataRecordList(DataRecord);
+    }
+
+    /**
+     * 查询申请记录明细
+     *
+     * @param DataDetailed 查询条件
+     * @return 申请明细集合
+     */
+    @Override
+    public List<DataDetailed> selectDataDetailedList(DataDetailed DataDetailed) {
+        return DataRecordMapper.selectDataDetailedList(DataDetailed);
+    }
+
+    /**
+     * 新增申请记录
+     *
+     * @param DataRecord 申请记录
+     * @return 结果
+     */
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public int insertDataRecord(DataRecord DataRecord)
+    {
+        /**添加主表**/
+        SysUser sysUser = ShiroUtils.getSysUser();
+        DataRecord.setApplyDeptId(sysUser.getDept().getDeptId());
+        DataRecord.setApplyDeptName(sysUser.getDept().getDeptName());
+        DataRecord.setApplyUserId(sysUser.getUserId());
+        DataRecord.setApplyUserName(sysUser.getUserName());
+        DataRecord.setApplyTime(DateUtils.dateTimeNow(DateUtils.YYYY_MM_DD));
+        DataRecord.setStartTime(DataRecord.getDuration().split(" - ")[0]);
+        DataRecord.setEndTime(DataRecord.getDuration().split(" - ")[1]);
+        //状态:0新建,政数局通过1,提供部门通过2,政数局待审批3,提供部门待审批4,政数局驳回5,提供部门驳回6
+        DataRecord.setStatus("0");
+        /**添加后返回主表ID**/
+        DataRecordMapper.insertDataRecord(DataRecord);
+        /**添加子表**/
+        return insertDataDetailed(DataRecord.getId(),DataRecord.getDuration(),DataRecord.getDataDetailedList());
+    }
+
+    /**
+     * 修改申请记录
+     *
+     * @param DataRecord 申请记录
+     * @return 结果
+     */
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public int editDataRecord(DataRecord DataRecord){
+        /**添加主表**/
+        SysUser sysUser = ShiroUtils.getSysUser();
+        DataRecord.setApplyDeptId(sysUser.getDept().getDeptId());
+        DataRecord.setApplyDeptName(sysUser.getDept().getDeptName());
+        DataRecord.setApplyUserId(sysUser.getUserId());
+        DataRecord.setApplyUserName(sysUser.getUserName());
+        DataRecord.setApplyTime(DateUtils.dateTimeNow(DateUtils.YYYY_MM_DD));
+        DataRecord.setStartTime(DataRecord.getDuration().split(" - ")[0]);
+        DataRecord.setEndTime(DataRecord.getDuration().split(" - ")[1]);
+        //状态:0新建,政数局通过1,提供部门通过2,政数局待审批3,提供部门待审批4,政数局驳回5,提供部门驳回6
+        DataRecord.setStatus("0");
+        /**修改主表**/
+        DataRecordMapper.editDataRecord(DataRecord);
+        /**删除子表**/
+        DataRecordMapper.deleteDataDetailedByRecordIds(Convert.toStrArray(DataRecord.getId()));
+        /**添加子表**/
+        return insertDataDetailed(DataRecord.getId(),DataRecord.getDuration(),DataRecord.getDataDetailedList());
+    }
+
+    /**
+     * 提交审核
+     * @return 结果
+     */
+    @Override
+    public int updateStatus(String id, String status){
+        return DataRecordMapper.updateStatus(id,status);
+    }
+
+    /**
+     * 修改申请记录
+     *
+     * @param intBo 申请记录
+     * @return 结果
+     */
+    @Override
+    public int rejectDataRecord(DataRecord intBo){
+        SysUser sysUser = ShiroUtils.getSysUser();
+        //如果是政数局驳回,status = 5
+        String zsj_reject = "3";
+        if(zsj_reject.equals(intBo.getStatus())){
+            intBo.setApprovalUserId(sysUser.getUserId().toString());
+            intBo.setApprovalUserName(sysUser.getUserName());
+            intBo.setApprovalTime(DateUtils.getDate());
+            intBo.setApprovalFile(intBo.getFile());
+            intBo.setApprovalContent(intBo.getContent());
+            intBo.setStatus("5");
+        }else{
+            //否则 status = 6
+            intBo.setExamineUserId(sysUser.getUserId().toString());
+            intBo.setExamineUserName(sysUser.getUserName());
+            intBo.setExamineTime(DateUtils.getDate());
+            intBo.setExamineFile(intBo.getFile());
+            intBo.setExamineContent(intBo.getContent());
+            intBo.setStatus("6");
+        }
+        return DataRecordMapper.editDataRecord(intBo);
+    }
+
+    /**
+     * 删除申请记录对象
+     *
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public int deleteDataRecordByIds(String ids)
+    {
+        DataRecordMapper.deleteDataDetailedByRecordIds(Convert.toStrArray(ids));
+        return DataRecordMapper.deleteDataRecordByIds(Convert.toStrArray(ids));
+    }
+
+    /**
+     * 状态修改
+     *
+     * @param DataDetailed 接口信息
+     * @return 结果
+     */
+    @Override
+    public int changeStatus(DataDetailed DataDetailed) {
+        System.out.println(DataDetailed.toString());
+        return DataRecordMapper.changeStatus(DataDetailed);
+    }
+
+    /**
+     * 新增申请明细信息
+     *
+     * @param list 申请记录对象
+     */
+    private int insertDataDetailed(String id, String duration, List<DataDetailed> list){
+
+        String deptId = ShiroUtils.getSysUser().getDept().getDeptId().toString();
+        String deptName = ShiroUtils.getSysUser().getDept().getDeptName();
+
+        List<DataDetailed> list_ = new ArrayList<DataDetailed>();
+        for (int i = 0; i < list.size(); i++) {
+            DataDetailed DataDetailed = new DataDetailed();
+            DataDetailed.setRecordId(id);
+            DataDetailed.setIntId(list.get(i).getIntId());
+            DataDetailed.setSecretKey(SecretKeyUtil.AESEncode("3fc674da58",deptId+"/"+deptName+"/"+duration+"/"+IdUtils.fastSimpleUUID()));
+            DataDetailed.setPurpose(list.get(i).getPurpose());
+            DataDetailed.setFile(list.get(i).getFile());
+            list_.add(DataDetailed);
+        }
+        if (list_.size() > 0) {
+            return DataRecordMapper.batchDataDetailed(list_);
+        }
+        return 0;
+    }
+
+    /**
+     * 接口申请频次
+     * @param shareTypes 接口类型
+     * @return 结果
+     */
+    @Override
+    public String[] applyFrequency(String[] shareTypes){
+        Map map = DataRecordMapper.applyFrequency(shareTypes);
+        return Map2Array(map);
+    }
+
+    /**
+     * 接口申请数量
+     * @param deptId 部门ID
+     * @return 结果
+     */
+    @Override
+    public String[] applyCount(String year, String deptId){
+        Map map = DataRecordMapper.applyCount(year,deptId);
+        return Map2Array(map);
+    }
+
+    /**
+     * Map转二维数组
+     * @param map
+     * @return
+     */
+    public static String[] Map2Array(Map map) {
+        String[] strings = null;
+        if (map != null && !map.isEmpty()) {
+            int size = map.size();
+            strings = new String[size];
+
+            Iterator iterator = map.entrySet().iterator();
+            for (int i = 0; i < size; i++) {
+                Map.Entry entry = (Map.Entry) iterator.next();
+                Object value = entry.getValue();
+                strings[i] = String.valueOf(value);
+            }
+        }
+        return strings;
+    }
+
+}

+ 3 - 0
mybusiness/src/main/resources/mapper/apply/IntRecordMapper.xml

@@ -18,6 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="frequency"    column="frequency"    />
         <result property="duration"    column="duration"    />
         <result property="startTime"    column="start_time"    />
+        <result property="shareType"    column="share_type"    />
         <result property="endTime"    column="end_time"    />
         <result property="status"    column="status"    />
         <result property="approvalUserId"    column="approval_user_id"    />
@@ -120,6 +121,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             b.secret_key,
             b.purpose,
             b.file,
+            d.dict_label share_type,
             c.interface_name,
             c.interface_address,
             c.code
@@ -127,6 +129,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             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
+        LEFT JOIN sys_dict_data d on c.share_type = d.dict_value
         WHERE a.id = #{id}
     </select>
 

+ 577 - 0
mybusiness/src/main/resources/mapper/applyData/DataRecordMapper.xml

@@ -0,0 +1,577 @@
+<?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.sooka.applyData.mapper.DataRecordMapper">
+
+    <resultMap type="DataRecord" id="DataRecordResult">
+        <result property="id"    column="id"    />
+        <result property="applyDeptId"    column="apply_dept_id"    />
+        <result property="applyDeptName"    column="apply_dept_name"    />
+        <result property="applyUserId"    column="apply_user_id"    />
+        <result property="applyUserName"    column="apply_user_name"    />
+        <result property="tel"    column="tel"    />
+        <result property="ip"    column="ip"    />
+        <result property="provideDeptId"    column="provide_dept_id"    />
+        <result property="provideDeptName"    column="provide_dept_name"    />
+        <result property="applyTime"    column="apply_time"    />
+        <result property="frequency"    column="frequency"    />
+        <result property="duration"    column="duration"    />
+        <result property="startTime"    column="start_time"    />
+        <result property="endTime"    column="end_time"    />
+        <result property="status"    column="status"    />
+        <result property="approvalUserId"    column="approval_user_id"    />
+        <result property="approvalUserName"    column="approval_user_name"    />
+        <result property="approvalTime"    column="approval_time"    />
+        <result property="approvalFile"    column="approval_file"    />
+        <result property="approvalContent"    column="approval_content"    />
+        <result property="examineUserId"    column="examine_user_id"    />
+        <result property="examineUserName"    column="examine_user_name"    />
+        <result property="examineTime"    column="examine_time"    />
+        <result property="examineFile"    column="examine_file"    />
+        <result property="examineContent"    column="examine_content"    />
+    </resultMap>
+
+    <resultMap id="DataRecordDataDetailedResult" type="DataRecord" extends="DataRecordResult">
+        <collection property="DataDetailedList" notNullColumn="id" javaType="java.util.List" resultMap="DataDetailedResult" />
+    </resultMap>
+
+    <resultMap type="DataDetailed" id="DataDetailedResult">
+        <result property="subId"    column="sub_id"    />
+        <result property="recordId"    column="record_id"    />
+        <result property="intId"    column="int_id"    />
+        <result property="secretKey"    column="secret_key"    />
+        <result property="purpose"    column="purpose"    />
+        <result property="file"    column="file"    />
+        <result property="interfaceName"    column="interface_name"    />
+        <result property="interfaceAddress"    column="interface_address"    />
+        <result property="code"    column="code"    />
+    </resultMap>
+
+    <sql id="selectDataRecordVo">
+        SELECT
+            id,
+            apply_dept_id,
+            apply_dept_name,
+            apply_user_id,
+            apply_user_name,
+            tel,
+            ip,
+            provide_dept_id,
+            provide_dept_name,
+            apply_time,
+            frequency,
+            CONCAT(start_time,' - ',end_time) duration,
+            start_time,
+            end_time,
+            status
+        FROM
+            int_record
+    </sql>
+
+    <select id="selectDataRecordList" parameterType="DataRecord" resultMap="DataRecordResult">
+        <include refid="selectDataRecordVo"/>
+        <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
+        status ASC,
+        apply_time DESC,
+        end_time ASC
+    </select>
+
+    <select id="selectDataRecordById" parameterType="String" resultMap="DataRecordDataDetailedResult">
+        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,
+            a.approval_user_id,
+            a.approval_user_name,
+            a.approval_time,
+            a.approval_file,
+            a.approval_content,
+            a.examine_user_id,
+            a.examine_user_name,
+            a.examine_time,
+            a.examine_file,
+            a.examine_content,
+            b.id sub_id,
+            b.record_id,
+            b.int_id,
+            b.secret_key,
+            b.purpose,
+            b.file,
+            c.interface_name,
+            c.interface_address,
+            c.code
+        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="insertDataRecord" parameterType="DataRecord" useGeneratedKeys="true" keyProperty="id">
+        insert into int_record
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="applyDeptId != null">apply_dept_id,</if>
+            <if test="applyDeptName != null">apply_dept_name,</if>
+            <if test="applyUserId != null">apply_user_id,</if>
+            <if test="applyUserName != null">apply_user_name,</if>
+            <if test="tel != null">tel,</if>
+            <if test="ip != null">ip,</if>
+            <if test="provideDeptId != null">provide_dept_id,</if>
+            <if test="provideDeptName != null">provide_dept_name,</if>
+            <if test="applyTime != null">apply_time,</if>
+            <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>
+            <if test="applyDeptName != null">#{applyDeptName},</if>
+            <if test="applyUserId != null">#{applyUserId},</if>
+            <if test="applyUserName != null">#{applyUserName},</if>
+            <if test="tel != null">#{tel},</if>
+            <if test="ip != null">#{ip},</if>
+            <if test="provideDeptId != null">#{provideDeptId},</if>
+            <if test="provideDeptName != null">#{provideDeptName},</if>
+            <if test="applyTime != null">#{applyTime},</if>
+            <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>
+
+    <!--新增申请明细-->
+    <insert id="insertDataDetailed" parameterType="DataDetailed" useGeneratedKeys="true" keyProperty="id">
+        insert into int_detailed(int_id, secret_key, purpose, int_code) values (#{intId} ,#{secretKey}, #{purpose}, #{code})
+    </insert>
+
+    <select id="selectDataRecordDetailedBySubId" parameterType="String" resultMap="DataDetailedResult">
+        SELECT
+            id,
+            record_id,
+            int_id,
+            secret_key,
+            purpose,
+            file
+        FROM
+            int_detailed
+        WHERE
+            id = #{subId}
+    </select>
+
+    <select id="selectDataDetailedByIntId" parameterType="String" resultMap="DataDetailedResult">
+        SELECT
+            id,
+            record_id,
+            int_id,
+            secret_key,
+            purpose,
+            file
+        FROM
+            int_detailed
+        WHERE
+            int_id = #{intId}
+    </select>
+
+    <!--批量新增子表-->
+    <insert id="batchDataDetailed">
+        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="editDataRecord" parameterType="DataRecord">
+        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>
+            <if test="approvalUserId != null">approval_user_id = #{approvalUserId},</if>
+            <if test="approvalUserName != null">approval_user_name = #{approvalUserName},</if>
+            <if test="approvalTime != null">approval_time = #{approvalTime},</if>
+            <if test="approvalFile != null">approval_file = #{approvalFile},</if>
+            <if test="approvalContent != null">approval_content = #{approvalContent},</if>
+            <if test="examineUserId != null">examine_user_id = #{examineUserId},</if>
+            <if test="examineUserName != null">examine_user_name = #{examineUserName},</if>
+            <if test="examineTime != null">examine_time = #{examineTime},</if>
+            <if test="examineFile != null">examine_file = #{examineFile},</if>
+            <if test="examineContent != null">examine_content = #{examineContent},</if>
+        </trim>
+        WHERE id = #{id}
+    </update>
+
+    <update id="updateStatus" parameterType="String">
+        update int_record
+        <set>
+            <if test="status != null and status != ''">status = #{status},</if>
+        </set>
+        where id = #{id}
+    </update>
+
+
+
+
+
+
+
+    <update id="changeStatus" parameterType="DataDetailed">
+        update int_detailed
+        <set>
+            <if test="status != null and status != ''">status = #{status},</if>
+        </set>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteDataRecordByIds" parameterType="String">
+        delete from int_record where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+
+    <delete id="deleteDataDetailedByRecordIds" parameterType="String">
+        delete from int_detailed where record_id in
+        <foreach item="recordId" collection="array" open="(" separator="," close=")">
+            #{recordId}
+        </foreach>
+    </delete>
+
+    <select id="applyFrequency" parameterType="String" resultType="java.util.LinkedHashMap">
+        SELECT
+            IFNULL(
+                SUM(
+                    CASE MONTH (apply_time)
+                    WHEN 1 THEN
+                        1
+                    ELSE
+                        0
+                    END
+                ),
+                0
+            ) AS jan,
+            IFNULL(
+                SUM(
+                    CASE MONTH (apply_time)
+                    WHEN 2 THEN
+                        1
+                    ELSE
+                        0
+                    END
+                ),
+                0
+            ) AS feb,
+            IFNULL(
+                SUM(
+                    CASE MONTH (apply_time)
+                    WHEN 3 THEN
+                        1
+                    ELSE
+                        0
+                    END
+                ),
+                0
+            ) AS mar,
+            IFNULL(
+                SUM(
+                    CASE MONTH (apply_time)
+                    WHEN 4 THEN
+                        1
+                    ELSE
+                        0
+                    END
+                ),
+                0
+            ) AS apr,
+            IFNULL(
+                SUM(
+                    CASE MONTH (apply_time)
+                    WHEN 5 THEN
+                        1
+                    ELSE
+                        0
+                    END
+                ),
+                0
+            ) AS may,
+            IFNULL(
+                SUM(
+                    CASE MONTH (apply_time)
+                    WHEN 6 THEN
+                        1
+                    ELSE
+                        0
+                    END
+                ),
+                0
+            ) AS jun,
+            IFNULL(
+                SUM(
+                    CASE MONTH (apply_time)
+                    WHEN 7 THEN
+                        1
+                    ELSE
+                        0
+                    END
+                ),
+                0
+            ) AS jul,
+            IFNULL(
+                SUM(
+                    CASE MONTH (apply_time)
+                    WHEN 8 THEN
+                        1
+                    ELSE
+                        0
+                    END
+                ),
+                0
+            ) AS aug,
+            IFNULL(
+                SUM(
+                    CASE MONTH (apply_time)
+                    WHEN 9 THEN
+                        1
+                    ELSE
+                        0
+                    END
+                ),
+                0
+            ) AS sep,
+            IFNULL(
+                SUM(
+                    CASE MONTH (apply_time)
+                    WHEN 10 THEN
+                        1
+                    ELSE
+                        0
+                    END
+                ),
+                0
+            ) AS oct,
+            IFNULL(
+                SUM(
+                    CASE MONTH (apply_time)
+                    WHEN 11 THEN
+                        1
+                    ELSE
+                        0
+                    END
+                ),
+                0
+            ) AS nov,
+            IFNULL(
+                SUM(
+                    CASE MONTH (apply_time)
+                    WHEN 12 THEN
+                        1
+                    ELSE
+                        0
+                    END
+                ),
+                0
+            ) AS decb
+        FROM
+            (
+                SELECT
+                    r.apply_time,
+                    i.share_type
+                FROM
+                    int_record r
+                LEFT JOIN int_detailed d ON r.id = d.record_id
+                LEFT JOIN t_u_interfaceinfo i ON d.int_id = i.id
+                WHERE
+                    share_type in
+                    <foreach item="share_type" collection="array" open="(" separator="," close=")">
+                        #{share_type}
+                    </foreach>
+            ) tb
+    </select>
+
+    <select id="applyCount" parameterType="String" resultType="java.util.LinkedHashMap">
+        SELECT
+            IFNULL(
+                SUM(
+                    CASE MONTH (apply_time)
+                    WHEN 1 THEN
+                        1
+                    ELSE
+                        0
+                    END
+                ),
+                0
+            ) AS jan,
+            IFNULL(
+                SUM(
+                    CASE MONTH (apply_time)
+                    WHEN 2 THEN
+                        1
+                    ELSE
+                        0
+                    END
+                ),
+                0
+            ) AS feb,
+            IFNULL(
+                SUM(
+                    CASE MONTH (apply_time)
+                    WHEN 3 THEN
+                        1
+                    ELSE
+                        0
+                    END
+                ),
+                0
+            ) AS mar,
+            IFNULL(
+                SUM(
+                    CASE MONTH (apply_time)
+                    WHEN 4 THEN
+                        1
+                    ELSE
+                        0
+                    END
+                ),
+                0
+            ) AS apr,
+            IFNULL(
+                SUM(
+                    CASE MONTH (apply_time)
+                    WHEN 5 THEN
+                        1
+                    ELSE
+                        0
+                    END
+                ),
+                0
+            ) AS may,
+            IFNULL(
+                SUM(
+                    CASE MONTH (apply_time)
+                    WHEN 6 THEN
+                        1
+                    ELSE
+                        0
+                    END
+                ),
+                0
+            ) AS jun,
+            IFNULL(
+                SUM(
+                    CASE MONTH (apply_time)
+                    WHEN 7 THEN
+                        1
+                    ELSE
+                        0
+                    END
+                ),
+                0
+            ) AS jul,
+            IFNULL(
+                SUM(
+                    CASE MONTH (apply_time)
+                    WHEN 8 THEN
+                        1
+                    ELSE
+                        0
+                    END
+                ),
+                0
+            ) AS aug,
+            IFNULL(
+                SUM(
+                    CASE MONTH (apply_time)
+                    WHEN 9 THEN
+                        1
+                    ELSE
+                        0
+                    END
+                ),
+                0
+            ) AS sep,
+            IFNULL(
+                SUM(
+                    CASE MONTH (apply_time)
+                    WHEN 10 THEN
+                        1
+                    ELSE
+                        0
+                    END
+                ),
+                0
+            ) AS oct,
+            IFNULL(
+                SUM(
+                    CASE MONTH (apply_time)
+                    WHEN 11 THEN
+                        1
+                    ELSE
+                        0
+                    END
+                ),
+                0
+            ) AS nov,
+            IFNULL(
+                SUM(
+                    CASE MONTH (apply_time)
+                    WHEN 12 THEN
+                        1
+                    ELSE
+                        0
+                    END
+                ),
+                0
+            ) AS decb
+        FROM
+            (
+                SELECT
+                    r.apply_time,
+                    i.share_type
+                FROM
+                    int_record r
+                LEFT JOIN int_detailed d ON r.id = d.record_id
+                LEFT JOIN t_u_interfaceinfo i ON d.int_id = i.id
+                WHERE
+                    r.provide_dept_id = #{provideDeptId}
+                <if test="year != null">
+                    and DATE_FORMAT(apply_time,'%Y') = #{year}
+                </if>
+            ) tb
+    </select>
+
+</mapper>

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

@@ -267,9 +267,15 @@
             subData.push(data);
         }
         if ($.validate.form()) {
-            let sub = {"name":"subData","value":JSON.stringify(subData)};
-            formData.push(sub);
-            $.operate.saveTab(apply_prefix + "/add", formData);
+            let accordion = $("#accordion").html();
+            if(accordion.length == 21){
+                $.modal.alertWarning("请先选择接口!");
+               return false;
+            }else {
+                let sub = {"name":"subData","value":JSON.stringify(subData)};
+                formData.push(sub);
+                $.operate.saveTab(apply_prefix + "/add", formData);
+            }
         }
     }
 

+ 5 - 1
mybusiness/src/main/resources/templates/apply/record/detail.html

@@ -48,8 +48,12 @@
                             </div>
                         </div>
                         <div class="form-group">
+                            <label class="col-sm-2 control-label is-required">接口来源</label>
+                            <div class="col-sm-4">
+                                <input type="input" readonly name="shareType" class="form-control" maxlength="15" th:value="${intRecord.shareType}" required>
+                            </div>
                             <label class="col-sm-2 control-label is-required">接口提供部门</label>
-                            <div class="col-sm-10">
+                            <div class="col-sm-4">
                                 <div class="input-group">
                                     <input name="provideDeptName" readonly th:value="${intRecord.provideDeptName}" id="treeName" type="text" placeholder="请选择归属部门" class="form-control" required>
                                     <input name="provideDeptId" th:value="${intRecord.provideDeptId}" type="hidden" id="treeId"/>

+ 5 - 1
mybusiness/src/main/resources/templates/apply/record/edit.html

@@ -48,8 +48,12 @@
                             </div>
                         </div>
                         <div class="form-group">
+                            <label class="col-sm-2 control-label is-required">接口来源</label>
+                            <div class="col-sm-4">
+                                <input type="input" readonly name="shareType" class="form-control" maxlength="15" th:value="${intRecord.shareType}" required>
+                            </div>
                             <label class="col-sm-2 control-label is-required">接口提供部门</label>
-                            <div class="col-sm-10">
+                            <div class="col-sm-4">
                                 <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"/>

+ 126 - 0
mybusiness/src/main/resources/templates/applyData/approval/approval.html

@@ -0,0 +1,126 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
+<head>
+    <th:block th:include="include :: header('申请记录列表')" />
+</head>
+<body class="gray-bg">
+<div class="container-div">
+    <div class="row">
+        <div class="col-sm-12 search-collapse">
+            <form id="formId">
+                <div class="select-list">
+                    <ul>
+                        <li>
+                            <label>提供部门:</label>
+                            <input type="text" name="provideDeptName" onclick="selectDeptTree()" id="treeName" placeholder="请选择接口提供部门"/>
+                        </li>
+                        <li>
+                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
+                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
+                        </li>
+                    </ul>
+                </div>
+            </form>
+        </div>
+
+        <div class="btn-group-sm" id="toolbar" role="group">
+            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="apply:record:export">
+                <i class="fa fa-download"></i> 导出
+            </a>
+        </div>
+        <div class="col-sm-12 select-table table-striped">
+            <table id="bootstrap-table"></table>
+        </div>
+    </div>
+</div>
+<th:block th:include="include :: footer" />
+<script th:inline="javascript">
+    let editFlag = [[${@permission.hasPermi('apply:record:edit')}]];
+    let removeFlag = [[${@permission.hasPermi('apply:record:remove')}]];
+    let status = [[${@dict.getType('status')}]];
+    let prefix = ctx + "applyData/approval";
+
+    $(function() {
+        let options = {
+            url: prefix + "/list",
+            exportUrl: prefix + "/export",
+            modalName: "申请记录",
+            columns: [{
+                checkbox: true
+            },
+                {
+                    field: 'id',
+                    title: 'null',
+                    visible: false
+                },
+                {
+                    field: 'provideDeptName',
+                    title: '接口提供部门'
+                },
+                {
+                    field: 'applyTime',
+                    title: '申请时间',
+                    sortable: true
+                },
+                {
+                    field: 'duration',
+                    title: '使用时效',
+                    sortable: true
+                },
+                {
+                    field: 'frequency',
+                    title: '调用频次'
+                },
+                {
+                    field: 'status',
+                    title: '当前状态',
+                    sortable: true,
+                    formatter: function (value, item, index) {
+                        return $.table.selectDictLabel(status, item.status);
+                    }
+                },
+                {
+                    title: '操作',
+                    align: 'center',
+                    formatter: function(value, row, index) {
+                        let actions = [];
+                        /**政数局待审批**/
+                        actions.push('<a class="btn btn-primary btn-xs" href="javascript:void(0)" onclick="approval(\'' + row.id + '\')"><i class="fa fa-check"></i>立即审批</a>');
+                        return actions.join('');
+                    }
+                }]
+        };
+        $.table.init(options);
+    });
+
+    /**审批**/
+    function approval(id) {
+        $.modal.openTab("申请审批", prefix + "/approval/"+id);
+    }
+
+    /**选择部门树**/
+    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);
+            $("#treeName").val(body.find('#treeName').val());
+            layer.close(index);
+        }
+    }
+
+</script>
+</body>
+</html>

+ 208 - 0
mybusiness/src/main/resources/templates/applyData/approval/approvalDetail.html

@@ -0,0 +1,208 @@
+<!DOCTYPE html>
+<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 :: 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="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>
+            <!--步骤条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" readonly 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" readonly 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" readonly 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" readonly 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" readonly th:value="${intRecord.provideDeptName}" 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" readonly 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" readonly id="duration" name="duration" placeholder="从 - 至" th:value="${intRecord.duration}" required>
+                                </div>
+                            </div>
+                        </div>
+                    </form>
+                </div>
+            </div>
+            <!--主表字段end-->
+            <!--子表字段start-->
+            <div class="ibox">
+                <div class="ibox-content">
+                    <div class="panel-group" id="accordion">
+                    </div>
+                </div>
+            </div>
+            <!--子表字段end-->
+        </div>
+    </div>
+</div>
+<div class="row">
+    <div class="col-sm-offset-5 col-sm-10">
+        <button type="button" class="btn btn-sm btn-primary" onclick="ok()"><i class="fa fa-check"></i>申请通过</button>&nbsp;
+        <button type="button" class="btn btn-sm btn-danger" onclick="reject()"><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">
+
+    let prefix = ctx + "system";
+    let datas = [[${@dict.getType('share_type')}]];
+    let apply_prefix = ctx + "applyData/record"
+    let deptName = "提供部门";
+    let num = 0;
+    let interfaces = [[${DataDetailedList}]];
+
+    $(function() {
+        /** 回显接口 **/
+        renderInterface(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" readonly 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" readonly 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="/applyData/record/uploadFrameDisabled/#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 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");
+        }
+    }
+
+    /**step步骤条**/
+    let data = {
+        data: ['开始', '政数局审批', deptName+'审批', '完成'],
+        index: 1 //0是第一步(0~3)
+    };
+    let dom = $('#luStep');
+    dom.stepInit(data);
+
+    function ok() {
+        let id = $("input[name='id']").val();
+        $.modal.confirm("确认审批通过吗?", function() {
+            let url = ctx + "applyData/record/updateStatus";
+            $.operate.post(url,{ "id": id, "status": "4" },function(res){
+                $.operate.successTabCallback(res);
+            });
+        });
+    }
+
+    function reject() {
+        let id = $("input[name='id']").val();
+        $.modal.confirm("确认审批驳回吗?", function() {
+            let url = ctx + "applyData/record/rejectDialog/" + id;
+            $.modal.open("请填写驳回原因", url, '700', '540');
+        });
+    }
+
+    function callBack(res){
+        $.operate.successTabCallback(res);
+    }
+
+</script>
+</body>
+</html>

+ 126 - 0
mybusiness/src/main/resources/templates/applyData/examine/examine.html

@@ -0,0 +1,126 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
+<head>
+    <th:block th:include="include :: header('申请记录列表')" />
+</head>
+<body class="gray-bg">
+<div class="container-div">
+    <div class="row">
+        <div class="col-sm-12 search-collapse">
+            <form id="formId">
+                <div class="select-list">
+                    <ul>
+                        <li>
+                            <label>提供部门:</label>
+                            <input type="text" name="provideDeptName" onclick="selectDeptTree()" id="treeName" placeholder="请选择接口提供部门"/>
+                        </li>
+                        <li>
+                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
+                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
+                        </li>
+                    </ul>
+                </div>
+            </form>
+        </div>
+
+        <div class="btn-group-sm" id="toolbar" role="group">
+            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="apply:record:export">
+                <i class="fa fa-download"></i> 导出
+            </a>
+        </div>
+        <div class="col-sm-12 select-table table-striped">
+            <table id="bootstrap-table"></table>
+        </div>
+    </div>
+</div>
+<th:block th:include="include :: footer" />
+<script th:inline="javascript">
+    let editFlag = [[${@permission.hasPermi('apply:record:edit')}]];
+    let removeFlag = [[${@permission.hasPermi('apply:record:remove')}]];
+    let status = [[${@dict.getType('status')}]];
+    let prefix = ctx + "applyData/examine";
+
+    $(function() {
+        let options = {
+            url: prefix + "/list",
+            exportUrl: prefix + "/export",
+            modalName: "申请记录",
+            columns: [{
+                checkbox: true
+            },
+                {
+                    field: 'id',
+                    title: 'null',
+                    visible: false
+                },
+                {
+                    field: 'provideDeptName',
+                    title: '接口提供部门'
+                },
+                {
+                    field: 'applyTime',
+                    title: '申请时间',
+                    sortable: true
+                },
+                {
+                    field: 'duration',
+                    title: '使用时效',
+                    sortable: true
+                },
+                {
+                    field: 'frequency',
+                    title: '调用频次'
+                },
+                {
+                    field: 'status',
+                    title: '当前状态',
+                    sortable: true,
+                    formatter: function (value, item, index) {
+                        return $.table.selectDictLabel(status, item.status);
+                    }
+                },
+                {
+                    title: '操作',
+                    align: 'center',
+                    formatter: function(value, row, index) {
+                        let actions = [];
+                        /**政数局待审批**/
+                        actions.push('<a class="btn btn-primary btn-xs" href="javascript:void(0)" onclick="approval(\'' + row.id + '\')"><i class="fa fa-check"></i>立即审批</a>');
+                        return actions.join('');
+                    }
+                }]
+        };
+        $.table.init(options);
+    });
+
+    /**审批**/
+    function approval(id) {
+        $.modal.openTab("申请审批", prefix + "/examine/"+id);
+    }
+
+    /**选择部门树**/
+    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);
+            $("#treeName").val(body.find('#treeName').val());
+            layer.close(index);
+        }
+    }
+
+</script>
+</body>
+</html>

+ 208 - 0
mybusiness/src/main/resources/templates/applyData/examine/examineDetail.html

@@ -0,0 +1,208 @@
+<!DOCTYPE html>
+<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 :: 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="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>
+            <!--步骤条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" readonly 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" readonly 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" readonly 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" readonly 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" readonly th:value="${intRecord.provideDeptName}" 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" readonly 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" readonly id="duration" name="duration" placeholder="从 - 至" th:value="${intRecord.duration}" required>
+                                </div>
+                            </div>
+                        </div>
+                    </form>
+                </div>
+            </div>
+            <!--主表字段end-->
+            <!--子表字段start-->
+            <div class="ibox">
+                <div class="ibox-content">
+                    <div class="panel-group" id="accordion">
+                    </div>
+                </div>
+            </div>
+            <!--子表字段end-->
+        </div>
+    </div>
+</div>
+<div class="row">
+    <div class="col-sm-offset-5 col-sm-10">
+        <button type="button" class="btn btn-sm btn-primary" onclick="ok()"><i class="fa fa-check"></i>申请通过</button>&nbsp;
+        <button type="button" class="btn btn-sm btn-danger" onclick="reject()"><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">
+
+    let prefix = ctx + "system";
+    let datas = [[${@dict.getType('share_type')}]];
+    let apply_prefix = ctx + "applyData/record"
+    let deptName = "提供部门";
+    let num = 0;
+    let interfaces = [[${DataDetailedList}]];
+
+    $(function() {
+        /** 回显接口 **/
+        renderInterface(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" readonly 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" readonly 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="/applyData/record/uploadFrameDisabled/#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 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");
+        }
+    }
+
+    /**step步骤条**/
+    let data = {
+        data: ['开始', '政数局审批', deptName+'审批', '完成'],
+        index: 2 //0是第一步(0~3)
+    };
+    let dom = $('#luStep');
+    dom.stepInit(data);
+
+    function ok() {
+        let id = $("input[name='id']").val();
+        $.modal.confirm("确认审批通过吗?", function() {
+            let url = ctx + "applyData/record/updateStatus";
+            $.operate.post(url,{ "id": id, "status": "2" },function(res){
+                $.operate.successTabCallback(res);
+            });
+        });
+    }
+
+    function reject() {
+        let id = $("input[name='id']").val();
+        $.modal.confirm("确认审批驳回吗?", function() {
+            let url = ctx + "applyData/record/rejectDialog/" + id;
+            $.modal.open("请填写驳回原因", url, '700', '540');
+        });
+    }
+
+    function callBack(res){
+        $.operate.successTabCallback(res);
+    }
+
+</script>
+</body>
+</html>

+ 285 - 0
mybusiness/src/main/resources/templates/applyData/record/add.html

@@ -0,0 +1,285 @@
+<!DOCTYPE html>
+<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 :: 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="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>
+            <!--步骤条end-->
+            <!--主表字段start-->
+            <div class="ibox">
+                <div class="ibox-content">
+                    <form method="get" class="form-horizontal" id="form-record-add">
+                        <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="${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="${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" 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="从 - 至" required>
+                                </div>
+                            </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" required>-->
+                            <!--</div>-->
+                        </div>
+                        <div class="form-group">
+                            <label class="col-sm-2 control-label is-required">接口来源</label>
+                            <div class="col-sm-4">
+                                <select class='form-control' id="shareType" name='shareType' onchange="changeShareType()">
+                                    <option value="share_type_1">市共享</option>
+                                    <option value="share_type_4">省共享</option>
+                                </select>
+                            </div>
+                            <label class="col-sm-2 control-label is-required">接口提供部门</label>
+                            <div class="col-sm-4">
+                                <div class="input-group">
+                                    <input name="provideDeptName" onclick="selectDeptTree()" id="treeName" type="text" placeholder="请选择归属部门" class="form-control" required>
+                                    <input name="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" 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="从 - 至" 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>
+</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">
+    function changeShareType(){
+        $("#treeId").val("");
+        $("#treeName").val("");
+        // let shareType = $("#shareType").val();
+        // alert(shareType)
+    }
+
+
+    let prefix = ctx + "system";
+    let datas = [[${@dict.getType('share_type')}]];
+    let apply_prefix = ctx + "applyData/record"
+    let deptName = "提供部门";
+    let num = 0;
+
+    $(function() {
+        /** 范围选择日期框 **/
+        layui.use('laydate', function(){
+            let laydate = layui.laydate;
+            laydate.render({
+                elem: '#duration',
+                range: true
+            });
+        });
+    });
+
+    /**手风琴右侧上下箭头样式变换控制**/
+    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 selectInterface() {
+        let deptId = $("#treeId").val();
+        if(deptId == "" || deptId == null){
+            $.modal.alertError('请先选择接口提供部门');
+        }else{
+            let url = prefix + '/interfaceinfo/selectInterfaceByDeptId/' + deptId + '/share_type_1/share_type_3';
+            $.modal.open("请选择接口", url, ($(window).width() - 50),($(window).height() - 50), 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){
+            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="/applyData/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() {
+        let shareType = $("#shareType").val();
+        var treeId = $("#treeId").val();
+        var deptId = $.common.isEmpty(treeId) ? "100" : $("#treeId").val();
+        // var url = ctx + "system/dept/selectDeptTree/" + deptId;
+        var url = ctx + "system/dept/selectDeptTreeByShareType/" + deptId + "/" + shareType;
+        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)) {
+        if (true) {//不能选择根节点
+            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: 0 //0是第一步(0~3)
+    };
+    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>

+ 275 - 0
mybusiness/src/main/resources/templates/applyData/record/detail.html

@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<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 :: 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="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>
+            <!--步骤条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="${DataRecord.id}">
+                        <div class="form-group">
+                            <label class="col-sm-2 control-label is-required">申请部门名称</label>
+                            <div class="col-sm-4">
+                                <input type="text" readonly class="form-control" th:value="${DataRecord.applyDeptName}">
+                            </div>
+                            <label class="col-sm-2 control-label is-required">申请人</label>
+                            <div class="col-sm-4">
+                                <input type="text" readonly class="form-control" th:value="${DataRecord.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" readonly name="tel" class="form-control" maxlength="11" th:value="${DataRecord.tel}" 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" readonly id="duration" name="duration" placeholder="从 - 至" th:value="${DataRecord.duration}" required>
+                                </div>
+                            </div>
+                            <!--<label class="col-sm-2 control-label is-required">调用者IP</label>-->
+                            <!--<div class="col-sm-4">-->
+                                <!--<input type="input" readonly name="ip" class="form-control" maxlength="15" th:value="${DataRecord.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" readonly th:value="${DataRecord.provideDeptName}" id="treeName" type="text" placeholder="请选择归属部门" class="form-control" required>
+                                    <input name="provideDeptId" th:value="${DataRecord.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" readonly name="frequency" maxlength="10" th:value="${DataRecord.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" readonly id="duration" name="duration" placeholder="从 - 至" th:value="${DataRecord.duration}" required>-->
+                                <!--</div>-->
+                            <!--</div>-->
+                        <!--</div>-->
+
+                        <div class="form-group" style="display: none;" id="rejectDiv">
+                            <!--政数局驳回部分-->
+                            <label class="col-sm-2 control-label is-required" style="display: none;" name="approval">驳回原因</label>
+                            <div class="col-sm-4" style="display: none;" name="approval">
+                                <textarea class="form-control" readonly name="approvalContent">[[${DataRecord.approvalContent}]]</textarea>
+                            </div>
+                            <!--政数局驳回部分-->
+                            <!--接口提供部门驳回部分-->
+                            <label class="col-sm-2 control-label is-required" style="display: none;" name="examine">驳回原因</label>
+                            <div class="col-sm-4" style="display: none;" name="examine">
+                                <textarea class="form-control" readonly name="examineContent">[[${DataRecord.examineContent}]]</textarea>
+                            </div>
+                            <!--接口提供部门驳回部分-->
+                            <!--通用部分-->
+                            <label class="col-sm-2 control-label is-required">驳回依据</label>
+                            <div class="col-sm-4">
+                                <a class="btn btn-block btn-outline btn-primary" id="file">点此查看附件</a>
+                            </div>
+                            <!--通用部分-->
+                        </div>
+                    </form>
+                </div>
+            </div>
+            <!--主表字段end-->
+            <!--子表字段start-->
+            <div class="ibox">
+                <div class="ibox-content">
+                    <div class="panel-group" id="accordion">
+                    </div>
+                </div>
+            </div>
+            <!--子表字段end-->
+        </div>
+    </div>
+</div>
+<div class="row">
+    <div class="col-sm-offset-5 col-sm-10">
+        <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">
+
+    let prefix = ctx + "system";
+    let datas = [[${@dict.getType('share_type')}]];
+    let apply_prefix = ctx + "applyData/record"
+    let deptName = "提供部门";
+    let num = 0;
+    let interfaces = [[${DataDetailedList}]];
+    let status = [[${DataRecord.status}]];
+    let index = 0;
+    let approval_file = [[${DataRecord.approvalFile}]];
+    let examine_file = [[${DataRecord.examineFile}]];
+
+    $(function() {
+        /** 回显接口 **/
+        renderInterface(interfaces);
+
+        /**step步骤条**/
+        switch(status){
+            case "3" : index = 1; break;//政数局待审批
+            case "5" :
+                index = 1;
+                if(approval_file == null){
+                    $("#file").text("未查询到附件");
+                }
+                $("#file").attr("href",approval_file);
+                $("#rejectDiv").show();
+                $("label[name='approval']").show();
+                $("div[name='approval']").show();
+                break;//政数局驳回
+            case "4" : index = 2; break;//提供部门待审批
+            case "6" :
+                index = 2;
+                if(examine_file == null){
+                    $("#file").text("未查询到附件");
+                }
+                $("#file").attr("href",examine_file);
+                $("#rejectDiv").show();
+                $("label[name='examine']").show();
+                $("div[name='examine']").show();
+                break;//申请驳回
+            case "2" :
+                index = 3;
+                $("div[name='secretKey']").show();
+                break;//	审核通过
+        }
+
+        let data = {
+            data: ['开始', '政数局审批', deptName+'审批', '完成'],
+            index: index //0是第一步(0~3)
+        };
+        let dom = $('#luStep');
+        dom.stepInit(data);
+    });
+
+    /** 回显接口 **/
+    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>' +
+            '           <a class="btn-outline btn-success" data="#interfaceAddress#,#code#,#secretKey#" target="#id#" onclick="copy(this)" style="margin-left: 30px;">复制接口信息</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-4">' +
+            '						<input type="text" readonly class="form-control" disabled value="#interfaceAddress#">' +
+            '					</div>' +
+            '                   <label class="col-sm-2 control-label">接口编码</label>' +
+            '					<div class="col-sm-4">' +
+            '						<input type="text" readonly class="form-control" disabled value="#code#">' +
+            '					</div>' +
+            '				</div>' +
+            '				<div class="form-group" style="display: none" name="secretKey">' +
+            '					<label class="col-sm-2 control-label">秘钥</label>' +
+            '					<div class="col-sm-10">' +
+            '						<input type="text" readonly class="form-control" disabled value="#secretKey#">' +
+            '					</div>' +
+            '				</div>' +
+            '				<div class="form-group">' +
+            '					<label class="col-sm-2 control-label">接口用途</label>' +
+            '					<div class="col-sm-10">' +
+            '						<input type="text" readonly 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="/applyData/record/uploadFrameDisabled/#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(/#secretKey#/g,data[i].secretKey);
+            docm = docm.replace(/#code#/g,data[i].code);
+            docm = docm.replace(/#formId#/g,"sub-form"+num);
+            docm = docm.replace(/#file_upload#/g,"file_upload"+num);
+            $("#accordion").append(docm);
+            num += 1;
+        }
+    }
+
+    /**手风琴右侧上下箭头样式变换控制**/
+    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 copy(dom){
+        let data = $(dom).attr("data");
+        let arr = data.split(",");
+        data = "接口地址:" + arr[0] + "  接口编码:" + arr[1] + "  秘钥:" + arr[2];
+        const type = 'input';
+        const input = document.createElement(type);
+        input.setAttribute('readonly', 'readonly'); // 设置为只读, 防止在 ios 下拉起键盘
+        input.value = data;
+        document.body.appendChild(input);
+        input.setSelectionRange(0, 9999); // 防止 ios 下没有全选内容而无法复制
+        input.select();
+        document.execCommand('copy');
+        document.body.removeChild(input);
+        $.modal.msgSuccess("接口信息复制成功");
+    }
+
+</script>
+</body>
+</html>

+ 316 - 0
mybusiness/src/main/resources/templates/applyData/record/edit.html

@@ -0,0 +1,316 @@
+<!DOCTYPE html>
+<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 :: 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="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>
+            <!--步骤条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="${DataRecord.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="${DataRecord.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="${DataRecord.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="${DataRecord.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="${DataRecord.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="${DataRecord.provideDeptName}" onclick="selectDeptTree()" id="treeName" type="text" placeholder="请选择归属部门" class="form-control" required>
+                                    <input name="provideDeptId" th:value="${DataRecord.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="${DataRecord.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="${DataRecord.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>
+</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">
+
+    let prefix = ctx + "system";
+    let datas = [[${@dict.getType('share_type')}]];
+    let apply_prefix = ctx + "applyData/record"
+    let deptName = "提供部门";
+    let num = 0;
+    let interfaces = [[${DataDetailedList}]];
+
+    $(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="/applyData/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 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 selectInterface() {
+        let deptId = $("#treeId").val();
+        if(deptId == "" || deptId == null){
+            $.modal.alertError('请先选择接口提供部门');
+        }else{
+            let url = prefix + '/interfaceinfo/selectInterfaceByDeptId/' + deptId + '/share_type_1/share_type_3';
+            $.modal.open("请选择接口", url, ($(window).width() - 50),($(window).height() - 50), 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="/applyData/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 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: 0 //0是第一步(0~3)
+    };
+    let dom = $('#luStep');
+    dom.stepInit(data);
+
+
+    /**表单提交方法**/
+    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>
+</body>
+</html>

+ 54 - 0
mybusiness/src/main/resources/templates/applyData/record/provideDeptTree.html

@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
+<head>
+	<th:block th:include="include :: header('部门树选择')" />
+	<th:block th:include="include :: ztree-css" />
+</head>
+<style>
+	body{height:auto;font-family: "Microsoft YaHei";}
+	button{font-family: "SimSun","Helvetica Neue",Helvetica,Arial;}
+</style>
+<body class="hold-transition box box-main">
+	<input id="treeId"   name="treeId"    type="hidden" th:value="${dept.deptId}"/>
+	<input id="treeName" name="treeName"  type="hidden" th:value="${dept.deptName}"/>
+	<div class="wrapper"><div class="treeShowHideButton" onclick="$.tree.toggleSearch();">
+		<label id="btnShow" title="显示搜索" style="display:none;">︾</label>
+		<label id="btnHide" title="隐藏搜索">︽</label>
+	</div>
+	<div class="treeSearchInput" id="search">
+		<label for="keyword">关键字:</label><input type="text" class="empty" id="keyword" maxlength="50">
+		<button class="btn" id="btn" onclick="$.tree.searchNode()"> 搜索 </button>
+	</div>
+	<div class="treeExpandCollapse">
+		<a href="#" onclick="$.tree.expand()">展开</a> /
+		<a href="#" onclick="$.tree.collapse()">折叠</a>
+	</div>
+	<div id="tree" class="ztree treeselect"></div>
+	</div>
+	<th:block th:include="include :: footer" />
+	<th:block th:include="include :: ztree-js" />
+	<script th:inline="javascript">
+	    var prefix = ctx + "system/dept"
+	    var deptId = [[${deptId}]];
+	    var excludeId = [[${excludeId}]];
+	    var shareType = [[${shareType}]];
+		$(function() {
+			// var url = $.common.isEmpty(excludeId) ? prefix + "/treeData" + "/" + shareType: prefix + "/treeData/" + excludeId;
+			var url = prefix + "/provideDeptTreeData" + "/" + shareType;
+			var options = {
+		        url: url,
+		        expandLevel: 2,
+		        onClick : zOnClick
+		    };
+			$.tree.init(options);
+		});
+		
+		function zOnClick(event, treeId, treeNode) {
+		    var treeId = treeNode.id;
+		    var treeName = treeNode.name;
+		    $("#treeId").val(treeId);
+		    $("#treeName").val(treeName);
+		}
+	</script>
+</body>
+</html>

+ 159 - 0
mybusiness/src/main/resources/templates/applyData/record/record.html

@@ -0,0 +1,159 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
+<head>
+    <th:block th:include="include :: header('申请记录列表')" />
+</head>
+<body class="gray-bg">
+     <div class="container-div">
+        <div class="row">
+            <div class="col-sm-12 search-collapse">
+                <form id="formId">
+                    <div class="select-list">
+                        <ul>
+                            <li>
+                                <label>提供部门:</label>
+                                <input type="text" name="provideDeptName" onclick="selectDeptTree()" id="treeName" placeholder="请选择接口提供部门"/>
+                            </li>
+                            <li>
+                                <label>当前状态:</label>
+                                <select name="status" th:with="type=${@dict.getType('status')}">
+                                    <option value="">所有</option>
+                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
+                                </select>
+                            </li>
+                            <li>
+                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
+                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
+                            </li>
+                        </ul>
+                    </div>
+                </form>
+            </div>
+
+            <div class="btn-group-sm" id="toolbar" role="group">
+                <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.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">
+                    <i class="fa fa-remove"></i> 删除
+                </a>
+                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="apply:record:export">
+                    <i class="fa fa-download"></i> 导出
+                </a>
+            </div>
+            <div class="col-sm-12 select-table table-striped">
+                <table id="bootstrap-table"></table>
+            </div>
+        </div>
+    </div>
+    <th:block th:include="include :: footer" />
+    <script th:inline="javascript">
+        let editFlag = [[${@permission.hasPermi('apply:record:edit')}]];
+        let removeFlag = [[${@permission.hasPermi('apply:record:remove')}]];
+        let status = [[${@dict.getType('status')}]];
+        let prefix = ctx + "applyData/record";
+
+        $(function() {
+            let options = {
+                url: prefix + "/list",
+                createUrl: prefix + "/add",
+                updateUrl: prefix + "/edit/{id}",
+                removeUrl: prefix + "/remove",
+                exportUrl: prefix + "/export",
+                modalName: "申请记录",
+                columns: [{
+                    checkbox: true
+                },
+                {
+                    field: 'id',
+                    title: 'null',
+                    visible: false
+                },
+                {
+                    field: 'provideDeptName',
+                    title: '接口提供部门'
+                },
+                {
+                    field: 'applyTime',
+                    title: '申请时间',
+                    sortable: true
+                },
+                {
+                    field: 'duration',
+                    title: '使用时效',
+                    sortable: true
+                },
+                {
+                    field: 'frequency',
+                    title: '调用频次'
+                },
+                {
+                    field: 'status',
+                    title: '当前状态',
+                    sortable: true,
+                    formatter: function (value, item, index) {
+                        return $.table.selectDictLabel(status, item.status);
+                    }
+                },
+                {
+                    title: '操作',
+                    align: 'center',
+                    formatter: function(value, row, index) {
+                        let actions = [];
+                        /**新建状态**/
+                        if(row.status == 0){
+                            actions.push('<a class="btn btn-primary btn-xs" href="javascript:void(0)" onclick="report(\'' + row.id + '\')"><i class="fa fa-check"></i>提交审核</a> ');
+                            actions.push('<a class="btn btn-success btn-xs" 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" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
+                        }else{
+                            actions.push('<a class="btn btn-info btn-xs" href="javascript:void(0)" onclick="detail(\'' + row.id + '\')"><i class="fa fa-search"></i>查看详情</a>');
+                        }
+                        return actions.join('');
+                    }
+                }]
+            };
+            $.table.init(options);
+        });
+
+        /**提交审核**/
+        function report(id) {
+            $.modal.confirm("确认要提交审核吗?", function() {
+                let url = ctx + "applyData/updateStatus";
+                $.operate.post(url,{ "id": id, "status": "3" });
+            });
+        }
+
+        /**查看详情**/
+        function detail(id) {
+            $.modal.openTab("查看详情", prefix + "/detail/"+id);
+        }
+
+        /**选择部门树**/
+        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);
+                $("#treeName").val(body.find('#treeName').val());
+                layer.close(index);
+            }
+        }
+
+    </script>
+</body>
+</html>