其他配置

master
382696293@qq.com 2 years ago
parent 777e9a8827
commit 1b6003de82

@ -0,0 +1,101 @@
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;
/**
* wx_other_setting
*
* @author flossom
* @date 2023-12-13
*/
public class WxOtherSetting extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* $column.columnComment
*/
private Long id;
/**
* appid
*/
@Excel(name = "商城跳转appid")
private String skipAppid;
/**
*
*/
@Excel(name = "商城路径")
private String skipPath;
/**
*
*/
@Excel(name = "系统版本")
private String sysVersion;
/**
* 0 1
*/
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
private Integer status;
public void setId(Long id) {
this.id = id;
}
public Long getId() {
return id;
}
public void setSkipAppid(String skipAppid) {
this.skipAppid = skipAppid;
}
public String getSkipAppid() {
return skipAppid;
}
public void setSkipPath(String skipPath) {
this.skipPath = skipPath;
}
public String getSkipPath() {
return skipPath;
}
public void setSysVersion(String sysVersion) {
this.sysVersion = sysVersion;
}
public String getSysVersion() {
return sysVersion;
}
public void setStatus(Integer status) {
this.status = status;
}
public Integer getStatus() {
return status;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("skipAppid", getSkipAppid())
.append("skipPath", getSkipPath())
.append("sysVersion", getSysVersion())
.append("status", getStatus())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

@ -0,0 +1,62 @@
package com.flossom.hzMapper.mapper;
import com.flossom.common.core.domain.entity.WxOtherSetting;
import java.util.List;
/**
* Mapper
*
* @author flossom
* @date 2023-12-13
*/
public interface WxOtherSettingMapper {
/**
*
*
* @param id
* @return
*/
public WxOtherSetting selectWxOtherSettingById(Long id);
/**
*
*
* @param wxOtherSetting
* @return
*/
public List<WxOtherSetting> selectWxOtherSettingList(WxOtherSetting wxOtherSetting);
/**
*
*
* @param wxOtherSetting
* @return
*/
public int insertWxOtherSetting(WxOtherSetting wxOtherSetting);
/**
*
*
* @param wxOtherSetting
* @return
*/
public int updateWxOtherSetting(WxOtherSetting wxOtherSetting);
/**
*
*
* @param id
* @return
*/
public int deleteWxOtherSettingById(Long id);
/**
*
*
* @param ids
* @return
*/
public int deleteWxOtherSettingByIds(Long[] ids);
}

@ -0,0 +1,93 @@
<?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.hzMapper.mapper.WxOtherSettingMapper">
<resultMap type="WxOtherSetting" id="WxOtherSettingResult">
<result property="id" column="id" />
<result property="skipAppid" column="skip_appid" />
<result property="skipPath" column="skip_path" />
<result property="sysVersion" column="sys_version" />
<result property="status" column="status" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectWxOtherSettingVo">
select id, skip_appid, skip_path, sys_version, status, create_by, create_time, update_by, update_time, remark from wx_other_setting
</sql>
<select id="selectWxOtherSettingList" parameterType="WxOtherSetting" resultMap="WxOtherSettingResult">
<include refid="selectWxOtherSettingVo"/>
<where>
<if test="skipAppid != null and skipAppid != ''"> and skip_appid = #{skipAppid}</if>
<if test="skipPath != null and skipPath != ''"> and skip_path = #{skipPath}</if>
<if test="sysVersion != null and sysVersion != ''"> and sys_version = #{sysVersion}</if>
<if test="status != null "> and status = #{status}</if>
</where>
</select>
<select id="selectWxOtherSettingById" parameterType="Long" resultMap="WxOtherSettingResult">
<include refid="selectWxOtherSettingVo"/>
where id = #{id}
</select>
<insert id="insertWxOtherSetting" parameterType="WxOtherSetting">
insert into wx_other_setting
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="skipAppid != null">skip_appid,</if>
<if test="skipPath != null">skip_path,</if>
<if test="sysVersion != null">sys_version,</if>
<if test="status != null">status,</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>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="skipAppid != null">#{skipAppid},</if>
<if test="skipPath != null">#{skipPath},</if>
<if test="sysVersion != null">#{sysVersion},</if>
<if test="status != null">#{status},</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>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateWxOtherSetting" parameterType="WxOtherSetting">
update wx_other_setting
<trim prefix="SET" suffixOverrides=",">
<if test="skipAppid != null">skip_appid = #{skipAppid},</if>
<if test="skipPath != null">skip_path = #{skipPath},</if>
<if test="sysVersion != null">sys_version = #{sysVersion},</if>
<if test="status != null">status = #{status},</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>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteWxOtherSettingById" parameterType="Long">
delete from wx_other_setting where id = #{id}
</delete>
<delete id="deleteWxOtherSettingByIds" parameterType="String">
delete from wx_other_setting where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

@ -90,4 +90,14 @@ public class SystemSettingController extends BaseController {
return AjaxResult.success(systemSettingService.getContactWorker());
}
/**
*
*
* @return
*/
@GetMapping("/getOtherSetting")
public AjaxResult getOtherSetting() {
return AjaxResult.success(systemSettingService.getOtherSetting());
}
}

@ -1,6 +1,7 @@
package com.flossom.miniProgram.service;
import com.flossom.common.core.domain.entity.WxOtherSetting;
import com.flossom.common.core.domain.entity.WxSystemSetting;
public interface ISystemSettingService {
@ -19,4 +20,5 @@ public interface ISystemSettingService {
WxSystemSetting getContactWorker();
WxOtherSetting getOtherSetting();
}

@ -1,7 +1,9 @@
package com.flossom.miniProgram.service.impl;
import com.flossom.common.core.domain.entity.WxOtherSetting;
import com.flossom.common.core.domain.entity.WxSystemSetting;
import com.flossom.hzMapper.Enums.SystemSettingKeyEnum;
import com.flossom.hzMapper.mapper.WxOtherSettingMapper;
import com.flossom.hzMapper.mapper.WxSystemSettingMapper;
import com.flossom.miniProgram.service.ISystemSettingService;
import org.springframework.beans.factory.annotation.Autowired;
@ -13,6 +15,9 @@ public class SystemSettingServiceImpl implements ISystemSettingService {
@Autowired
private WxSystemSettingMapper systemSettingMapper;
@Autowired
private WxOtherSettingMapper wxOtherSettingMapper;
/**
*
*
@ -83,4 +88,9 @@ public class SystemSettingServiceImpl implements ISystemSettingService {
public WxSystemSetting getContactWorker() {
return systemSettingMapper.getSystemSettingByKey(SystemSettingKeyEnum.CONTACT_WORKER.getKey());
}
@Override
public WxOtherSetting getOtherSetting() {
return wxOtherSettingMapper.selectWxOtherSettingById(1L);
}
}

@ -0,0 +1,99 @@
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.WxOtherSetting;
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.IWxOtherSettingService;
/**
* Controller
*
* @author flossom
* @date 2023-12-13
*/
@RestController
@RequestMapping("/otherSetting")
public class WxOtherSettingController extends BaseController {
@Autowired
private IWxOtherSettingService wxOtherSettingService;
/**
*
*/
@RequiresPermissions("system:otherSetting:list")
@GetMapping("/list")
public TableDataInfo list(WxOtherSetting wxOtherSetting) {
startPage();
List<WxOtherSetting> list = wxOtherSettingService.selectWxOtherSettingList(wxOtherSetting);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("system:otherSetting:export")
@Log(title = "其他配置", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WxOtherSetting wxOtherSetting) {
List<WxOtherSetting> list = wxOtherSettingService.selectWxOtherSettingList(wxOtherSetting);
ExcelUtil<WxOtherSetting> util = new ExcelUtil<WxOtherSetting>(WxOtherSetting.class);
util.exportExcel(response, list, "其他配置数据");
}
/**
*
*/
@RequiresPermissions("system:otherSetting:query")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(wxOtherSettingService.selectWxOtherSettingById(id));
}
/**
*
*/
@RequiresPermissions("system:otherSetting:add")
@Log(title = "其他配置", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WxOtherSetting wxOtherSetting) {
return toAjax(wxOtherSettingService.insertWxOtherSetting(wxOtherSetting));
}
/**
*
*/
@RequiresPermissions("system:otherSetting:edit")
@Log(title = "其他配置", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WxOtherSetting wxOtherSetting) {
return toAjax(wxOtherSettingService.updateWxOtherSetting(wxOtherSetting));
}
/**
*
*/
@RequiresPermissions("system:otherSetting:remove")
@Log(title = "其他配置", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(wxOtherSettingService.deleteWxOtherSettingByIds(ids));
}
}

@ -0,0 +1,61 @@
package com.flossom.system.service;
import com.flossom.common.core.domain.entity.WxOtherSetting;
import java.util.List;
/**
* Service
*
* @author flossom
* @date 2023-12-13
*/
public interface IWxOtherSettingService {
/**
*
*
* @param id
* @return
*/
public WxOtherSetting selectWxOtherSettingById(Long id);
/**
*
*
* @param wxOtherSetting
* @return
*/
public List<WxOtherSetting> selectWxOtherSettingList(WxOtherSetting wxOtherSetting);
/**
*
*
* @param wxOtherSetting
* @return
*/
public int insertWxOtherSetting(WxOtherSetting wxOtherSetting);
/**
*
*
* @param wxOtherSetting
* @return
*/
public int updateWxOtherSetting(WxOtherSetting wxOtherSetting);
/**
*
*
* @param ids
* @return
*/
public int deleteWxOtherSettingByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
public int deleteWxOtherSettingById(Long id);
}

@ -0,0 +1,90 @@
package com.flossom.system.service.impl;
import java.util.List;
import com.flossom.common.core.domain.entity.WxOtherSetting;
import com.flossom.common.core.utils.DateUtils;
import com.flossom.hzMapper.mapper.WxOtherSettingMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.flossom.system.service.IWxOtherSettingService;
/**
* Service
*
* @author flossom
* @date 2023-12-13
*/
@Service
public class WxOtherSettingServiceImpl implements IWxOtherSettingService {
@Autowired
private WxOtherSettingMapper wxOtherSettingMapper;
/**
*
*
* @param id
* @return
*/
@Override
public WxOtherSetting selectWxOtherSettingById(Long id) {
return wxOtherSettingMapper.selectWxOtherSettingById(id);
}
/**
*
*
* @param wxOtherSetting
* @return
*/
@Override
public List<WxOtherSetting> selectWxOtherSettingList(WxOtherSetting wxOtherSetting) {
return wxOtherSettingMapper.selectWxOtherSettingList(wxOtherSetting);
}
/**
*
*
* @param wxOtherSetting
* @return
*/
@Override
public int insertWxOtherSetting(WxOtherSetting wxOtherSetting) {
wxOtherSetting.setCreateTime(DateUtils.getNowDate());
return wxOtherSettingMapper.insertWxOtherSetting(wxOtherSetting);
}
/**
*
*
* @param wxOtherSetting
* @return
*/
@Override
public int updateWxOtherSetting(WxOtherSetting wxOtherSetting) {
wxOtherSetting.setUpdateTime(DateUtils.getNowDate());
return wxOtherSettingMapper.updateWxOtherSetting(wxOtherSetting);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteWxOtherSettingByIds(Long[] ids) {
return wxOtherSettingMapper.deleteWxOtherSettingByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteWxOtherSettingById(Long id) {
return wxOtherSettingMapper.deleteWxOtherSettingById(id);
}
}

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询其他配置列表
export function listOtherSetting(query) {
return request({
url: '/system/otherSetting/list',
method: 'get',
params: query
})
}
// 查询其他配置详细
export function getOtherSetting(id) {
return request({
url: '/system/otherSetting/' + id,
method: 'get'
})
}
// 新增其他配置
export function addOtherSetting(data) {
return request({
url: '/system/otherSetting',
method: 'post',
data: data
})
}
// 修改其他配置
export function updateOtherSetting(data) {
return request({
url: '/system/otherSetting',
method: 'put',
data: data
})
}
// 删除其他配置
export function delOtherSetting(id) {
return request({
url: '/system/otherSetting/' + id,
method: 'delete'
})
}

@ -0,0 +1,285 @@
<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="商城跳转appid" prop="skipAppid">
<el-input
v-model="queryParams.skipAppid"
placeholder="请输入商城跳转appid"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="商城路径" prop="skipPath">
<el-input
v-model="queryParams.skipPath"
placeholder="请输入商城路径"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="系统版本" prop="sysVersion">
<el-input
v-model="queryParams.sysVersion"
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:otherSetting: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:otherSetting: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:otherSetting: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:otherSetting:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="otherSettingList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="${comment}" align="center" prop="id" />
<el-table-column label="商城跳转appid" align="center" prop="skipAppid" />
<el-table-column label="商城路径" align="center" prop="skipPath" />
<el-table-column label="系统版本" align="center" prop="sysVersion" />
<el-table-column label="状态" align="center" prop="status" />
<el-table-column label="${comment}" align="center" prop="remark" />
<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:otherSetting:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:otherSetting: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="商城跳转appid" prop="skipAppid">
<el-input v-model="form.skipAppid" placeholder="请输入商城跳转appid" />
</el-form-item>
<el-form-item label="商城路径" prop="skipPath">
<el-input v-model="form.skipPath" placeholder="请输入商城路径" />
</el-form-item>
<el-form-item label="系统版本" prop="sysVersion">
<el-input v-model="form.sysVersion" placeholder="请输入系统版本" />
</el-form-item>
<el-form-item label="${comment}" prop="remark">
<el-input v-model="form.remark" placeholder="请输入${comment}" />
</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 { listOtherSetting, getOtherSetting, delOtherSetting, addOtherSetting, updateOtherSetting } from "@/api/system/otherSetting";
export default {
name: "OtherSetting",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
otherSettingList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
skipAppid: null,
skipPath: null,
sysVersion: null,
status: null,
},
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询其他配置列表 */
getList() {
this.loading = true;
listOtherSetting(this.queryParams).then(response => {
this.otherSettingList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
skipAppid: null,
skipPath: null,
sysVersion: null,
status: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: 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
getOtherSetting(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) {
updateOtherSetting(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addOtherSetting(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 delOtherSetting(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/otherSetting/export', {
...this.queryParams
}, `otherSetting_${new Date().getTime()}.xlsx`)
}
}
};
</script>
Loading…
Cancel
Save