Merge remote-tracking branch 'origin/feature-20240104' into feature-20240104

master
382696293@qq.com 2 years ago
commit b2ae61316e

@ -0,0 +1,67 @@
package com.flossom.common.core.domain.entity;
import com.flossom.common.core.annotation.Excel;
import com.flossom.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* activity_channel_info
*
* @author flossom
* @date 2023-12-20
*/
public class ActivityChannelInfo extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 渠道ID */
private Long id;
/** 渠道类型 */
@Excel(name = "渠道类型")
private Integer channelType;
/** 渠道名称 */
@Excel(name = "渠道名称")
private String channelName;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setChannelType(Integer channelType)
{
this.channelType = channelType;
}
public Integer getChannelType()
{
return channelType;
}
public void setChannelName(String channelName)
{
this.channelName = channelName;
}
public String getChannelName()
{
return channelName;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("channelType", getChannelType())
.append("channelName", getChannelName())
.append("createTime", getCreateTime())
.append("createBy", getCreateBy())
.toString();
}
}

@ -0,0 +1,62 @@
package com.flossom.common.core.mapper;
import com.flossom.common.core.domain.entity.ActivityChannelInfo;
import java.util.List;
/**
* Mapper
*
* @author flossom
* @date 2023-12-20
*/
public interface ActivityChannelInfoMapper
{
/**
*
*
* @param id
* @return
*/
public ActivityChannelInfo selectActivityChannelInfoById(Long id);
/**
*
*
* @param activityChannelInfo
* @return
*/
public List<ActivityChannelInfo> selectActivityChannelInfoList(ActivityChannelInfo activityChannelInfo);
/**
*
*
* @param activityChannelInfo
* @return
*/
public int insertActivityChannelInfo(ActivityChannelInfo activityChannelInfo);
/**
*
*
* @param activityChannelInfo
* @return
*/
public int updateActivityChannelInfo(ActivityChannelInfo activityChannelInfo);
/**
*
*
* @param id
* @return
*/
public int deleteActivityChannelInfoById(Long id);
/**
*
*
* @param ids
* @return
*/
public int deleteActivityChannelInfoByIds(Long[] ids);
}

@ -0,0 +1,71 @@
<?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.flossom.common.core.mapper.ActivityChannelInfoMapper">
<resultMap type="ActivityChannelInfo" id="ActivityChannelInfoResult">
<result property="id" column="id" />
<result property="channelType" column="channel_type" />
<result property="channelName" column="channel_name" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
</resultMap>
<sql id="selectActivityChannelInfoVo">
select id, channel_type, channel_name, create_time, create_by from activity_channel_info
</sql>
<select id="selectActivityChannelInfoList" parameterType="ActivityChannelInfo" resultMap="ActivityChannelInfoResult">
<include refid="selectActivityChannelInfoVo"/>
<where>
<if test="channelType != null "> and channel_type = #{channelType}</if>
<if test="channelName != null and channelName != ''"> and channel_name like concat('%', #{channelName}, '%')</if>
</where>
</select>
<select id="selectActivityChannelInfoById" parameterType="Long" resultMap="ActivityChannelInfoResult">
<include refid="selectActivityChannelInfoVo"/>
where id = #{id}
</select>
<insert id="insertActivityChannelInfo" parameterType="ActivityChannelInfo">
insert into activity_channel_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="channelType != null">channel_type,</if>
<if test="channelName != null">channel_name,</if>
<if test="createTime != null">create_time,</if>
<if test="createBy != null">create_by,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="channelType != null">#{channelType},</if>
<if test="channelName != null">#{channelName},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createBy != null">#{createBy},</if>
</trim>
</insert>
<update id="updateActivityChannelInfo" parameterType="ActivityChannelInfo">
update activity_channel_info
<trim prefix="SET" suffixOverrides=",">
<if test="channelType != null">channel_type = #{channelType},</if>
<if test="channelName != null">channel_name = #{channelName},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteActivityChannelInfoById" parameterType="Long">
delete from activity_channel_info where id = #{id}
</delete>
<delete id="deleteActivityChannelInfoByIds" parameterType="String">
delete from activity_channel_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

@ -0,0 +1,106 @@
package com.flossom.system.controller;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import com.flossom.common.core.domain.entity.ActivityChannelInfo;
import com.flossom.common.core.utils.poi.ExcelUtil;
import com.flossom.common.core.web.controller.BaseController;
import com.flossom.common.core.web.domain.AjaxResult;
import com.flossom.common.core.web.page.TableDataInfo;
import com.flossom.common.log.annotation.Log;
import com.flossom.common.log.enums.BusinessType;
import com.flossom.common.security.annotation.RequiresPermissions;
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.flossom.system.service.IActivityChannelInfoService;
/**
* Controller
*
* @author flossom
* @date 2023-12-20
*/
@RestController
@RequestMapping("/channelInfo")
public class ActivityChannelInfoController extends BaseController
{
@Autowired
private IActivityChannelInfoService activityChannelInfoService;
/**
*
*/
@RequiresPermissions("system:channelInfo:list")
@GetMapping("/list")
public TableDataInfo list(ActivityChannelInfo activityChannelInfo)
{
startPage();
List<ActivityChannelInfo> list = activityChannelInfoService.selectActivityChannelInfoList(activityChannelInfo);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("system:channelInfo:export")
@Log(title = "活动渠道信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, ActivityChannelInfo activityChannelInfo)
{
List<ActivityChannelInfo> list = activityChannelInfoService.selectActivityChannelInfoList(activityChannelInfo);
ExcelUtil<ActivityChannelInfo> util = new ExcelUtil<ActivityChannelInfo>(ActivityChannelInfo.class);
util.exportExcel(response, list, "活动渠道信息数据");
}
/**
*
*/
@RequiresPermissions("system:channelInfo:query")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(activityChannelInfoService.selectActivityChannelInfoById(id));
}
/**
*
*/
@RequiresPermissions("system:channelInfo:add")
@Log(title = "活动渠道信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ActivityChannelInfo activityChannelInfo)
{
return toAjax(activityChannelInfoService.insertActivityChannelInfo(activityChannelInfo));
}
/**
*
*/
@RequiresPermissions("system:channelInfo:edit")
@Log(title = "活动渠道信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ActivityChannelInfo activityChannelInfo)
{
return toAjax(activityChannelInfoService.updateActivityChannelInfo(activityChannelInfo));
}
/**
*
*/
@RequiresPermissions("system:channelInfo:remove")
@Log(title = "活动渠道信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(activityChannelInfoService.deleteActivityChannelInfoByIds(ids));
}
}

@ -0,0 +1,62 @@
package com.flossom.system.service;
import com.flossom.common.core.domain.entity.ActivityChannelInfo;
import java.util.List;
/**
* Service
*
* @author flossom
* @date 2023-12-20
*/
public interface IActivityChannelInfoService
{
/**
*
*
* @param id
* @return
*/
public ActivityChannelInfo selectActivityChannelInfoById(Long id);
/**
*
*
* @param activityChannelInfo
* @return
*/
public List<ActivityChannelInfo> selectActivityChannelInfoList(ActivityChannelInfo activityChannelInfo);
/**
*
*
* @param activityChannelInfo
* @return
*/
public int insertActivityChannelInfo(ActivityChannelInfo activityChannelInfo);
/**
*
*
* @param activityChannelInfo
* @return
*/
public int updateActivityChannelInfo(ActivityChannelInfo activityChannelInfo);
/**
*
*
* @param ids
* @return
*/
public int deleteActivityChannelInfoByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
public int deleteActivityChannelInfoById(Long id);
}

@ -0,0 +1,96 @@
package com.flossom.system.service.impl;
import java.util.List;
import com.flossom.common.core.domain.entity.ActivityChannelInfo;
import com.flossom.common.core.mapper.ActivityChannelInfoMapper;
import com.flossom.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.flossom.system.service.IActivityChannelInfoService;
/**
* Service
*
* @author flossom
* @date 2023-12-20
*/
@Service
public class ActivityChannelInfoServiceImpl implements IActivityChannelInfoService
{
@Autowired
private ActivityChannelInfoMapper activityChannelInfoMapper;
/**
*
*
* @param id
* @return
*/
@Override
public ActivityChannelInfo selectActivityChannelInfoById(Long id)
{
return activityChannelInfoMapper.selectActivityChannelInfoById(id);
}
/**
*
*
* @param activityChannelInfo
* @return
*/
@Override
public List<ActivityChannelInfo> selectActivityChannelInfoList(ActivityChannelInfo activityChannelInfo)
{
return activityChannelInfoMapper.selectActivityChannelInfoList(activityChannelInfo);
}
/**
*
*
* @param activityChannelInfo
* @return
*/
@Override
public int insertActivityChannelInfo(ActivityChannelInfo activityChannelInfo)
{
activityChannelInfo.setCreateTime(DateUtils.getNowDate());
return activityChannelInfoMapper.insertActivityChannelInfo(activityChannelInfo);
}
/**
*
*
* @param activityChannelInfo
* @return
*/
@Override
public int updateActivityChannelInfo(ActivityChannelInfo activityChannelInfo)
{
return activityChannelInfoMapper.updateActivityChannelInfo(activityChannelInfo);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteActivityChannelInfoByIds(Long[] ids)
{
return activityChannelInfoMapper.deleteActivityChannelInfoByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteActivityChannelInfoById(Long id)
{
return activityChannelInfoMapper.deleteActivityChannelInfoById(id);
}
}

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询【请填写功能名称】列表
export function listInfo(query) {
return request({
url: '/system/channelInfo/list',
method: 'get',
params: query
})
}
// 查询【请填写功能名称】详细
export function getInfo(id) {
return request({
url: '/system/channelInfo/' + id,
method: 'get'
})
}
// 新增【请填写功能名称】
export function addInfo(data) {
return request({
url: '/system/channelInfo',
method: 'post',
data: data
})
}
// 修改【请填写功能名称】
export function updateInfo(data) {
return request({
url: '/system/channelInfo',
method: 'put',
data: data
})
}
// 删除【请填写功能名称】
export function delInfo(id) {
return request({
url: '/system/channelInfo/' + id,
method: 'delete'
})
}

@ -0,0 +1,249 @@
<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="channelName">
<el-input
v-model="queryParams.channelName"
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="['system:channelInfo: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="['system:channelInfo: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="['system:channelInfo: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="['system:channelInfo:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="渠道类型" align="center" prop="channelType" />
<el-table-column label="渠道名称" align="center" prop="channelName" />
<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="['system:channelInfo:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:channelInfo: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="channelName">
<el-input v-model="form.channelName" 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 { listInfo, getInfo, delInfo, addInfo, updateInfo } from "@/api/system/channelInfo";
export default {
name: "Info",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
infoList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
channelType: null,
channelName: null,
},
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询仪器渠道列表 */
getList() {
this.loading = true;
listInfo(this.queryParams).then(response => {
this.infoList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
channelType: null,
channelName: null,
createTime: null,
createBy: 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
getInfo(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) {
updateInfo(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addInfo(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 delInfo(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/info/export', {
...this.queryParams
}, `info_${new Date().getTime()}.xlsx`)
}
}
};
</script>
Loading…
Cancel
Save