修改需求

This commit is contained in:
liuxi 2021-06-18 18:45:15 +08:00
parent 303ca75743
commit f9dbd1956d
3 changed files with 918 additions and 907 deletions

View File

@ -37,6 +37,6 @@ public interface ProjectMapper extends MyMapper<Project> {
* @param status
* @return
*/
public void updateProjectStatus(String id, String contractno, int status, String endTime);
public void updateProjectStatus(String setuptime,String id, String contractno, int status, String updatetime);
}

View File

@ -194,7 +194,8 @@ public class ProjectServiceImpl implements ProjectService {
List<String> csrIds = StringUtils.isNotBlank(project.getCsrIds()) ? Arrays.asList(project.getCsrIds().split(",")) : new ArrayList<>();
boolean allowModify = (project != null && project.getStatus() != null && project.getStatus() != 0); // 0为作废状态不给修改
if(allowModify)allowModify = StringUtils.equals(user.getUsername(), project.getCreateUserId()) || fzrIds.contains(user.getUsername());
if (allowModify)
allowModify = StringUtils.equals(user.getUsername(), project.getCreateUserId()) || fzrIds.contains(user.getUsername());
project.setAllowModify(allowModify); // 是否有修改权限
List<Map<String, Object>> fzrMap = qywxUserMapper.getUserInfoByUserIds(fzrIds);
@ -386,6 +387,7 @@ public class ProjectServiceImpl implements ProjectService {
/**
* 发送新建项目通知
*
* @param p 项目参数
* @param fzrNames 负责人姓名多个用英文逗号分隔
* @param toUser 接收人的userId, 多个用|隔开
@ -977,10 +979,16 @@ public class ProjectServiceImpl implements ProjectService {
throw new ParameterException("合同号不能为空");
}
Date endTime = null;
if (status.equals("3")){
endTime = new Date();
String setuptime = null;
String updatetime = null;
if (status.equals("1")) {
//如果任务已经结束改成运行中重置结束时间
setuptime = "1";
} else if (status.equals("3")) {
//任务结束修改时间
updatetime = "1";
}
mapper.updateProjectStatus(id, contractno, Integer.parseInt(status),DateUtil.date2String(new Date(),DateUtil.PATTERN_STANDARD));
mapper.updateProjectStatus(setuptime, id, contractno, Integer.parseInt(status),updatetime);
}
@Override

View File

@ -147,7 +147,10 @@
<if test="contractno != null and contractno != ''">
_contractno = #{contractno},
</if>
<if test="endTime != null and endTime != ''">
<if test="setuptime != null and setuptime != ''">
_end_time = NULL,
</if>
<if test="updatetime != null and updatetime != ''">
_end_time = NOW(),
</if>
_status = #{status} where id = #{id}