作者主页:源码空间站2022
简介:Java领域优质创作者、Java项目、学习资料、技术互助
文末获取源码
项目介绍
该项目为后管系统,主要功能包括:
看板、业务机会管理、客户管理、联系人管理、我的日报、团队日报、主数据管理:组织架构管理;系统管理:用户管理、角色管理、菜单管理等;
环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可
4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;
5.数据库:MySql 5.7版本;
6.是否Maven项目:是;
技术栈
1. 后端:SpringBoot+mybatis
2. 前端:FreeMarker+Angular+bootstrap+echarts+jQuery
使用说明
1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;
2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;
若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行;
3. 将项目中application-powerteam.yml配置文件中的数据库配置改为自己的配置;
4. 前台访问路径:http://localhost:8080/
登录账号:admin 登录密码:admin
运行截图
代码相关
活动管理控制器
@Controller
@RequestMapping("/activity")
public class ActivityController extends AuthorizedController {
@Autowired
private ActivityService activityService;
@Autowired
private OrgUnitService orgUnitService;
@RequestMapping(value = "/add", method = RequestMethod.POST)
@ResponseBody
public Result add(@RequestBody Activity activity) {
activity.setCreateBy(getUser().getUserId());
return activityService.insert(activity);
}
@RequestMapping(value = "/find", method = RequestMethod.POST)
@ResponseBody
public PageInfo<Activity> find(@RequestBody QueryActivityVo vo) {
return activityService.find(vo);
}
@RequestMapping(value = "/findMyDailyReport", method = RequestMethod.POST)
@ResponseBody
public PageInfo<Activity> findMyDailyReport(@RequestBody QueryActivityVo vo) {
List<Integer> createBy = new ArrayList<>();
createBy.add(getUser().getUserId());
vo.setCreateBy(createBy);
return activityService.find(vo);
}
@RequestMapping(value = "/findTeamDailyReport", method = RequestMethod.POST)
@ResponseBody
public PageInfo<Activity> findTeamDailyReport(@RequestBody QueryActivityVo vo) {
List<Integer> subordinate = orgUnitService.findSubordinate(getUser().getUserId());
vo.setCreateBy(subordinate);
return activityService.find(vo);
}
@RequestMapping(value = "/delete", method = RequestMethod.POST)
@ResponseBody
public Result delete(@RequestBody Activity activity) {
return activityService.delete(activity);
}
}
活动逻辑
@Service
public class ActivityService {
@Autowired
private ActivityMapper activityMapper;
@Transactional
public Result insert(Activity activity) {
if (activity.getCreateDate() == null) {
activity.setCreateDate(new Date());
}
Result result = new Result();
result.setSuccess(activityMapper.insert(activity) > 0);
return result;
}
public PageInfo<Activity> find(QueryActivityVo vo) {
if (!vo.isDisablePaging()) {
PageHelper.startPage(vo.getPageNum(), vo.getPageSize());
}
return new PageInfo<>(activityMapper.find(vo));
}
@Transactional
public Result deleteByResource(Activity activity) {
Result result = new Result();
try {
activityMapper.deleteByResource(activity);
result.setSuccess(true);
} catch (Exception e) {
e.printStackTrace();
}
return result;
}
@Transactional
public Result delete(Activity activity) {
return new Result(activityMapper.delete(activity) > 0);
}
}
日期工具类
public class DateUtil {
public static Date toStartDate(Date startDate) {
if (startDate != null) {
Calendar c = Calendar.getInstance();
c.setTime(startDate);
c.set(Calendar.HOUR_OF_DAY, 0);
c.set(Calendar.MINUTE, 0);
c.set(Calendar.SECOND, 0);
c.set(Calendar.MILLISECOND, 0);
startDate = c.getTime();
}
return startDate;
}
public static Date toEndDate(Date endDate) {
if (endDate != null) {
Calendar c = Calendar.getInstance();
c.setTime(endDate);
c.set(Calendar.HOUR_OF_DAY, 23);
c.set(Calendar.MINUTE, 59);
c.set(Calendar.SECOND, 59);
c.set(Calendar.MILLISECOND, 999);
endDate = c.getTime();
}
return endDate;
}
public static Date firstDayInMonth() {
Calendar c = Calendar.getInstance();
c.add(Calendar.MONTH, 0);
c.set(Calendar.DAY_OF_MONTH, 1);
return toStartDate(c.getTime());
}
public static Date lastDayInMonth() {
Calendar c = Calendar.getInstance();
c.set(Calendar.DAY_OF_MONTH, c.getActualMaximum(Calendar.DAY_OF_MONTH));
return toEndDate(c.getTime());
}
public static Date addDays(Date date, int days) {
Calendar c = Calendar.getInstance();
c.setTime(date);
c.add(c.DATE, days);
return c.getTime();
}
}
如果也想学习本系统,下面领取。回复:081springboot