fix: 日报模块 添加接口

This commit is contained in:
xiangZr-hhh 2024-04-19 23:28:00 +08:00
parent 0719ecf538
commit 1197f77131
2 changed files with 11 additions and 5 deletions

View File

@ -64,6 +64,7 @@ public class ProjectDailyServiceImpl implements ProjectDailyService {
Processing.copyProperties(projectDailyAddVO, projectDailyDO);
projectDailyDO.setUserId(userId);
projectDailyDO.setProjectId(Long.valueOf(projectDailyAddVO.getProjectId()));
projectDailyDO.setDailyTime(Processing.convertStringToDate(projectDailyAddVO.getDailyTime()));
// 向数据库添加数据
projectDailyDAO.addProjectDaily(projectDailyDO);
@ -132,8 +133,15 @@ public class ProjectDailyServiceImpl implements ProjectDailyService {
public BaseResponse deleteDaily(Integer dailyId, HttpServletRequest request) {
Long userId = Processing.getAuthHeaderToUserId(request);
ProjectDailyDO projectDailyDO = projectDailyMapper.getDailyById(dailyId);
if (projectDailyDO == null) {
return ResultUtil.error(ErrorCode.PROJECT_DAILY_NOT_EXIST);
}
// 检查用户是否为项目负责人
if (!projectDAO.isPrincipalUser(userId, projectDailyMapper.getDailyById(dailyId).getProjectId())) {
if (!projectDAO.isPrincipalUser(userId, projectDailyDO.getProjectId())) {
return ResultUtil.error(ErrorCode.User_NOT_PROJECT_PRINCIPAL);
}

View File

@ -54,11 +54,9 @@
</select>
<select id="getDailyById" parameterType="java.lang.Integer"
resultType="com.jsl.oa.model.dodata.ProjectDailyDO">
<select id="getDailyById" parameterType="java.lang.Integer" resultType="com.jsl.oa.model.dodata.ProjectDailyDO">
select * from organize_oa.oa_project_daily
where id = #{id}
and is_delete = 0
where id = #{id} and is_delete = 0
</select>
<delete id="deleteDailyById" parameterType="java.lang.Integer">