為解決傳統高校科技管理工作中存在的信息失誤率高、傳遞速度緩慢等一系列缺陷,設計開發了基於Java EE的高校科技管理系統,為高校科技管理工作提供了極大的便利。同時還可以用於大創項目,政府類的創新類項目,科研類項目申報管理系統平臺,互聯網+項目申報系統。 ...
背景及意義
目前許多人仍將傳統的紙質工具作為信息管理的主要工具,而網路技術的應用只是起到輔助作用。在對網路工具的認知程度上,較為傳統的office軟體等仍是人們使用的主要工具,而相對全面且專業的信息管理軟體仍沒有得到大多數人的瞭解或認可。本選題則旨在通過標簽分類管理等方式,實現教研的各種功能,從而達到對科研管理系統的管理。
科研項目管理系統,以項目化管理為思想,以現實中管理制度為核心,對科研項目申報、項目開題、項目合同、實施進度、項目風險分析及控制計劃、項目經費、項目質量、項目文檔、科研成果等科研活動全面管理,實現科研項目“管理標準的沉澱優化、組織流程的優化、管理水平的提升、內外部資源整合的延伸”,保障科研項目完成與落實,出人才、出成果、出效益,提高競爭力。
主要功能
項目主要分為3個角色,分別是超級管理員,教師和學生,超級管理員具有項目所有的許可權,包括有用戶管理,角色管理,許可權管理,項目管理,申報管理,變更管理,結題管理,數據字典等功能;學生學生負責對項目的申報,變更,結題申請等,教師負責對學生提交的項目進行審核。
項目搭建環境
> java jdk版本:1.8及以上
> 後臺框架:java spring springmvc mybatis springbotoot等
> 前端框架:html css javascript vue等
> 開發工具: idea或者eclipse都可
> 資料庫: mysql 5.7及以上
> 伺服器: tomcat
> 更多內容可查看:http://projecthelp.top
部分核心代碼
import org.springframework.stereotype.Service;
import xyz.shiguangliang.mybatis.dao.UserMapper;
import xyz.shiguangliang.mybatis.domain.User;
import xyz.shiguangliang.service.UserService;
import xyz.shiguangliang.util.query.QueryInfo;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Objects;
@Service
public class UserServiceImpl implements UserService {
@Resource
private UserMapper userMapper;
//登錄
@Override
public User login(String username, String password) {
User user = userMapper.selectLogin(username,password);
if (user != null) {
//登錄次數加一
if (user.getIntimes() != null) {
user.setIntimes(user.getIntimes() + 1);
}else {
user.setIntimes(1);
}
//更新登錄時間
user.setLastlogin(new Date());
return user;
}
return null;
}
//註冊
@Override
public boolean register(User user) {
int i = 0;
//檢測用戶是否存在
User user1 = userMapper.selectUsername(user.getUsername());
if (user1 == null) {
i = userMapper.insert(user);
}
return i > 0;
}
//用戶列表
@Override
public QueryInfo getUserList(String query, Integer pagenum,Integer pagesize) {
QueryInfo queryInfo = new QueryInfo();
int start;
int end;
if (pagenum == null||pagesize == null){
pagenum =0;
pagesize = 3;
}
start = (pagenum-1)*pagesize;
end = pagesize;
int userSize = userMapper.selectUserListLimitSize(query,start,end);
List<User> users = userMapper.selectUserListLimit(query,start,end);
queryInfo.setList(users);
queryInfo.setTotal(userSize);
return queryInfo;
}
//刪除用戶
@Override
public int deleteUser(Integer tid) {
return userMapper.deleteByPrimaryKey(tid);
}
//通過id查找用戶
@Override
public User findById(Integer tid) {
return userMapper.selectByPrimaryKey(tid);
}
//更新用戶
@Override
public int updateUser(User user) {
if (user.getPassword()==null|| Objects.equals(user.getPassword(), "")){
user.setPassword(userMapper.selectByPrimaryKey(user.getTid()).getPassword());
}
return userMapper.updateByPrimaryKey(user);
}
//通過用戶名查找用戶
@Override
public User findByUsername(String username) {
return userMapper.selectUsername(username);
}
//獲取用戶許可權
@Override
public int getPower(String username) {
return userMapper.selectUsername(username).getPower();
}
}
useMapper.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="xyz.shiguangliang.mybatis.dao.UserMapper">
<resultMap id="BaseResultMap" type="xyz.shiguangliang.mybatis.domain.User">
<id column="tid" jdbcType="INTEGER" property="tid" />
<result column="username" jdbcType="VARCHAR" property="username" />
<result column="password" jdbcType="VARCHAR" property="password" />
<result column="teachername" jdbcType="VARCHAR" property="teachername" />
<result column="dno" jdbcType="INTEGER" property="dno" />
<result column="power" jdbcType="INTEGER" property="power" />
<result column="intimes" jdbcType="INTEGER" property="intimes" />
<result column="lastlogin" jdbcType="TIMESTAMP" property="lastlogin" />
</resultMap>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from teacher
where tid = #{tid,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="xyz.shiguangliang.mybatis.domain.User">
insert into teacher (tid, username, password,
teachername, dno, power,
intimes, lastlogin)
values (#{tid,jdbcType=INTEGER}, #{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},
#{teachername,jdbcType=VARCHAR}, #{dno,jdbcType=INTEGER}, #{power,jdbcType=INTEGER},
#{intimes,jdbcType=INTEGER}, #{lastlogin,jdbcType=TIMESTAMP})
</insert>
<update id="updateByPrimaryKey" parameterType="xyz.shiguangliang.mybatis.domain.User">
update teacher
set username = #{username,jdbcType=VARCHAR},
password = #{password,jdbcType=VARCHAR},
teachername = #{teachername,jdbcType=VARCHAR},
dno = #{dno,jdbcType=INTEGER},
power = #{power,jdbcType=INTEGER},
intimes = #{intimes,jdbcType=INTEGER},
lastlogin = #{lastlogin,jdbcType=TIMESTAMP}
where tid = #{tid,jdbcType=INTEGER}
</update>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select tid, username, password, teachername, dno, power, intimes, lastlogin
from teacher
where tid = #{tid,jdbcType=INTEGER}
</select>
<select id="selectAll" resultMap="BaseResultMap">
select tid, username, password, teachername, dno, power, intimes, lastlogin
from teacher
</select>
<select id="selectLogin" resultType="xyz.shiguangliang.mybatis.domain.User">
select tid, username, password, teachername, dno, power, intimes, lastlogin
from teacher
where username = #{username} and password = #{password}
</select>
<select id="selectUsername" resultType="xyz.shiguangliang.mybatis.domain.User">
select tid, username, password, teachername, dno, power, intimes, lastlogin
from teacher
where username = #{username}
</select>
<select id="selectUserListLimit" resultType="xyz.shiguangliang.mybatis.domain.User">
select tid, username, password, teachername, dno, power, intimes, lastlogin
from teacher
where
/*條件判斷*/
<if test="#{query} != null and #{query} != ''">
/*模糊查詢*/
<bind name="query2" value="'%' + query + '%'"/>
username like #{query2}
</if>
LIMIT #{start},#{end}
</select>
<select id="selectUserListLimitSize" resultType="java.lang.Integer">
select count(*)
from teacher
where
/*條件判斷*/
<if test="#{query} != null and #{query} != ''">
/*模糊查詢*/
<bind name="query2" value="'%' + query + '%'"/>
username like #{query2}
</if>
</select>
</mapper>
- Project實體類
@Entity
@Table(name = BaseEntity.TABLE_PREFIX + "PROJECT")
public class Project extends BaseEntity{
//項目名
@Column(name = "name",nullable = false)
private String name;
//項目級別
@Column(name = "level",nullable = false)
private String level;
//負責人
@Column(name = "user_name",nullable = false)
private String userName;
//成員
@Column(name = "memberJsons",nullable = false)
private String memberJsons;
//資金
@Fetch(FetchMode.SUBSELECT)
@OneToMany(cascade = CascadeType.ALL,fetch = FetchType.LAZY,targetEntity = Fund.class,mappedBy = "projectId")
private List<Fund> funds;
//項目結果類型
@Column(name = "achievement_type",nullable = false)
private String achievementType;
//開始時間
@Column(name = "begin_time",nullable = false)
private Date beginTime;
//學科
@Column(name = "subject",nullable = false)
private String subject;
//預期結果
@Column(name = "expected_result",nullable = false)
private String expectedResult;
//立項目的
@Column(name = "purpose",nullable = false)
private String purpose;
//研究方案可行性分析
@Column(name = "viable_analysis",nullable = false)
private String viableAnalysis;
//社會效益分析
@Column(name = "economic_analysis",nullable = false)
private String economicAnalysis;
//現有條件
@Column(name = "existing_conditions",nullable = false)
private String existingConditions;
//所屬學院
@Column(name = "college" , nullable = false)
private String college;
//項目狀態
@Column(name = "status",nullable = false)
private int status;
//是否可以修改
@Column(name = "can_update" )
private boolean canUpdate;
//是否可以申報
@Column(name = "can_application")
private boolean canApplication;
//是否可以結題
@Column(name = "can_conclude")
private boolean canConclude;
//創建人
@Column(name = "created_user",nullable = false)
private String createdUser;
}
項目實現類
@Service
public class ProjectApplicationServiceImpl extends BaseServiceImpl<ProjectApplication> implements IProjectApplicationService {
public ProjectApplicationServiceImpl(BaseRepository<ProjectApplication> repository) {
super(repository);
}
@Autowired
private ProjectApplicationRepository projectApplicationRepository;
@Autowired
private IProjectService projectService;
@Override
@Transactional
public ProjectApplication toApplication(ProjectApplication projectApplication) {
projectApplication.setStatus(ApplicationStatus.ON_APPLIACTION.getName());
projectApplication.setApplicant(CurrentUserUtils.getCurrentUser().getSecurityUserDto().getUserName());
projectApplication.setApplicateTime(new Date());
ProjectApplication savedPorjectAppication = projectApplicationRepository.save(projectApplication);
//項目申報中 項目申報 不可修改 不可申報 不可以申請變更 不可結題
projectService.changeStatus(projectApplication.getProjectId(), ProjectStatus.PROJECT_AUDIT);
return savedPorjectAppication;
}
@Override
@Transactional
public ProjectApplication applicationPass(ProjectApplication projectApplication) {
projectApplication.setStatus(ApplicationStatus.SUCCESS_APPLICATION.getName());
ProjectApplication updatedProjectApplication = projectApplicationRepository.save(projectApplication);
//未結題 結題之前的狀態 不可修改 不可以申報 可以申請變更 可以申請結題
projectService.changeStatus(projectApplication.getProjectId(),ProjectStatus.NOT_CONCLUSION);
return updatedProjectApplication;
}
@Override
public ProjectApplication applicationNotPass(ProjectApplication projectApplication) {
projectApplication.setStatus(ApplicationStatus.FAIL_APPLICATION.getName());
ProjectApplication updatedProjectApplication = projectApplicationRepository.save(projectApplication);
//申報失敗 等同草稿 可以修改 可以申報 不可以申請變更 不可以結題
projectService.changeStatus(projectApplication.getProjectId(),ProjectStatus.FAIL_PROJECT_AUDIT);
return updatedProjectApplication;
}
}
資料庫的設計
項目部分功能展示
- 登錄頁面
- 管理員功能
- 教師角色
- 學生角色