中扬CRM客户关系管理系统
#
luxiaotao1123
2022-11-08 fe5696abdee6482761a3d7097dbba4e19cea0cbb
#
5个文件已修改
15 ■■■■■ 已修改文件
src/main/java/com/zy/crm/manager/mapper/CstmrMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/crm/manager/service/CstmrService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/crm/manager/service/impl/CstmrServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/crm/system/controller/UserController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/CstmrMapper.xml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/crm/manager/mapper/CstmrMapper.java
@@ -19,4 +19,6 @@
    List<Cstmr> listByPage(Page<Cstmr> page, @Param("hostId")Long hostId, @Param("deptId") String deptId, @Param("userId") Long userId ,@Param("condition") String condition);
    int updateDeptIdByUserId(@Param("userId")Long userId, @Param("deptId")Long deptId);
}
src/main/java/com/zy/crm/manager/service/CstmrService.java
@@ -12,4 +12,6 @@
    Page<Cstmr> getPage(Page<Cstmr> page, Long hostId, String deptId, Long userId, String condition);
    int updateDeptIdByUserId(Long userId, Long deptId);
}
src/main/java/com/zy/crm/manager/service/impl/CstmrServiceImpl.java
@@ -44,6 +44,10 @@
        return page.setRecords(baseMapper.listByPage(page, hostId, deptId, userId, condition));
    }
    @Override
    public int updateDeptIdByUserId(Long userId, Long deptId) {
        return this.baseMapper.updateDeptIdByUserId(userId, deptId);
    }
    public static String zerofill(String msg, Integer count){
        if (msg.length() == count){
src/main/java/com/zy/crm/system/controller/UserController.java
@@ -11,6 +11,7 @@
import com.core.exception.CoolException;
import com.zy.crm.common.web.BaseController;
import com.zy.crm.manager.entity.result.KeyValueVo;
import com.zy.crm.manager.service.CstmrService;
import com.zy.crm.system.entity.Role;
import com.zy.crm.system.entity.User;
import com.zy.crm.system.service.RoleService;
@@ -28,6 +29,8 @@
    private UserService userService;
    @Autowired
    private RoleService roleService;
    @Autowired
    private CstmrService cstmrService;
    @RequestMapping(value = "/user/{id}/auth")
    @ManagerAuth
@@ -132,6 +135,7 @@
        User one = userService.selectById(user.getId());
        if (!one.getDeptId().equals(user.getDeptId())) {
            // todo: 修改关联数据的deptId字段
            cstmrService.updateDeptIdByUserId(user.getId(), user.getDeptId());
        }
        if (!userService.updateById(user)) {
            throw new CoolException("修改用户失败");
src/main/resources/mapper/CstmrMapper.xml
@@ -96,5 +96,8 @@
        ORDER BY mc.create_time DESC
    </select>
    <update id="updateDeptIdByUserId">
        update man_cstmr set dept_id = #{deptId} where user_id = #{userId}
    </update>
</mapper>