Merge pull request 'feature-zrx' (#33) from feature-zrx into develop
Reviewed-on: #33 Reviewed-by: 筱锋xiao_lfeng <gm@x-lf.cn>
This commit is contained in:
commit
24c45812e8
|
@ -64,6 +64,7 @@ public class ProjectDailyServiceImpl implements ProjectDailyService {
|
||||||
Processing.copyProperties(projectDailyAddVO, projectDailyDO);
|
Processing.copyProperties(projectDailyAddVO, projectDailyDO);
|
||||||
projectDailyDO.setUserId(userId);
|
projectDailyDO.setUserId(userId);
|
||||||
projectDailyDO.setProjectId(Long.valueOf(projectDailyAddVO.getProjectId()));
|
projectDailyDO.setProjectId(Long.valueOf(projectDailyAddVO.getProjectId()));
|
||||||
|
projectDailyDO.setDailyTime(Processing.convertStringToDate(projectDailyAddVO.getDailyTime()));
|
||||||
|
|
||||||
// 向数据库添加数据
|
// 向数据库添加数据
|
||||||
projectDailyDAO.addProjectDaily(projectDailyDO);
|
projectDailyDAO.addProjectDaily(projectDailyDO);
|
||||||
|
@ -132,8 +133,15 @@ public class ProjectDailyServiceImpl implements ProjectDailyService {
|
||||||
public BaseResponse deleteDaily(Integer dailyId, HttpServletRequest request) {
|
public BaseResponse deleteDaily(Integer dailyId, HttpServletRequest request) {
|
||||||
|
|
||||||
Long userId = Processing.getAuthHeaderToUserId(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);
|
return ResultUtil.error(ErrorCode.User_NOT_PROJECT_PRINCIPAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,11 +54,9 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
<select id="getDailyById" parameterType="java.lang.Integer"
|
<select id="getDailyById" parameterType="java.lang.Integer" resultType="com.jsl.oa.model.dodata.ProjectDailyDO">
|
||||||
resultType="com.jsl.oa.model.dodata.ProjectDailyDO">
|
|
||||||
select * from organize_oa.oa_project_daily
|
select * from organize_oa.oa_project_daily
|
||||||
where id = #{id}
|
where id = #{id} and is_delete = 0
|
||||||
and is_delete = 0
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<delete id="deleteDailyById" parameterType="java.lang.Integer">
|
<delete id="deleteDailyById" parameterType="java.lang.Integer">
|
||||||
|
|
Loading…
Reference in New Issue
Block a user