提交 b669e993 authored 作者: 任建宇's avatar 任建宇
......@@ -98,7 +98,7 @@ public class ProjectController {
QueryWrapper<StatisticsProject> qw = new QueryWrapper<StatisticsProject>();
if(id!=null) {
qw.ne("id", id);
qw.ne("project", projectName);
qw.eq("project", projectName);
}else {
if(StringUtils.isNotEmpty(id)) {
qw.eq("id", id);
......@@ -111,7 +111,7 @@ public class ProjectController {
if(list.size()>0) {
throw new BaseException("项目名已被占用,请换一个");
}
return CommonResult.success("1");
return CommonResult.success();
}
......
package com.zrqx.olive.project.dao;
import java.math.BigDecimal;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
......@@ -31,6 +32,14 @@ public interface TeamDao extends BaseMapper<Team> {
+ "</if>"
+ "</script>")
List<TeamVo> getProjectId(String projectId);
@Select("<script>"
+ "SELECT sum(allocate_surplus) FROM t_team where 1=1 "
// 项目ID
+ "<if test = 'projectId!=\"\" and projectId!=null '> "
+ " AND project_id = #{projectId} "
+ "</if>"
+ "</script>")
BigDecimal queryAllocateSurplus(String projectId);
......
......@@ -57,6 +57,8 @@ public class StatisticsProject {
private BigDecimal totalApplyTime;
@ApiModelProperty("待分配工时")
private BigDecimal toBeAllocated;
@ApiModelProperty("已分配剩余")
private BigDecimal allocateSurplus;
@ApiModelProperty(value = "部门Id")
private String departmentId;
}
......@@ -26,10 +26,12 @@ import com.zrqx.olive.project.dao.ProjectFileDao;
import com.zrqx.olive.project.dao.ProjectRecordDao;
import com.zrqx.olive.project.dao.ProjectUserDao;
import com.zrqx.olive.project.dao.StatisticsProjectDao;
import com.zrqx.olive.project.dao.TeamDao;
import com.zrqx.olive.project.model.Customer;
import com.zrqx.olive.project.model.ProjectFile;
import com.zrqx.olive.project.model.ProjectUser;
import com.zrqx.olive.project.model.StatisticsProject;
import com.zrqx.olive.project.model.Team;
import com.zrqx.olive.project.request.QueryProjectRequest;
import com.zrqx.olive.project.request.SaveProjectRequest;
import com.zrqx.olive.project.request.StatisticsProjectRequest;
......@@ -60,6 +62,9 @@ public class StatisticsProjectServiceImpl extends ServiceImpl<StatisticsProjectD
private TimeApplyChangeDao timeApplyChangeMapper;
@Autowired
private TaskService taskService;
@Autowired
private TeamDao teamDao;
@Override
public PageInfo<ProjectListVo> page(QueryProjectRequest form, PageParamRequest pageParamRequest) {
//开启分页
......@@ -80,11 +85,11 @@ public class StatisticsProjectServiceImpl extends ServiceImpl<StatisticsProjectD
}
//项目的剩余总工时
BigDecimal querySurplus = taskService.querySurplus(projectListVo.getId(),null,null);
if(querySurplus!=null) {
if(projectListVo.getTotal()!=null) {
projectListVo.setSurplus(projectListVo.getTotal().subtract(querySurplus));
}
}
projectListVo.setSurplus(querySurplus);
//已分配剩余工时
BigDecimal allocateSurplus = teamDao.queryAllocateSurplus(projectListVo.getId());
projectListVo.setAllocateSurplus(allocateSurplus);
}
return CommonPage.copyPageInfo(startPage, list);
}
......
......@@ -59,14 +59,13 @@ public class TeamServiceImpl extends ServiceImpl<TeamDao, Team> implements Team
List<Team> list = teamDao.selectList(qw);
if(list.size()>0) {
for (Team team : list) {
//已完成
BigDecimal consume=taskService.queryConsume(team.getProjectId(),null,team.getDepartmentId(),null);
if(consume!=null) {
team.setConsume(consume);
}
//未完成
BigDecimal querySurplus = taskService.querySurplus(team.getProjectId(),null,team.getDepartmentId());
if(querySurplus!=null) {
team.setSurplus(team.getTotal().subtract(querySurplus));
}
team.setSurplus(querySurplus);
TeamRequest aqr = new TeamRequest();
BeanUtils.copyProperties(team, aqr);
aqr.setUploadTime(DateUtils.dateTimeToStr(team.getUploadTime()));
......@@ -132,6 +131,7 @@ public class TeamServiceImpl extends ServiceImpl<TeamDao, Team> implements Team
relation.setDepartmentId(dept.getId());
relation.setProjectId(saveTeamRequest.getProjectId());
relation.setTeamId(team.getId());
relation.setUploadTime(new Date());
dao.insert(relation);
}else {
SystemRole role = roleDao.selectById(adminList.get(i).getRoles());
......@@ -141,6 +141,7 @@ public class TeamServiceImpl extends ServiceImpl<TeamDao, Team> implements Team
relation.setDepartmentId(dept.getId());
relation.setProjectId(saveTeamRequest.getProjectId());
relation.setTeamId(team.getId());
relation.setUploadTime(new Date());
dao.updateById(relation);
}
}
......
......@@ -37,4 +37,6 @@ public class ProjectListVo {
private BigDecimal surplus;
@ApiModelProperty("待分配")
private BigDecimal toBeAllocated;
@ApiModelProperty("已分配剩余")
private BigDecimal allocateSurplus;
}
......@@ -112,7 +112,7 @@ public class TaskController {
@Validated PageParamRequest pageParamRequest) {
return CommonResult.success(CommonPage.restPage(taskService.getpage(taskRequest, pageParamRequest)));
}
@ApiOperation(value = "历史记录")
@RequestMapping(value = "/recordlist", method = RequestMethod.GET)
@ApiImplicitParam(name = "record", value = "搜索历史记录")
......@@ -120,7 +120,11 @@ public class TaskController {
List<TaskRecordVo> list = taskRecordService.getList(taskRecordRequest);
return CommonResult.success(list);
}
@ApiOperation(value = "总工时")
@RequestMapping(value = "/totalTime", method = RequestMethod.GET)
public CommonResult<BigDecimal> totalTime(@Validated TaskRequest taskRequest) {
return CommonResult.success(taskService.totalTime(taskRequest));
}
/**
* 新增任务管理表
*
......
......@@ -194,7 +194,7 @@ public interface TaskDao extends BaseMapper<Task> {
BigDecimal queryConsume(String id,Integer userId,Integer departmentId,String presale);
@Select("<script>"
+ " select sum(working_hours) FROM t_task a where 1=1 "
+ " and (task_status=1 or task_status=2 or task_status=3)"
+ " and task_status=1 "
+ "<if test = 'id!=null and id!=\"\"'> "
+ " AND a.project_id = #{id} "
+ "</if>"
......@@ -204,6 +204,74 @@ public interface TaskDao extends BaseMapper<Task> {
+ "<if test = 'userId!=null and userId!=\"\"'> "
+ " AND a.user_id = #{userId} "
+ "</if>"
+ "<if test = 'departmentId ==null and departmentId==\"\"'> "
+ " and department_id is not null "
+ "</if>"
+ "</script>")
BigDecimal querySurplus(String id,Integer userId,Integer departmentId);
@Select("<script>"
+ "select tt.* from (SELECT SUM(working_hours),(select real_name from eb_system_admin c where a.user_id = c.id) userName FROM t_task a INNER JOIN t_statistics_project b on a.project_id = b.id where 1 = 1 "
+ "<if test = 'request.code!=null'> "
+ " AND code like concat(#{request.code},'%') "
+ "</if>"
+ "<if test = 'request.taskName!=null'> "
+ " AND task_name like concat(#{request.taskName},'%') "
+ "</if>"
+ "<if test = 'request.taskType!=null'> "
+ " AND task_type = #{request.taskType} "
+ "</if>"
+ "<if test = 'request.status!=null'> "
+ " AND a.status = #{request.status} "
+ "</if>"
+ "<if test = 'request.id!=null'> "
+ " AND a.id like concat(#{request.id},'%') "
+ "</if>"
+ "<if test = 'request.projectId!=null'> "
+ " AND a.project_id = #{request.projectId} "
+ "</if>"
+ "<if test = 'request.salesProjectId!=null'> "
+ " AND a.sales_project_id = #{request.salesProjectId} "
+ "</if>"
+ "<if test = 'request.taskStatus == 4'> "
+ " AND task_status != 0 "
+ "</if>"
+ "<if test = 'request.taskStatus == 5'> "
+ " AND complete_Time &gt; #{request.endTime} "
+ "</if>"
+ "<if test = 'request.taskStatus == 1'> "
+ " AND task_status = #{request.taskStatus} "
+ "</if>"
+ "<if test = 'request.taskStatus == 2'> "
+ " AND task_status = #{request.taskStatus} "
+ "</if>"
+ "<if test = 'request.taskStatus == 3'> "
+ " AND task_status = #{request.taskStatus} "
+ "</if>"
+ "<if test = 'request.taskStatus == 0'> "
+ " AND task_status = #{request.taskStatus} "
+ "</if>"
+ "<if test = 'request.bugStatus!=null'> "
+ " AND bug_status = #{request.bugStatus} "
+ "</if>"
+ "<if test = 'request.userId!=null'> "
+ " AND a.user_id = #{request.userId} "
+ "</if>"
+ "<if test = 'request.taskDescription!=null'> "
+ " AND task_description like concat('%',#{request.taskDescription},'%') "
+ "</if>"
+ "<if test='request.ids != null and request.ids.size > 0'>"
+ "and a.id in "
+ " <foreach collection=\"request.ids\" index=\"index\" item=\"id\" open=\"(\" separator=\",\" close=\")\">"
+ "#{id}"
+ "</foreach>"
+ "</if>"
+ " ) tt"
+ "<if test = 'request.userName!=null'> "
+ " where tt.userName like concat('%',#{request.userName},'%') "
+ "</if>"
+ "</script>")
BigDecimal totalTime(@Param("request")TaskRequest request);
}
......@@ -10,6 +10,7 @@ import org.springframework.web.multipart.MultipartFile;
import com.baomidou.mybatisplus.extension.service.IService;
import com.common.CommonResult;
import com.common.MyRecord;
import com.common.PageParamRequest;
import com.github.pagehelper.PageInfo;
import com.utils.excelutil.BaseException;
......@@ -47,4 +48,6 @@ public interface TaskService extends IService<Task> {
BigDecimal queryConsume(String id,Integer userId,Integer departmentId,String presale);
BigDecimal querySurplus(String id,Integer userId,Integer departmentId);
BigDecimal totalTime(TaskRequest taskRequest);
}
......@@ -99,6 +99,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskDao, Task> implements TaskS
Page<Task> taskPage = PageHelper.startPage(pageParamRequest.getPage(), pageParamRequest.getLimit(),
pageParamRequest.getOrderBy());
List<TaskVo> taskVo = dao.page(request);
return CommonPage.copyPageInfo(taskPage, taskVo);
}
......@@ -273,4 +274,10 @@ public class TaskServiceImpl extends ServiceImpl<TaskDao, Task> implements TaskS
return dao.querySurplus(id,userId,departmentId);
}
@Override
public BigDecimal totalTime(TaskRequest taskRequest) {
// TODO Auto-generated method stub
return dao.totalTime(taskRequest);
}
}
......@@ -111,6 +111,9 @@ public class TaskVo implements Serializable {
@ApiModelProperty(value = "创建时间")
private String updateTime;
@ApiModelProperty(value = "总工时")
private String totalTime;
@ApiModelProperty("附件")
private List<ProjectFile> file;
}
server:
port: 8419
port: 8488
domain: # 待部署域名
version: CRMEB-JAVA-v1.3.3 # 当前代码版本
asyncConfig: false
......@@ -14,6 +14,8 @@ default:
import-error-path: /opt/import/error/
spring:
resources:
static-locations: classpath:/static/,classpath:/META-INF/resources/,file:/opt/upload/tasktime/
application:
name: olive
mvc:
......
......@@ -8,7 +8,7 @@
"imageCompressEnable": true, /* 是否压缩图片,默认是true */
"imageCompressBorder": 1600, /* 图片压缩最长边限制 */
"imageInsertAlign": "none", /* 插入的图片浮动方式 */
"imageUrlPrefix": "http://192.168.2.190/:2000/file/", /* 图片访问路径前缀 文件引用配置在application.properties中ue-res-server属性配置*/
"imageUrlPrefix": "http://192.168.2.31:2000/olive/", /* 图片访问路径前缀 文件引用配置在application.properties中ue-res-server属性配置*/
"imagePathFormat": "ueditor/jsp/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}_{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */
/* {filename} 会替换成原文件名,配置这项需要注意中文乱码问题 */
/* {rand:6} 会替换成随机数,后面的数字是随机数的位数 */
......@@ -28,13 +28,13 @@
"scrawlFieldName": "upfile", /* 提交的图片表单名称 */
"scrawlPathFormat": "ueditor/jsp/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */
"scrawlMaxSize": 2048000, /* 上传大小限制,单位B */
"scrawlUrlPrefix": "http://192.168.2.190:2000/file/", /* 图片访问路径前缀 文件引用配置在application.properties中ue-res-server属性配置*/
"scrawlUrlPrefix": "http://192.168.2.31:2000/olive/", /* 图片访问路径前缀 文件引用配置在application.properties中ue-res-server属性配置*/
"scrawlInsertAlign": "none",
/* 截图工具上传 */
"snapscreenActionName": "uploadimage", /* 执行上传截图的action名称 */
"snapscreenPathFormat": "ueditor/jsp/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */
"snapscreenUrlPrefix": "http://192.168.2.190:2000/file/", /* 图片访问路径前缀 文件引用配置在application.properties中ue-res-server属性配置*/
"snapscreenUrlPrefix": "http://192.168.2.31:2000/olive/", /* 图片访问路径前缀 文件引用配置在application.properties中ue-res-server属性配置*/
"snapscreenInsertAlign": "none", /* 插入的图片浮动方式 */
/* 抓取远程图片配置 */
......@@ -42,7 +42,7 @@
"catcherActionName": "catchimage", /* 执行抓取远程图片的action名称 */
"catcherFieldName": "source", /* 提交的图片列表表单名称 */
"catcherPathFormat": "ueditor/jsp/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */
"catcherUrlPrefix": "http://192.168.2.190:2000/file/", /* 图片访问路径前缀 文件引用配置在application.properties中ue-res-server属性配置*/
"catcherUrlPrefix": "http://192.168.2.31:2000/olive/", /* 图片访问路径前缀 文件引用配置在application.properties中ue-res-server属性配置*/
"catcherMaxSize": 2048000, /* 上传大小限制,单位B */
"catcherAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"], /* 抓取图片格式显示 */
......@@ -50,7 +50,7 @@
"videoActionName": "uploadvideo", /* 执行上传视频的action名称 */
"videoFieldName": "upfile", /* 提交的视频表单名称 */
"videoPathFormat": "ueditor/jsp/upload/video/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */
"videoUrlPrefix": "http://192.168.2.190:2000/file/", /* 视频访问路径前缀 文件引用配置在application.properties中ue-res-server属性配置*/
"videoUrlPrefix": "http://192.168.2.31:2000/olive/", /* 视频访问路径前缀 文件引用配置在application.properties中ue-res-server属性配置*/
"videoMaxSize": 102400000, /* 上传大小限制,单位B,默认100MB */
"videoAllowFiles": [
".flv", ".swf", ".mkv", ".avi", ".rm", ".rmvb", ".mpeg", ".mpg",
......@@ -60,7 +60,7 @@
"fileActionName": "uploadfile", /* controller里,执行上传视频的action名称 */
"fileFieldName": "upfile", /* 提交的文件表单名称 */
"filePathFormat": "ueditor/jsp/upload/file/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */
"fileUrlPrefix": "http://192.168.2.190:2000/file/", /* 文件访问路径前缀 文件引用配置在application.properties中ue-res-server属性配置*/
"fileUrlPrefix": "http://192.168.2.31:2000/olive/", /* 文件访问路径前缀 文件引用配置在application.properties中ue-res-server属性配置*/
"fileMaxSize": 51200000, /* 上传大小限制,单位B,默认50MB */
"fileAllowFiles": [
".png", ".jpg", ".jpeg", ".gif", ".bmp",
......@@ -74,14 +74,14 @@
"imageManagerActionName": "listimage", /* 执行图片管理的action名称 */
"imageManagerListPath": "ueditor/jsp/upload/image/", /* 指定要列出图片的目录 */
"imageManagerListSize": 20, /* 每次列出文件数量 */
"imageManagerUrlPrefix": "http://192.168.2.190:2000/file/", /* 图片访问路径前缀 文件引用配置在application.properties中ue-res-server属性配置*/
"imageManagerUrlPrefix": "http://192.168.2.31:2000/olive/", /* 图片访问路径前缀 文件引用配置在application.properties中ue-res-server属性配置*/
"imageManagerInsertAlign": "none", /* 插入的图片浮动方式 */
"imageManagerAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"], /* 列出的文件类型 */
/* 列出指定目录下的文件 */
"fileManagerActionName": "listfile", /* 执行文件管理的action名称 */
"fileManagerListPath": "ueditor/jsp/upload/file/", /* 指定要列出文件的目录 */
"fileManagerUrlPrefix": "http://192.168.2.190:2000/file/", /* 文件访问路径前缀 文件引用配置在application.properties中ue-res-server属性配置*/
"fileManagerUrlPrefix": "http://192.168.2.31:2000/olive/", /* 文件访问路径前缀 文件引用配置在application.properties中ue-res-server属性配置*/
"fileManagerListSize": 20, /* 每次列出文件数量 */
"fileManagerAllowFiles": [
".png", ".jpg", ".jpeg", ".gif", ".bmp",
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论