千家信息网

Saas模式的crm项目模块是什么

发表于:2025-02-03 作者:千家信息网编辑
千家信息网最后更新 2025年02月03日,Saas模式的crm项目模块是什么,针对这个问题,这篇文章详细介绍了相对应的分析和解答,希望可以帮助更多想解决这个问题的小伙伴找到更简单易行的方法。最近做Saas模式的crm项目员工模块功能总结: 项
千家信息网最后更新 2025年02月03日Saas模式的crm项目模块是什么

Saas模式的crm项目模块是什么,针对这个问题,这篇文章详细介绍了相对应的分析和解答,希望可以帮助更多想解决这个问题的小伙伴找到更简单易行的方法。

最近做Saas模式的crm项目员工模块功能总结: 项目采用maven管理,分为多模块开发的模式,这样方便项目的拆分和开发,避免所有的功能都 揉合在一起,这也是公司里比较常见的开发模式。

  1. 基础组件的创建

maven多模块项目结构搭建


使用代码生成器生成相应的mapper ,domain以及用Velocity生成相应的 js、jsp controller query service serviceimpl 文件

2.高级查询分页
分页查询,参照以前项目发现,分页数据需要一个请求得到总共多少条数据,和当前分页的第几页和当前页的数据。应该封装一个分页的service方法queryPageDataByQuery;再mapper层查询发送两条sql完成。并且把查询结果封装成一个分页对象返回。创建PageList封装分页对象。很多数据都有查询要求,封装一个BaseQuery对象,作为查询条件的base类。

PageList对象

public class PageList {

private long total = 0;
private List rows = new ArrayList();

public long getTotal() {
return total;
}

public void setTotal(long total) {
this.total = total;
}

public List getRows() {
return rows;
}

public void setRows(List rows) {
this.rows = rows;
}
}

public PageList getByQuery(BaseQuery query) {
//创建封装数据的PageList对象
PageList pageList = new PageList();
//设置分页条件
Page page = PageHelper.startPage(query.getPage(),query.getRows());
//查询当前页的数据
List rows = getMapper().selectByQuery(query);
//获取总条目数
long total = page.getTotal();
//将数据封装到PageList对象中返回
pageList.setRows(rows);
pageList.setTotal(total);
return pageList;
}

在对应的xml里面



3.以及crud

@Controller@RequestMapping("/employee")public class EmployeeController {@Autowired    private IEmployeeService employeeService;    @RequestMapping("/index")public String index() {return "employee/employee";    }@RequestMapping("/getByid")@ResponseBody    public Employee getById(Long id){return employeeService.selectByPrimaryKey(id);    }@RequestMapping("/list")@ResponseBody//json    public PageResult list(EmployeeQuery employeeQuery) {return employeeService.selectForList(employeeQuery);    }@RequestMapping("/page")@ResponseBody    public PageResult page(@RequestBody String  qu){        EmployeeQuery query = JSONObject.parseObject(qu, EmployeeQuery.class);        return employeeService.selectForList(query);    }@RequestMapping("remove")@ResponseBody    public AjaxResult remove(Long id){        System.out.println(id);        try {employeeService.deleteByPrimaryKey(id);            return AjaxResult.success();        }catch (Exception e){            e.printStackTrace();            return AjaxResult.error("错了");        }    }@RequestMapping(value = "/saveUpdate",method = RequestMethod.POST)@ResponseBody    public AjaxResult saveUpdate(@RequestBody String  product){        Employee produ = JSONObject.parseObject(product, Employee.class);       /* System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");        System.out.println(produ.getAge());*/        try {if(produ.getId()==null){                Date date = new Date();                produ.setAddtime(date);                employeeService.insert(produ);            }else {                System.out.println("djeksdwdweferferferge");                System.out.println(produ.getInitiationtime());                System.out.println(produ.getAddtime());                employeeService.updateByPrimaryKey(produ);            }return AjaxResult.success();        }catch (Exception e){            e.printStackTrace();            return AjaxResult.error("错的");        }    }

mapper

                                                  delete from employee    where id = #{id,jdbcType=BIGINT}        insert into employee (username, password, age,       post_id, iphone, pay,       shop_id, Initiationtime, addtime      )    values (#{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}, #{age,jdbcType=INTEGER},       #{postId,jdbcType=VARCHAR}, #{iphone,jdbcType=INTEGER}, #{pay,jdbcType=INTEGER},       #{shopId,jdbcType=VARCHAR}, #{initiationtime,jdbcType=DATE}, #{addtime,jdbcType=DATE}      )        update employee    set username = #{username,jdbcType=VARCHAR},      password = #{password,jdbcType=VARCHAR},      age = #{age,jdbcType=INTEGER},      post_id = #{postId,jdbcType=VARCHAR},      iphone = #{iphone,jdbcType=INTEGER},      pay = #{pay,jdbcType=INTEGER},      shop_id = #{shopId,jdbcType=VARCHAR},      Initiationtime = #{initiationtime,jdbcType=DATE},      addtime = #{addtime,jdbcType=DATE}    where id = #{id,jdbcType=BIGINT}        

心得总结
项目中的收获
开始自主的思考代码 提高了自己对代码的理解
项目中遇到的问题
因为项目是使用了elementui 在因为之前不熟悉花费了大量时间 之中遇到使用el-date-picker日期组件在编辑中一直回显不了日期 百度了很久 发现是缺少了value-format="yyyy-MM-dd" 来改变 v-model上值的格式 加了以后回显就成功了

关于Saas模式的crm项目模块是什么问题的解答就分享到这里了,希望以上内容可以对大家有一定的帮助,如果你还有很多疑惑没有解开,可以关注行业资讯频道了解更多相关知识。

0