chen.cheng 10 сар өмнө
parent
commit
64dd0bd5a4

+ 11 - 24
ruoyi-admin/src/main/java/com/ruoyi/web/controller/cp/CpsUsrApplyController.java

@@ -3,7 +3,6 @@ package com.ruoyi.web.controller.cp;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
-import com.ruoyi.common.core.domain.model.WeChatUser;
 import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.common.utils.DateUtils;
@@ -32,8 +31,7 @@ import java.util.List;
  */
 @RestController
 @RequestMapping("/cp/usrApply")
-public class CpsUsrApplyController extends BaseController
-{
+public class CpsUsrApplyController extends BaseController {
     @Autowired
     private ICpsUsrApplyService cpsUsrApplyService;
 
@@ -42,21 +40,15 @@ public class CpsUsrApplyController extends BaseController
      */
     @GetMapping("/list")
     @PreAuthorize("@ss.hasPermi('cp:apply:index')")
-    public TableDataInfo list(CpsUsrApply cpsUsrApply)
-    {
+    public TableDataInfo list(CpsUsrApply cpsUsrApply) {
         startPage();
-        List<CpsUsrApply> list = cpsUsrApplyService.selectCpsUsrApplyList(cpsUsrApply);
+        List<CpsUsrApply> list = cpsUsrApplyService.selectCpsUsrDataRole(cpsUsrApply);
         return getDataTable(list);
     }
 
     @GetMapping("/regist/list")
-    public TableDataInfo registList() {
-        startPage();
-        WeChatUser loginUser = (WeChatUser) getLoginUser();
-        List<CpsUsrApply> cpsUsrApplies = cpsUsrApplyService.selectCpsUsrApplyList(new CpsUsrApply() {{
-            setUsrWechatId(loginUser.getUserId());
-        }});
-        return getDataTable(cpsUsrApplies);
+    public AjaxResult registList() {
+        return AjaxResult.success(cpsUsrApplyService.qryUserApplyList());
     }
 
 
@@ -65,8 +57,7 @@ public class CpsUsrApplyController extends BaseController
      */
     @Log(title = "cps_usr_apply与会申请", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
-    public void export(HttpServletResponse response, CpsUsrApply cpsUsrApply)
-    {
+    public void export(HttpServletResponse response, CpsUsrApply cpsUsrApply) {
         List<CpsUsrApply> list = cpsUsrApplyService.selectCpsUsrApplyList(cpsUsrApply);
         ExcelUtil<CpsUsrApply> util = new ExcelUtil<CpsUsrApply>(CpsUsrApply.class);
         util.exportExcel(response, list, "cps_usr_apply与会申请数据");
@@ -76,8 +67,7 @@ public class CpsUsrApplyController extends BaseController
      * 获取cps_usr_apply与会申请详细信息
      */
     @GetMapping(value = "/{id}")
-    public AjaxResult getInfo(@PathVariable("id") Long id)
-    {
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
         return success(cpsUsrApplyService.selectCpsUsrApplyById(id));
     }
 
@@ -96,8 +86,7 @@ public class CpsUsrApplyController extends BaseController
      */
     @Log(title = "cps_usr_apply与会申请", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody CpsUsrApply cpsUsrApply)
-    {
+    public AjaxResult add(@RequestBody CpsUsrApply cpsUsrApply) {
         cpsUsrApply.setCreateTime(DateUtils.getNowDate());
         return toAjax(cpsUsrApplyService.insertCpsUsrApply(cpsUsrApply));
     }
@@ -107,8 +96,7 @@ public class CpsUsrApplyController extends BaseController
      */
     @Log(title = "cps_usr_apply与会申请", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody CpsUsrApply cpsUsrApply)
-    {
+    public AjaxResult edit(@RequestBody CpsUsrApply cpsUsrApply) {
         return toAjax(cpsUsrApplyService.updateCpsUsrApply(cpsUsrApply));
     }
 
@@ -123,9 +111,8 @@ public class CpsUsrApplyController extends BaseController
      * 删除cps_usr_apply与会申请
      */
     @Log(title = "cps_usr_apply与会申请", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{ids}")
-    public AjaxResult remove(@PathVariable Long[] ids)
-    {
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
         return toAjax(cpsUsrApplyService.deleteCpsUsrApplyByIds(ids));
     }
 }

+ 2 - 2
ruoyi-admin/src/main/resources/application-hm.yml

@@ -82,8 +82,8 @@ spring:
           config:
             multi-statement-allow: true
 wechat:
-  appid: wxf385eefdd03327fd
-  app-secret: 7bca97ad298a17539c7c75a5bf337063
+  appid: wxf5aeb6ded4e4488b
+  app-secret: 9d59097282334b5c1a131e9cebac7176
 app:
   cfg:
     role-top-dept-id: 201

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

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

+ 3 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/CpsUsrApplyMapper.java

@@ -4,6 +4,7 @@ import com.ruoyi.system.domain.CpsUsrApply;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * cps_usr_apply与会申请Mapper接口
@@ -31,6 +32,8 @@ public interface CpsUsrApplyMapper
      */
     public List<CpsUsrApply> selectCpsUsrApplyList(CpsUsrApply cpsUsrApply);
 
+    List<Map<String,Object>> qryUserApply(String usrId);
+
     /**
      * 新增cps_usr_apply与会申请
      *

+ 7 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/ICpsUsrApplyService.java

@@ -1,6 +1,9 @@
 package com.ruoyi.system.service;
 
 import java.util.List;
+import java.util.Map;
+
+import com.ruoyi.common.annotation.DataScope;
 import com.ruoyi.system.domain.CpsUsrApply;
 
 /**
@@ -31,6 +34,10 @@ public interface ICpsUsrApplyService
      */
     public List<CpsUsrApply> selectCpsUsrApplyList(CpsUsrApply cpsUsrApply);
 
+    List<CpsUsrApply> selectCpsUsrDataRole(CpsUsrApply cpsUsrApply);
+
+    List<Map<String, Object>> qryUserApplyList();
+
     /**
      * 新增cps_usr_apply与会申请
      *

+ 2 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CpsMeetingUsrServiceImpl.java

@@ -165,6 +165,8 @@ public class CpsMeetingUsrServiceImpl implements ICpsMeetingUsrService {
         user.setUpdateBy(loginUser.getOpenid());
         CpsContentInfo cpsContentInfo = contentInfoMapper.selectCpsContentInfoById(user.getContentId());
         user.setDeptId(cpsContentInfo.getDeptId());
+        user.setContentTitle(cpsContentInfo.getTitle());
+        user.setUsrWechatId(loginUser.getUserId());
         cpsUsrApplyMapper.insertCpsUsrApplyOrUpdate(user);
     }
 

+ 12 - 1
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CpsUsrApplyServiceImpl.java

@@ -18,6 +18,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * cps_usr_apply与会申请Service业务层处理
@@ -81,11 +82,21 @@ public class CpsUsrApplyServiceImpl implements ICpsUsrApplyService {
      * @return cps_usr_apply与会申请
      */
     @Override
-    @DataScope(deptAlias = "usrApply")
     public List<CpsUsrApply> selectCpsUsrApplyList(CpsUsrApply cpsUsrApply) {
         return cpsUsrApplyMapper.selectCpsUsrApplyList(cpsUsrApply);
     }
 
+    @Override
+    @DataScope(deptAlias = "usrApply")
+    public List<CpsUsrApply> selectCpsUsrDataRole(CpsUsrApply cpsUsrApply) {
+        return cpsUsrApplyMapper.selectCpsUsrApplyList(cpsUsrApply);
+    }
+
+    public List<Map<String, Object>> qryUserApplyList() {
+        WeChatUser loginUser = (WeChatUser) SecurityUtils.getLoginUser();
+        return cpsUsrApplyMapper.qryUserApply(Long.toString(loginUser.getUserId()));
+    }
+
     /**
      * 新增cps_usr_apply与会申请
      *

+ 72 - 42
ruoyi-system/src/main/resources/mapper/cp/CpsUsrApplyMapper.xml

@@ -1,35 +1,35 @@
 <?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">
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ruoyi.system.mapper.CpsUsrApplyMapper">
 
     <resultMap type="com.ruoyi.system.domain.CpsUsrApply" id="CpsUsrApplyResult">
-        <result property="id"    column="id"    />
-        <result property="usrName"    column="usr_name"    />
-        <result property="tel"    column="tel"    />
-        <result property="orgUnitName"    column="org_unit_name"    />
-        <result property="uniLevel"    column="uni_level"    />
-        <result property="email"    column="email"    />
-        <result property="usrType"    column="usr_type"    />
-        <result property="conferenceFlag"    column="conference_flag"    />
-        <result property="conferenceRel"    column="conference_rel"    />
-        <result property="applyType"    column="apply_type"    />
-        <result property="reviewState"    column="review_state"    />
-        <result property="reviewMsg"    column="review_msg"    />
-        <result property="usrWechatId"    column="usr_wechat_id"    />
-        <result property="contentId"    column="content_id"    />
+        <result property="id" column="id"/>
+        <result property="usrName" column="usr_name"/>
+        <result property="tel" column="tel"/>
+        <result property="orgUnitName" column="org_unit_name"/>
+        <result property="uniLevel" column="uni_level"/>
+        <result property="email" column="email"/>
+        <result property="usrType" column="usr_type"/>
+        <result property="conferenceFlag" column="conference_flag"/>
+        <result property="conferenceRel" column="conference_rel"/>
+        <result property="applyType" column="apply_type"/>
+        <result property="reviewState" column="review_state"/>
+        <result property="reviewMsg" column="review_msg"/>
+        <result property="usrWechatId" column="usr_wechat_id"/>
+        <result property="contentId" column="content_id"/>
         <result property="contentTitle" column="content_title"/>
         <result property="deptId" column="dept_id"/>
-        <result property="wayComing"    column="way_coming"    />
-        <result property="comInfo"    column="com_info"    />
-        <result property="wayBack"    column="way_back"    />
-        <result property="backInfo"    column="back_info"    />
-        <result property="remark"    column="remark"    />
-        <result property="updateTime"    column="update_time"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="createBy"    column="create_by"    />
-        <result property="updateBy"    column="update_by"    />
+        <result property="wayComing" column="way_coming"/>
+        <result property="comInfo" column="com_info"/>
+        <result property="wayBack" column="way_back"/>
+        <result property="backInfo" column="back_info"/>
+        <result property="remark" column="remark"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="createTime" column="create_time"/>
+        <result property="createBy" column="create_by"/>
+        <result property="updateBy" column="update_by"/>
     </resultMap>
 
     <sql id="selectCpsUsrApplyVo">
@@ -48,27 +48,53 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                usr_wechat_id,
                content_id,
                content_title,
-               dept_id, way_coming, com_info, way_back, back_info, remark,
+               dept_id,
+               way_coming,
+               com_info,
+               way_back,
+               back_info,
+               remark,
                update_time,
                create_time,
                create_by,
                update_by
         from cps_usr_apply usrApply
     </sql>
+    <select id="qryUserApply">
+        SELECT usrApply.id,
+               usr_name             usrName,
+               tel,
+               apply_type           applyType,
+               review_state         reviewState,
+               usr_wechat_id        usrWechatId,
+               content_id           contentId,
+               content_title        contentTitle,
+               usrApply.create_time createTime,
+               dic.dict_label       applyTypeName,
+               dicReview.dict_label reviewStateName
+        FROM cps_usr_apply usrApply
+                 inner JOIN sys_dict_data dic on usrApply.apply_type = dic.dict_value and dic.dict_type = 'apply_type'
+                 inner JOIN sys_dict_data dicReview
+                            on usrApply.review_state = dicReview.dict_value and dicReview.dict_type = 'review_state'
+        where usrApply.usr_wechat_id = #{usrId}
+    </select>
 
-    <select id="selectCpsUsrApplyList" parameterType="com.ruoyi.system.domain.CpsUsrApply" resultMap="CpsUsrApplyResult">
+    <select id="selectCpsUsrApplyList" parameterType="com.ruoyi.system.domain.CpsUsrApply"
+            resultMap="CpsUsrApplyResult">
         <include refid="selectCpsUsrApplyVo"/>
         <where>
-            <if test="usrName != null  and usrName != ''"> and usr_name like concat('%', #{usrName}, '%')</if>
-            <if test="tel != null  and tel != ''"> and tel = #{tel}</if>
-            <if test="orgUnitName != null  and orgUnitName != ''"> and org_unit_name like concat('%', #{orgUnitName}, '%')</if>
-            <if test="uniLevel != null  and uniLevel != ''"> and uni_levle = #{uniLevel}</if>
-            <if test="usrType != null  and usrType != ''"> and usr_type = #{usrType}</if>
-            <if test="conferenceFlag != null  and conferenceFlag != ''"> and conference_flag = #{conferenceFlag}</if>
-            <if test="applyType != null  and applyType != ''"> and apply_type = #{applyType}</if>
-            <if test="reviewState != null  and reviewState != ''"> and review_state = #{reviewState}</if>
-            <if test="wayComing != null  and wayComing != ''"> and way_coming = #{wayComing}</if>
-            <if test="wayBack != null  and wayBack != ''"> and way_back = #{wayBack}</if>
+            <if test="usrName != null  and usrName != ''">and usr_name like concat('%', #{usrName}, '%')</if>
+            <if test="tel != null  and tel != ''">and tel = #{tel}</if>
+            <if test="orgUnitName != null  and orgUnitName != ''">and org_unit_name like concat('%', #{orgUnitName},
+                '%')
+            </if>
+            <if test="uniLevel != null  and uniLevel != ''">and uni_levle = #{uniLevel}</if>
+            <if test="usrType != null  and usrType != ''">and usr_type = #{usrType}</if>
+            <if test="conferenceFlag != null  and conferenceFlag != ''">and conference_flag = #{conferenceFlag}</if>
+            <if test="applyType != null  and applyType != ''">and apply_type = #{applyType}</if>
+            <if test="reviewState != null  and reviewState != ''">and review_state = #{reviewState}</if>
+            <if test="wayComing != null  and wayComing != ''">and way_coming = #{wayComing}</if>
+            <if test="wayBack != null  and wayBack != ''">and way_back = #{wayBack}</if>
             ${params.dataScope}
         </where>
     </select>
@@ -83,7 +109,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where tel = #{tel} and apply_type = #{meetingType}
     </select>
 
-    <insert id="insertCpsUsrApply" parameterType="com.ruoyi.system.domain.CpsUsrApply" useGeneratedKeys="true" keyProperty="id">
+    <insert id="insertCpsUsrApply" parameterType="com.ruoyi.system.domain.CpsUsrApply" useGeneratedKeys="true"
+            keyProperty="id">
         insert into cps_usr_apply
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="usrName != null">usr_name,</if>
@@ -110,7 +137,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createTime != null">create_time,</if>
             <if test="createBy != null">create_by,</if>
             <if test="updateBy != null">update_by,</if>
-         </trim>
+        </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="usrName != null">#{usrName},</if>
             <if test="tel != null">#{tel},</if>
@@ -136,10 +163,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createTime != null">#{createTime},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="updateBy != null">#{updateBy},</if>
-         </trim>
+        </trim>
     </insert>
 
-    <insert id="insertCpsUsrApplyOrUpdate" parameterType="com.ruoyi.system.domain.CpsUsrApply" useGeneratedKeys="true" keyProperty="id">
+    <insert id="insertCpsUsrApplyOrUpdate" parameterType="com.ruoyi.system.domain.CpsUsrApply" useGeneratedKeys="true"
+            keyProperty="id">
         insert into cps_usr_apply
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="usrName != null">usr_name,</if>
@@ -251,7 +279,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </update>
 
     <delete id="deleteCpsUsrApplyById" parameterType="Long">
-        delete from cps_usr_apply where id = #{id}
+        delete
+        from cps_usr_apply
+        where id = #{id}
     </delete>
 
     <delete id="deleteCpsUsrApplyByIds" parameterType="String">

+ 1 - 1
ruoyi-ui/src/views/cp/usrApply/index.vue

@@ -127,7 +127,7 @@
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
-    <el-table v-loading="loading" :data="applyList" @selection-change="handleSelectionChange" style="width: 100%">
+    <el-table v-loading="loading" :data="usrApplyList" @selection-change="handleSelectionChange" style="width: 100%">
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="参会人" align="center" prop="usrName" width="100" fixed />
       <el-table-column label="联系电话" align="center" prop="tel" width="100"  fixed />

+ 0 - 1
ruoyi-ui/src/views/system/config/index.vue

@@ -329,7 +329,6 @@ export default {
       this.$refs["form"].validate(valid => {
         if (valid) {
           if (this.form.configId != undefined) {
-            debugger
             updateConfig(this.form).then(response => {
               this.$modal.msgSuccess("修改成功");
               this.open = false;