Selaa lähdekoodia

1.修改企微的权限校验

jzp 2 päivää sitten
vanhempi
commit
ecb915d21f

+ 1 - 0
fs-company/src/main/java/com/fs/company/controller/course/FsCourseWatchLogController.java

@@ -225,6 +225,7 @@ public class FsCourseWatchLogController extends BaseController
     {
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
         param.setCompanyId( loginUser.getCompany().getCompanyId());
+        param.setCompanyUserId( loginUser.getUser().getUserId());
         List<FsCourseWatchLogListVO> list = fsCourseWatchLogService.selectFsCourseWatchLogListVO(param);
         ExcelUtil<FsCourseWatchLogListVO> util = new ExcelUtil<FsCourseWatchLogListVO>(FsCourseWatchLogListVO.class);
         return util.exportExcel(list, "短链课程看课记录数据");

+ 4 - 2
fs-company/src/main/java/com/fs/company/controller/qw/QwExternalContactController.java

@@ -207,12 +207,14 @@ public class QwExternalContactController extends BaseController
         return getDataTable(list);
     }
 
+    @PreAuthorize("@ss.hasPermi('qw:externalContact:syncMyClient')")
     @Log(title = "同步我的企业微信客户", businessType = BusinessType.INSERT)
     @GetMapping("/syncMyExternalContact/{id}")
     public R  syncMyExternalContact(@PathVariable("id") Long id ) throws IOException {
         return qwExternalContactService.syncMyQwExternalContact(id);
     }
 
+    @PreAuthorize("@ss.hasPermi('qw:externalContact:syncNewClient')")
     @Log(title = "新客同步", businessType = BusinessType.INSERT)
     @GetMapping("/syncAddMyExternalContact/{id}")
     public R  syncAddMyExternalContact(@PathVariable("id") Long id ) throws IOException {
@@ -322,7 +324,7 @@ public class QwExternalContactController extends BaseController
         return qwExternalContactService.syncQwExternalContactUnassigned(qwExternalContact.getCorpId());
     }
 
-    @PreAuthorize("@ss.hasPermi('qw:externalContact:addTag')")
+    @PreAuthorize("@ss.hasPermi('qw:externalContact:addTag') or @ss.hasPermi('qw:externalContact:myAddTag') or @ss.hasPermi('qw:externalContact:deptAddTag')")
     @Log(title = "添加标签", businessType = BusinessType.UPDATE)
     @PostMapping("/addTag")
     public R addTag(@RequestBody QwExternalContactAddTagParam Param) throws JSONException {
@@ -339,7 +341,7 @@ public class QwExternalContactController extends BaseController
 
     }
 
-    @PreAuthorize("@ss.hasPermi('qw:externalContact:delTag')")
+    @PreAuthorize("@ss.hasPermi('qw:externalContact:delTag') or @ss.hasPermi('qw:externalContact:myDelTag') or @ss.hasPermi('qw:externalContact:deptDelTag')")
     @Log(title = "移除标签", businessType = BusinessType.UPDATE)
     @PostMapping("/delTag")
     public R delTag(@RequestBody QwExternalContactAddTagParam Param)

+ 3 - 1
fs-company/src/main/java/com/fs/company/controller/qw/QwExternalContactInfoController.java

@@ -76,7 +76,7 @@ public class QwExternalContactInfoController extends BaseController
     /**
      * 修改外部联系人信息表
      */
-    @PreAuthorize("@ss.hasPermi('qw:externalContactInfo:edit')")
+    @PreAuthorize("@ss.hasPermi('qw:externalContactInfo:edit') or @ss.hasPermi('qw:externalContactInfo:myEdit') or @ss.hasPermi('qw:externalContactInfo:deptEdit')")
     @Log(title = "外部联系人信息表", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody QwExternalContactInfo qwExternalContactInfo)
@@ -98,6 +98,7 @@ public class QwExternalContactInfoController extends BaseController
 
 
 
+    @PreAuthorize("@ss.hasPermi('qw:externalContactInfo:updateTalk') or @ss.hasPermi('qw:externalContactInfo:myUpdateTalk') or @ss.hasPermi('qw:externalContactInfo:deptUpdateTalk')")
     @Log(title = "更改外部联系人信息表", businessType = BusinessType.UPDATE)
     @PutMapping("/editTalk/{ids}")
     public AjaxResult editTalk(@PathVariable Long[] ids)
@@ -105,6 +106,7 @@ public class QwExternalContactInfoController extends BaseController
         return toAjax(qwExternalContactInfoService.updateQwExternalContactInfoByIds(ids));
     }
 
+    @PreAuthorize("@ss.hasPermi('qw:externalContactInfo:updateAllTalk') or @ss.hasPermi('qw:externalContactInfo:myUpdateAllTalk') or @ss.hasPermi('qw:externalContactInfo:deptUpdateAllTalk')")
     @Log(title = "更改外部联系人信息表", businessType = BusinessType.UPDATE)
     @PutMapping("/editAllTalk/{id}")
     public AjaxResult editAllTalk(@PathVariable Long id)

+ 20 - 0
fs-company/src/main/java/com/fs/company/controller/qw/QwSopController.java

@@ -184,6 +184,26 @@ public class QwSopController extends BaseController
         return util.exportExcel(list, "企微sop数据");
     }
 
+    /**
+     * 我的企微导出sop
+     * @param qwSop
+     * @return
+     */
+    @PreAuthorize("@ss.hasPermi('qw:sop:myExport')")
+    @Log(title = "我的企微sop", businessType = BusinessType.EXPORT)
+    @GetMapping("/myExport")
+    public AjaxResult myExport(QwSop qwSop)
+    {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        Long companyId = loginUser.getCompany().getCompanyId();
+        Long userId = loginUser.getUser().getUserId();
+        qwSop.setCompanyId(companyId);
+        qwSop.setUserId(userId);
+        List<QwSop> list = qwSopService.selectQwSopList(qwSop);
+        ExcelUtil<QwSop> util = new ExcelUtil<QwSop>(QwSop.class);
+        return util.exportExcel(list, "企微sop数据");
+    }
+
     /**
      * 获取企微sop详细信息
      */

+ 1 - 1
fs-service/src/main/java/com/fs/qw/mapper/QwExternalContactMapper.java

@@ -266,7 +266,7 @@ public interface QwExternalContactMapper extends BaseMapper<QwExternalContact> {
             "            <if test=\"eTime != null \">  and DATE(ec.create_time) &lt;= DATE(#{eTime})</if>\n" +
             "            <if test=\"companyUserName != null  and companyUserName != ''\"> and cu.user_name = #{companyUserName}</if>\n" +
             "            <if test=\"cuDeptIdList != null and !cuDeptIdList.isEmpty() and  userType != '00' \">" +
-            "               AND cur.dept_id IN " +
+            "               AND cu.dept_id IN " +
             "                   <foreach collection='cuDeptIdList' item='item' open='(' separator=',' close=')'> " +
             "                       #{item} " +
             "                   </foreach> " +

+ 14 - 1
fs-service/src/main/java/com/fs/sop/service/impl/QwSopServiceImpl.java

@@ -7,6 +7,7 @@ import com.fs.common.enums.DataSourceType;
 import com.fs.common.exception.base.BaseException;
 import com.fs.common.utils.PubFun;
 import com.fs.common.utils.StringUtils;
+import com.fs.company.domain.CompanyUser;
 import com.fs.company.mapper.CompanyUserMapper;
 import com.fs.company.vo.CompanyQwUserByIdsVo;
 import com.fs.course.mapper.FsCourseWatchLogMapper;
@@ -142,7 +143,19 @@ public class QwSopServiceImpl implements IQwSopService
     @Override
     public List<QwSop> selectQwSopList(QwSop qwSop)
     {
-        return qwSopMapper.selectQwSopList(qwSop);
+        List<QwSop> qwSopList = qwSopMapper.selectQwSopList(qwSop);
+        if(qwSop != null && qwSop.getUserId() != null){
+            CompanyUser companyUser = companyUserMapper.selectCompanyUserById(qwSop.getUserId());
+            String qwUserId = companyUser.getQwUserId();
+            List<QwSop> arrayList = new ArrayList<>();
+            qwSopList.forEach(m -> {
+                if(qwUserId.contains(m.getQwUserIds())){
+                    arrayList.add(m);
+                }
+            });
+            qwSopList = arrayList;
+        }
+        return qwSopList;
     }
 
     @Override