中扬CRM客户关系管理系统
#
LSH
2023-11-02 bd5ab921857b0871f7b7f5b96408dae7239c13a0
#
5个文件已修改
101 ■■■■ 已修改文件
src/main/java/com/zy/crm/manager/controller/CstmrController.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/crm/manager/mapper/CstmrMapper.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/crm/manager/service/CstmrService.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/crm/manager/service/impl/CstmrServiceImpl.java 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/CstmrMapper.xml 64 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/crm/manager/controller/CstmrController.java
@@ -119,6 +119,7 @@
            }
        }
        Long director = null;
        if (deptId==null && userId == null){
            if (getRole().getId()==3){
                userId = getUserId();
@@ -126,12 +127,14 @@
                deptId = getDeptId();
                userId = null;
            }
            director = getUserId();
        }
        return R.ok(cstmrService.getPage3(new Page<>(curr, limit)
                , getHostId()
                , deptId == null ? null : String.valueOf(deptId)
                , userId
                , director
                , Cools.isEmpty(followerName) ? null : ids
                , conditionName
                , condition)
@@ -172,6 +175,7 @@
            }
        }
        Long director = null;
        if (deptId==null && userId == null){
            if (getRole().getId()==3){
                userId = getUserId();
@@ -179,12 +183,14 @@
                deptId = getDeptId();
                userId = null;
            }
            director = getUserId();
        }
        return R.ok(cstmrService.getPage33(new Page<>(curr, limit)
                , getHostId()
                , deptId == null ? null : String.valueOf(deptId)
                , userId
                , director
                , Cools.isEmpty(followerName) ? null : ids
                , conditionName
                , condition)
src/main/java/com/zy/crm/manager/mapper/CstmrMapper.java
@@ -18,10 +18,10 @@
    Cstmr selectCstmrByNewestUuid(@Param("hostId") Long hostId);
    List<Cstmr> listByPage2(Page<Cstmr> page, @Param("hostId")Long hostId, @Param("deptId") Long deptId, @Param("userId") Long userId,@Param("roleId") Long roleId, @Param("conditionName") String conditionName ,@Param("condition") String condition);
    List<Cstmr> listByPage1(Page<Cstmr> page, @Param("hostId")Long hostId, @Param("deptId") String deptId, @Param("userId") Long userId, @Param("conditionName") String conditionName ,@Param("condition") String condition);
    List<Cstmr> listByPage11(Page<Cstmr> page, @Param("hostId")Long hostId, @Param("deptId") String deptId, @Param("userId") Long userId, @Param("conditionName") String conditionName ,@Param("condition") String condition);
    List<Cstmr> listByPage3(Page<Cstmr> page, @Param("hostId")Long hostId, @Param("deptId") String deptId, @Param("userId") Long userId,@Param("cstmrIds") List<Integer> cstmrIds, @Param("conditionName") String conditionName ,@Param("condition") String condition);
    List<Cstmr> listByPage33(Page<Cstmr> page, @Param("hostId")Long hostId, @Param("deptId") String deptId, @Param("userId") Long userId,@Param("cstmrIds") List<Integer> cstmrIds, @Param("conditionName") String conditionName ,@Param("condition") String condition);
    List<Cstmr> listByPage1(Page<Cstmr> page, @Param("hostId")Long hostId, @Param("deptId") String deptId, @Param("userId") Long userId,@Param("director")Long director, @Param("conditionName") String conditionName ,@Param("condition") String condition);
    List<Cstmr> listByPage11(Page<Cstmr> page, @Param("hostId")Long hostId, @Param("deptId") String deptId, @Param("userId") Long userId,@Param("director")Long director, @Param("conditionName") String conditionName ,@Param("condition") String condition);
    List<Cstmr> listByPage3(Page<Cstmr> page, @Param("hostId")Long hostId, @Param("deptId") String deptId, @Param("userId") Long userId,@Param("director")Long director,@Param("cstmrIds") List<Integer> cstmrIds, @Param("conditionName") String conditionName ,@Param("condition") String condition);
    List<Cstmr> listByPage33(Page<Cstmr> page, @Param("hostId")Long hostId, @Param("deptId") String deptId, @Param("userId") Long userId,@Param("director")Long director,@Param("cstmrIds") List<Integer> cstmrIds, @Param("conditionName") String conditionName ,@Param("condition") String condition);
    List<Cstmr> listByPage(Page<Cstmr> page, @Param("hostId")Long hostId, @Param("deptId") String deptId, @Param("userId") Long userId,@Param("condition") String condition);
    List<Cstmr> listByPageCstmr2(Page<Cstmr> page, @Param("hostId")Long hostId, @Param("deptId") String deptId, @Param("userId") Long userId,@Param("condition") String condition);
src/main/java/com/zy/crm/manager/service/CstmrService.java
@@ -3,6 +3,7 @@
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.IService;
import com.zy.crm.manager.entity.Cstmr;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -13,9 +14,9 @@
    String getUuid(Long hostId);
    Page<Cstmr> getPage2(Page<Cstmr> page, Long hostId, Long deptId, Long userId,Long roleId, String conditionName, String condition);
    Page<Cstmr> getPage1(Page<Cstmr> page, Long hostId, String deptId, Long userId, String conditionName, String condition);
    Page<Cstmr> getPage3(Page<Cstmr> page, Long hostId, String deptId, Long userId, List<Integer> cstmrIds, String conditionName, String condition);
    Page<Cstmr> getPage33(Page<Cstmr> page, Long hostId, String deptId, Long userId, List<Integer> cstmrIds, String conditionName, String condition);
    Page<Cstmr> getPage1(Page<Cstmr> page, Long hostId, String deptId, Long userId,Long director, String conditionName, String condition);
    Page<Cstmr> getPage3(Page<Cstmr> page, Long hostId, String deptId, Long userId,Long director, List<Integer> cstmrIds, String conditionName, String condition);
    Page<Cstmr> getPage33(Page<Cstmr> page, Long hostId, String deptId, Long userId,Long director, List<Integer> cstmrIds, String conditionName, String condition);
    Page<Cstmr> getPage(Page<Cstmr> page, Long hostId, String deptId, Long userId,  String condition);
    Page<Cstmr> getPageCstmr2(Page<Cstmr> page, Long hostId, String deptId, Long userId,  String condition);
src/main/java/com/zy/crm/manager/service/impl/CstmrServiceImpl.java
@@ -47,25 +47,25 @@
    }
    @Override
    public Page<Cstmr> getPage1(Page<Cstmr> page, Long hostId, String deptId, Long userId,String conditionName,  String condition) {
        return page.setRecords(baseMapper.listByPage1(page, hostId, deptId, userId,conditionName, condition));
    public Page<Cstmr> getPage1(Page<Cstmr> page, Long hostId, String deptId, Long userId,  Long director, String conditionName,  String condition) {
        return page.setRecords(baseMapper.listByPage1(page, hostId, deptId, userId, director, conditionName, condition));
    }
    @Override
    public Page<Cstmr> getPage3(Page<Cstmr> page, Long hostId, String deptId, Long userId, List<Integer> cstmrIds, String conditionName, String condition) {
    public Page<Cstmr> getPage3(Page<Cstmr> page, Long hostId, String deptId, Long userId,  Long director, List<Integer> cstmrIds, String conditionName, String condition) {
        if (cstmrIds==null){
            return page.setRecords(baseMapper.listByPage1(page, hostId, deptId, userId,conditionName, condition));
            return page.setRecords(baseMapper.listByPage1(page, hostId, deptId, userId,  director,conditionName, condition));
        }else {
            return page.setRecords(baseMapper.listByPage3(page, hostId, deptId, userId,cstmrIds,conditionName, condition));
            return page.setRecords(baseMapper.listByPage3(page, hostId, deptId, userId,  director,cstmrIds,conditionName, condition));
        }
    }
    @Override
    public Page<Cstmr> getPage33(Page<Cstmr> page, Long hostId, String deptId, Long userId, List<Integer> cstmrIds, String conditionName, String condition) {
    public Page<Cstmr> getPage33(Page<Cstmr> page, Long hostId, String deptId, Long userId,  Long director, List<Integer> cstmrIds, String conditionName, String condition) {
        if (cstmrIds==null){
            return page.setRecords(baseMapper.listByPage11(page, hostId, deptId, userId,conditionName, condition));
            return page.setRecords(baseMapper.listByPage11(page, hostId, deptId, userId, director,conditionName, condition));
        }else {
            return page.setRecords(baseMapper.listByPage33(page, hostId, deptId, userId,cstmrIds,conditionName, condition));
            return page.setRecords(baseMapper.listByPage33(page, hostId, deptId, userId, director,cstmrIds,conditionName, condition));
        }
    }
src/main/resources/mapper/CstmrMapper.xml
@@ -170,14 +170,11 @@
                and
                (
                <if test="userId != null and userId != ''">
                    user_id = #{userId}
                    mc.mp.user_id = #{userId}
                    or
                    mc.mp.director = #{userId}
                    or
                </if>
                <if test="userId == null or userId == ''">
                    user_id is not null
                </if>
                or
                director = #{userId}
                or
                mc.id in
                (
                select
@@ -240,6 +237,9 @@
                </if>
            </otherwise>
        </choose>
        <if test="director != null and director != ''">
            or mc.director = #{director}
        </if>
        ORDER BY mc.create_time DESC
    </select>
@@ -256,7 +256,7 @@
                (CHARINDEX(','+#{deptId}+',', ','+sd.path+',') > 0 OR sd.id = #{deptId})
                or
                (
                user_id = #{userId}
                mc.user_id = #{userId}
                or
                mc.id in
                (
@@ -273,14 +273,11 @@
                and
                (
                <if test="userId != null and userId != ''">
                    user_id = #{userId}
                    mc.mp.user_id = #{userId}
                    or
                    mc.mp.director = #{userId}
                    or
                </if>
                <if test="userId == null or userId == ''">
                    user_id is not null
                </if>
                or
                director = #{userId}
                or
                mc.id in
                (
                select
@@ -343,6 +340,9 @@
                </if>
            </otherwise>
        </choose>
        <if test="director != null and director != ''">
            or mc.director = #{director}
        </if>
        ORDER BY mc.create_time DESC
    </select>
@@ -445,14 +445,11 @@
                and
                (
                <if test="userId != null and userId != ''">
                    user_id = #{userId}
                    mc.mp.user_id = #{userId}
                    or
                    mc.mp.director = #{userId}
                    or
                </if>
                <if test="userId == null or userId == ''">
                    user_id is not null
                </if>
                or
                director = #{userId}
                or
                mc.id in
                (
                select
@@ -521,12 +518,13 @@
                </if>
            </otherwise>
        </choose>
        <if test="director != null and director != ''">
            or mc.director = #{director}
        </if>
        ORDER BY mc.create_time DESC
    </select>
    <select id="listByPage3" resultMap="BaseResultMap">
    <select id="listByPage33" resultMap="BaseResultMap">
        SELECT
        mc.*
        FROM man_cstmr mc
@@ -556,14 +554,11 @@
                and
                (
                <if test="userId != null and userId != ''">
                    user_id = #{userId}
                    mc.mp.user_id = #{userId}
                    or
                    mc.mp.director = #{userId}
                    or
                </if>
                <if test="userId == null or userId == ''">
                    user_id is not null
                </if>
                or
                director = #{userId}
                or
                mc.id in
                (
                select
@@ -632,8 +627,9 @@
                </if>
            </otherwise>
        </choose>
        <if test="director != null and director != ''">
            or mc.director = #{director}
        </if>
        ORDER BY mc.create_time DESC
    </select>