Browse Source

+ 与会企业行程

chen.cheng 11 months ago
parent
commit
c6aaba8be0

+ 5 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/cp/CpsMeetingUsrController.java

@@ -60,6 +60,11 @@ public class CpsMeetingUsrController extends BaseController {
     @Anonymous
     public AjaxResult login(@RequestBody WeChatUser wxUser) {
         Map session = wechatService.getSession(weChatCfg.getAppid(), weChatCfg.getAppSecret(), wxUser.getCode());
+        String errcode = MapUtils.getString(session, "errcode");
+        if (errcode != null) {
+            String errmsg = MapUtils.getString(session, "errmsg");
+            return AjaxResult.error(errmsg);
+        }
         String openId = MapUtils.getString(session, "openid");
         String sessionKey = MapUtils.getString(session, "session_key");
         wxUser.setOpenid(openId);

+ 3 - 0
ruoyi-admin/src/main/resources/application-druid.yml

@@ -81,3 +81,6 @@ spring:
         wall:
           config:
             multi-statement-allow: true
+wechat:
+  appid: wxf385eefdd03327fd
+  app-secret: 7bca97ad298a17539c7c75a5bf337063

+ 1 - 1
ruoyi-admin/src/main/resources/application.yml

@@ -52,7 +52,7 @@ spring:
     # 国际化资源文件路径
     basename: i18n/messages
   profiles:
-    active: hm
+    active: druid
   # 文件上传
   servlet:
     multipart:

+ 12 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/CpsMeetingUsr.java

@@ -49,10 +49,14 @@ public class CpsMeetingUsr extends BaseEntity {
     @Excel(name = "参会行程信息")
     private Long tripId;
 
+    @Excel(name = "参会企业信息")
     private String enterpriseName;
+    @Excel(name = "行程名称")
     private String tripName;
 
     private String avatarUrl;
+    @Excel(name = "性别")
+    private String sex;
 
     public void setId(Long id) {
         this.id = id;
@@ -126,6 +130,14 @@ public class CpsMeetingUsr extends BaseEntity {
         this.avatarUrl = avatarUrl;
     }
 
+    public String getSex() {
+        return sex;
+    }
+
+    public void setSex(String sex) {
+        this.sex = sex;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("id", getId()).append("usrName", getUsrName()).append("tel", getTel()).append("openId", getOpenId()).append("enterpriseId", getEnterpriseId()).append("tripId", getTripId()).append("updateTime", getUpdateTime()).append("createTime", getCreateTime()).append("createBy", getCreateBy()).append("updateBy", getUpdateBy()).toString();

+ 7 - 0
ruoyi-system/src/main/resources/mapper/system/CpsMeetingUsrMapper.xml → ruoyi-system/src/main/resources/mapper/cp/CpsMeetingUsrMapper.xml

@@ -11,6 +11,7 @@
         <result property="openId" column="open_id"/>
         <result property="enterpriseId" column="enterprise_id"/>
         <result property="tripId" column="trip_id"/>
+        <result property="sex" column="sex"/>
         <result property="updateTime" column="update_time"/>
         <result property="createTime" column="create_time"/>
         <result property="createBy" column="create_by"/>
@@ -25,6 +26,7 @@
                usr.enterprise_id,
                usr.trip_id,
                trip.trip_name,
+               usr.sex,
                avatar_url,
                enterprise.enterprise_name,
                usr.update_time,
@@ -41,6 +43,7 @@
         <include refid="selectCpsMeetingUsrVo"/>
         <where>
             <if test="usrName != null  and usrName != ''">and usr_name like concat('%', #{usrName}, '%')</if>
+            <if test="sex != null  and sex != ''">and usr.sex = #{sex}</if>
             <if test="tel != null  and tel != ''">and usr.tel = #{tel}</if>
             <if test="openId != null  and openId != ''">and open_id = #{openId}</if>
             <if test="enterpriseId != null ">and usr.enterprise_id = #{enterpriseId}</if>
@@ -63,6 +66,7 @@
             <if test="enterpriseId != null">enterprise_id,</if>
             <if test="tripId != null">trip_id,</if>
             <if test="avatarUrl != null">avatar_url,</if>
+            <if test="sex != null">sex,</if>
             <if test="updateTime != null">update_time,</if>
             <if test="createTime != null">create_time,</if>
             <if test="createBy != null">create_by,</if>
@@ -75,6 +79,7 @@
             <if test="enterpriseId != null">#{enterpriseId},</if>
             <if test="tripId != null">#{tripId},</if>
             <if test="avatarUrl != null">#{avatarUrl},</if>
+            <if test="sex != null">#{sex},</if>
             <if test="updateTime != null">#{updateTime},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="createBy != null">#{createBy},</if>
@@ -90,6 +95,8 @@
             <if test="openId != null">open_id = #{openId},</if>
             <if test="enterpriseId != null">enterprise_id = #{enterpriseId},</if>
             <if test="tripId != null">trip_id = #{tripId},</if>
+            <if test="avatarUrl != null">avatar_url = #{avatarUrl},</if>
+            <if test="sex != null">sex = #{sex},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="createBy != null">create_by = #{createBy},</if>

+ 44 - 0
ruoyi-ui/src/api/cp/usr.js

@@ -0,0 +1,44 @@
+import request from '@/utils/request'
+
+// 查询cps_meeting_usr与会人员信息列表
+export function listUsr(query) {
+  return request({
+    url: '/cp/usr/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询cps_meeting_usr与会人员信息详细
+export function getUsr(id) {
+  return request({
+    url: '/cp/usr/' + id,
+    method: 'get'
+  })
+}
+
+// 新增cps_meeting_usr与会人员信息
+export function addUsr(data) {
+  return request({
+    url: '/cp/usr',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改cps_meeting_usr与会人员信息
+export function updateUsr(data) {
+  return request({
+    url: '/cp/usr',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除cps_meeting_usr与会人员信息
+export function delUsr(id) {
+  return request({
+    url: '/cp/usr/' + id,
+    method: 'delete'
+  })
+}

+ 310 - 0
ruoyi-ui/src/views/cp/usr/index.vue

@@ -0,0 +1,310 @@
+<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="usrName">
+        <el-input
+          v-model="queryParams.usrName"
+          placeholder="请输入文件路径"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="文件名称" prop="tel">
+        <el-input
+          v-model="queryParams.tel"
+          placeholder="请输入文件名称"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="性别" prop="sex">
+        <el-select v-model="queryParams.sex" placeholder="请选择性别" clearable>
+          <el-option
+            v-for="dict in dict.type.sys_user_sex"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          />
+        </el-select>
+      </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="['cp:usr: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="['cp:usr: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="['cp:usr: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="['cp:usr:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="usrList" @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="usrName" />
+      <el-table-column label="文件名称" align="center" prop="tel" />
+      <el-table-column label="微信开放id" align="center" prop="openId" />
+      <el-table-column label="与会人员企业" align="center" prop="enterpriseId" />
+      <el-table-column label="参会行程信息" align="center" prop="tripId" />
+      <el-table-column label="头像" align="center" prop="avatarUrl" />
+      <el-table-column label="性别" align="center" prop="sex">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.sys_user_sex" :value="scope.row.sex"/>
+        </template>
+      </el-table-column>
+      <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="['cp:usr:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['cp:usr: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"
+    />
+
+    <!-- 添加或修改cps_meeting_usr与会人员信息对话框 -->
+    <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="usrName">
+          <el-input v-model="form.usrName" placeholder="请输入文件路径" />
+        </el-form-item>
+        <el-form-item label="文件名称" prop="tel">
+          <el-input v-model="form.tel" placeholder="请输入文件名称" />
+        </el-form-item>
+        <el-form-item label="微信开放id" prop="openId">
+          <el-input v-model="form.openId" placeholder="请输入微信开放id" />
+        </el-form-item>
+        <el-form-item label="与会人员企业" prop="enterpriseId">
+          <el-input v-model="form.enterpriseId" placeholder="请输入与会人员企业" />
+        </el-form-item>
+        <el-form-item label="参会行程信息" prop="tripId">
+          <el-input v-model="form.tripId" placeholder="请输入参会行程信息" />
+        </el-form-item>
+        <el-form-item label="头像" prop="avatarUrl">
+          <el-input v-model="form.avatarUrl" type="textarea" placeholder="请输入内容" />
+        </el-form-item>
+        <el-form-item label="性别" prop="sex">
+          <el-radio-group v-model="form.sex">
+            <el-radio
+              v-for="dict in dict.type.sys_user_sex"
+              :key="dict.value"
+              :label="dict.value"
+            >{{dict.label}}</el-radio>
+          </el-radio-group>
+        </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 { listUsr, getUsr, delUsr, addUsr, updateUsr } from "@/api/cp/usr";
+
+export default {
+  name: "Usr",
+  dicts: ['sys_user_sex'],
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // cps_meeting_usr与会人员信息表格数据
+      usrList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        usrName: null,
+        tel: null,
+        sex: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询cps_meeting_usr与会人员信息列表 */
+    getList() {
+      this.loading = true;
+      listUsr(this.queryParams).then(response => {
+        this.usrList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        usrName: null,
+        tel: null,
+        openId: null,
+        enterpriseId: null,
+        tripId: null,
+        avatarUrl: null,
+        sex: null,
+        updateTime: null,
+        createTime: null,
+        createBy: null,
+        updateBy: 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 = "添加cps_meeting_usr与会人员信息";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getUsr(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改cps_meeting_usr与会人员信息";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateUsr(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addUsr(this.form).then(response => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$modal.confirm('是否确认删除cps_meeting_usr与会人员信息编号为"' + ids + '"的数据项?').then(function() {
+        return delUsr(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('cp/usr/export', {
+        ...this.queryParams
+      }, `usr_${new Date().getTime()}.xlsx`)
+    }
+  }
+};
+</script>