dev_xds
姜玉琦 2023-09-23 20:13:02 +08:00
commit 89fc3a7891
11 changed files with 921 additions and 2 deletions

View File

@ -115,7 +115,7 @@
<if test="deployId !=null and deployId!=''">and businessDeptId=#{deployId}</if>
<if test="businessKey !=null and businessKey!=''">and businessKey=#{businessKey}</if>
GROUP BY category) b ON a.dict_value=b.category
LEFT JOIN (SELECT category,COUNT(1) cnt FROM vw_flow_all WHERE finishTime IS NULL
LEFT JOIN (SELECT category,COUNT(1) cnt FROM vw_flow_all WHERE finishTime IS NULL AND taskName!='提交申请'
<if test="deployId !=null and deployId!=''">and businessDeptId=#{deployId}</if>
<if test="businessKey !=null and businessKey!=''">and businessKey=#{businessKey}</if>
GROUP BY category) c ON a.dict_value=c.category

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 MiB

After

Width:  |  Height:  |  Size: 1.8 MiB

View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询期刊列表
export function listPeriodical(query) {
return request({
url: '/base/periodical/list',
method: 'get',
params: query
})
}
// 查询期刊详细
export function getPeriodical(id) {
return request({
url: '/base/periodical/' + id,
method: 'get'
})
}
// 新增期刊
export function addPeriodical(data) {
return request({
url: '/base/periodical',
method: 'post',
data: data
})
}
// 修改期刊
export function updatePeriodical(data) {
return request({
url: '/base/periodical',
method: 'put',
data: data
})
}
// 删除期刊
export function delPeriodical(id) {
return request({
url: '/base/periodical/' + id,
method: 'delete'
})
}

View File

@ -0,0 +1,324 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="期刊名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入期刊名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="期刊主图" prop="imageUrl">
<el-input
v-model="queryParams.imageUrl"
placeholder="请输入期刊主图"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="期刊文件" prop="fileUrl">
<el-input
v-model="queryParams.fileUrl"
placeholder="请输入期刊文件"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="顺序" prop="ord">
<el-input
v-model="queryParams.ord"
placeholder="请输入顺序"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="状态" prop="state">
<el-input
v-model="queryParams.state"
placeholder="请输入状态"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="" prop="isDel">
<el-input
v-model="queryParams.isDel"
placeholder="请输入"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['base:periodical:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['base:periodical:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['base:periodical:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['base:periodical:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="periodicalList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="" align="center" prop="id" />
<el-table-column label="期刊名称" align="center" prop="name" />
<el-table-column label="期刊主图" align="center" prop="imageUrl" />
<el-table-column label="期刊文件" align="center" prop="fileUrl" />
<el-table-column label="顺序" align="center" prop="ord" />
<el-table-column label="状态" align="center" prop="state" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="" align="center" prop="isDel" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['base:periodical:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['base:periodical:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改期刊对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="期刊名称" prop="name">
<el-input v-model="form.name" placeholder="请输入期刊名称" />
</el-form-item>
<el-form-item label="期刊主图" prop="imageUrl">
<el-input v-model="form.imageUrl" placeholder="请输入期刊主图" />
</el-form-item>
<el-form-item label="期刊文件" prop="fileUrl">
<el-input v-model="form.fileUrl" placeholder="请输入期刊文件" />
</el-form-item>
<el-form-item label="顺序" prop="ord">
<el-input v-model="form.ord" placeholder="请输入顺序" />
</el-form-item>
<el-form-item label="状态" prop="state">
<el-input v-model="form.state" placeholder="请输入状态" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
<el-form-item label="" prop="isDel">
<el-input v-model="form.isDel" placeholder="请输入" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listPeriodical, getPeriodical, delPeriodical, addPeriodical, updatePeriodical } from "@/api/base/periodical";
export default {
name: "Periodical",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
periodicalList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
name: null,
imageUrl: null,
fileUrl: null,
ord: null,
state: null,
isDel: null,
},
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询期刊列表 */
getList() {
this.loading = true;
listPeriodical(this.queryParams).then(response => {
this.periodicalList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
name: null,
imageUrl: null,
fileUrl: null,
ord: null,
state: null,
remark: null,
isDel: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加期刊";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getPeriodical(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改期刊";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updatePeriodical(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addPeriodical(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除期刊编号为"' + ids + '"的数据项?').then(function() {
return delPeriodical(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('base/periodical/export', {
...this.queryParams
}, `periodical_${new Date().getTime()}.xlsx`)
}
}
};
</script>

View File

@ -169,7 +169,7 @@ export default {
<style rel="stylesheet/scss" lang="scss">
.login-bg {
background-image: url("/images/bg1.png");
background-image: url("/images/bg1.png?v=20230923");
position: absolute;
width: 100%;
height: 100%;

View File

@ -0,0 +1,104 @@
package com.yanzhu.jh.base.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.yanzhu.jh.base.domain.BasePeriodical;
import com.yanzhu.jh.base.service.IBasePeriodicalService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2023-09-23
*/
@RestController
@RequestMapping("/base/periodical")
public class BasePeriodicalController extends BaseController
{
@Autowired
private IBasePeriodicalService basePeriodicalService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('base:periodical:list')")
@GetMapping("/list")
public TableDataInfo list(BasePeriodical basePeriodical)
{
startPage();
List<BasePeriodical> list = basePeriodicalService.selectBasePeriodicalList(basePeriodical);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('base:periodical:export')")
@Log(title = "期刊", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, BasePeriodical basePeriodical)
{
List<BasePeriodical> list = basePeriodicalService.selectBasePeriodicalList(basePeriodical);
ExcelUtil<BasePeriodical> util = new ExcelUtil<BasePeriodical>(BasePeriodical.class);
util.exportExcel(response, list, "期刊数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('base:periodical:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(basePeriodicalService.selectBasePeriodicalById(id));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('base:periodical:add')")
@Log(title = "期刊", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody BasePeriodical basePeriodical)
{
return toAjax(basePeriodicalService.insertBasePeriodical(basePeriodical));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('base:periodical:edit')")
@Log(title = "期刊", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody BasePeriodical basePeriodical)
{
return toAjax(basePeriodicalService.updateBasePeriodical(basePeriodical));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('base:periodical:remove')")
@Log(title = "期刊", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(basePeriodicalService.deleteBasePeriodicalByIds(ids));
}
}

View File

@ -0,0 +1,126 @@
package com.yanzhu.jh.base.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* base_periodical
*
* @author ruoyi
* @date 2023-09-23
*/
public class BasePeriodical extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** */
private Long id;
/** 期刊名称 */
@Excel(name = "期刊名称")
private String name;
/** 期刊主图 */
@Excel(name = "期刊主图")
private String imageUrl;
/** 期刊文件 */
@Excel(name = "期刊文件")
private String fileUrl;
/** 顺序 */
@Excel(name = "顺序")
private Long ord;
/** 状态 */
@Excel(name = "状态")
private Long state;
/** */
@Excel(name = "")
private Long isDel;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
public void setImageUrl(String imageUrl)
{
this.imageUrl = imageUrl;
}
public String getImageUrl()
{
return imageUrl;
}
public void setFileUrl(String fileUrl)
{
this.fileUrl = fileUrl;
}
public String getFileUrl()
{
return fileUrl;
}
public void setOrd(Long ord)
{
this.ord = ord;
}
public Long getOrd()
{
return ord;
}
public void setState(Long state)
{
this.state = state;
}
public Long getState()
{
return state;
}
public void setIsDel(Long isDel)
{
this.isDel = isDel;
}
public Long getIsDel()
{
return isDel;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("name", getName())
.append("imageUrl", getImageUrl())
.append("fileUrl", getFileUrl())
.append("ord", getOrd())
.append("state", getState())
.append("remark", getRemark())
.append("isDel", getIsDel())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

View File

@ -0,0 +1,61 @@
package com.yanzhu.jh.base.mapper;
import java.util.List;
import com.yanzhu.jh.base.domain.BasePeriodical;
/**
* Mapper
*
* @author ruoyi
* @date 2023-09-23
*/
public interface BasePeriodicalMapper
{
/**
*
*
* @param id
* @return
*/
public BasePeriodical selectBasePeriodicalById(Long id);
/**
*
*
* @param basePeriodical
* @return
*/
public List<BasePeriodical> selectBasePeriodicalList(BasePeriodical basePeriodical);
/**
*
*
* @param basePeriodical
* @return
*/
public int insertBasePeriodical(BasePeriodical basePeriodical);
/**
*
*
* @param basePeriodical
* @return
*/
public int updateBasePeriodical(BasePeriodical basePeriodical);
/**
*
*
* @param id
* @return
*/
public int deleteBasePeriodicalById(Long id);
/**
*
*
* @param ids
* @return
*/
public int deleteBasePeriodicalByIds(Long[] ids);
}

View File

@ -0,0 +1,61 @@
package com.yanzhu.jh.base.service;
import java.util.List;
import com.yanzhu.jh.base.domain.BasePeriodical;
/**
* Service
*
* @author ruoyi
* @date 2023-09-23
*/
public interface IBasePeriodicalService
{
/**
*
*
* @param id
* @return
*/
public BasePeriodical selectBasePeriodicalById(Long id);
/**
*
*
* @param basePeriodical
* @return
*/
public List<BasePeriodical> selectBasePeriodicalList(BasePeriodical basePeriodical);
/**
*
*
* @param basePeriodical
* @return
*/
public int insertBasePeriodical(BasePeriodical basePeriodical);
/**
*
*
* @param basePeriodical
* @return
*/
public int updateBasePeriodical(BasePeriodical basePeriodical);
/**
*
*
* @param ids
* @return
*/
public int deleteBasePeriodicalByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
public int deleteBasePeriodicalById(Long id);
}

View File

@ -0,0 +1,98 @@
package com.yanzhu.jh.base.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yanzhu.jh.base.mapper.BasePeriodicalMapper;
import com.yanzhu.jh.base.domain.BasePeriodical;
import com.yanzhu.jh.base.service.IBasePeriodicalService;
import com.ruoyi.common.utils.SecurityUtils;
/**
* Service
*
* @author ruoyi
* @date 2023-09-23
*/
@Service
public class BasePeriodicalServiceImpl implements IBasePeriodicalService
{
@Autowired
private BasePeriodicalMapper basePeriodicalMapper;
/**
*
*
* @param id
* @return
*/
@Override
public BasePeriodical selectBasePeriodicalById(Long id)
{
return basePeriodicalMapper.selectBasePeriodicalById(id);
}
/**
*
*
* @param basePeriodical
* @return
*/
@Override
public List<BasePeriodical> selectBasePeriodicalList(BasePeriodical basePeriodical)
{
return basePeriodicalMapper.selectBasePeriodicalList(basePeriodical);
}
/**
*
*
* @param basePeriodical
* @return
*/
@Override
public int insertBasePeriodical(BasePeriodical basePeriodical)
{
basePeriodical.setCreateBy(SecurityUtils.getUsername());
basePeriodical.setCreateTime(DateUtils.getNowDate());
return basePeriodicalMapper.insertBasePeriodical(basePeriodical);
}
/**
*
*
* @param basePeriodical
* @return
*/
@Override
public int updateBasePeriodical(BasePeriodical basePeriodical)
{
basePeriodical.setUpdateBy(SecurityUtils.getUsername());
basePeriodical.setUpdateTime(DateUtils.getNowDate());
return basePeriodicalMapper.updateBasePeriodical(basePeriodical);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteBasePeriodicalByIds(Long[] ids)
{
return basePeriodicalMapper.deleteBasePeriodicalByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteBasePeriodicalById(Long id)
{
return basePeriodicalMapper.deleteBasePeriodicalById(id);
}
}

View File

@ -0,0 +1,101 @@
<?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.yanzhu.jh.base.mapper.BasePeriodicalMapper">
<resultMap type="BasePeriodical" id="BasePeriodicalResult">
<result property="id" column="id" />
<result property="name" column="name" />
<result property="imageUrl" column="image_url" />
<result property="fileUrl" column="file_url" />
<result property="ord" column="ord" />
<result property="state" column="state" />
<result property="remark" column="remark" />
<result property="isDel" column="is_del" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectBasePeriodicalVo">
select id, name, image_url, file_url, ord, state, remark, is_del, create_by, create_time, update_by, update_time from base_periodical
</sql>
<select id="selectBasePeriodicalList" parameterType="BasePeriodical" resultMap="BasePeriodicalResult">
<include refid="selectBasePeriodicalVo"/>
<where>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="imageUrl != null and imageUrl != ''"> and image_url = #{imageUrl}</if>
<if test="fileUrl != null and fileUrl != ''"> and file_url = #{fileUrl}</if>
<if test="ord != null "> and ord = #{ord}</if>
<if test="state != null "> and state = #{state}</if>
<if test="isDel != null "> and is_del = #{isDel}</if>
</where>
</select>
<select id="selectBasePeriodicalById" parameterType="Long" resultMap="BasePeriodicalResult">
<include refid="selectBasePeriodicalVo"/>
where id = #{id}
</select>
<insert id="insertBasePeriodical" parameterType="BasePeriodical" useGeneratedKeys="true" keyProperty="id">
insert into base_periodical
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null">name,</if>
<if test="imageUrl != null">image_url,</if>
<if test="fileUrl != null">file_url,</if>
<if test="ord != null">ord,</if>
<if test="state != null">state,</if>
<if test="remark != null">remark,</if>
<if test="isDel != null">is_del,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null">#{name},</if>
<if test="imageUrl != null">#{imageUrl},</if>
<if test="fileUrl != null">#{fileUrl},</if>
<if test="ord != null">#{ord},</if>
<if test="state != null">#{state},</if>
<if test="remark != null">#{remark},</if>
<if test="isDel != null">#{isDel},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateBasePeriodical" parameterType="BasePeriodical">
update base_periodical
<trim prefix="SET" suffixOverrides=",">
<if test="name != null">name = #{name},</if>
<if test="imageUrl != null">image_url = #{imageUrl},</if>
<if test="fileUrl != null">file_url = #{fileUrl},</if>
<if test="ord != null">ord = #{ord},</if>
<if test="state != null">state = #{state},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="isDel != null">is_del = #{isDel},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteBasePeriodicalById" parameterType="Long">
delete from base_periodical where id = #{id}
</delete>
<delete id="deleteBasePeriodicalByIds" parameterType="String">
delete from base_periodical where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>