Commit 017f8c28 authored by nie'hong's avatar nie'hong

删除workTimeOrder中的projectName和userName

parent a24bcc7e
......@@ -6,9 +6,7 @@
<resultMap id="BaseResultMap" type="cn.wisenergy.model.app.WorkTimeOrder">
<id column="work_id" property="workId" />
<result column="user_id" property="userId" />
<result column="user_name" property="userName" />
<result column="project_id" property="projectId" />
<result column="project_name" property="projectName" />
<result column="dept_id" property="deptId" />
<result column="work_time" property="workTime" />
<result column="work_day" property="workDay" />
......@@ -25,18 +23,16 @@
<!-- 通用查询结果列 -->
<sql id="vals">
#{userId},#{userName},#{projectId},#{projectName},#{deptId},#{workTime},#{workDay},#{status},#{reviewerId},#{des},#{reason},#{type},#{isOvertime},now(),now()
#{userId},#{projectId},#{deptId},#{workTime},#{workDay},#{status},#{reviewerId},#{des},#{reason},#{type},#{isOvertime},now(),now()
</sql>
<sql id="cols_exclude_id">
user_id, user_name, project_id, project_name, dept_id, work_time, work_day, status, reviewer_id, des, reason, type, is_overtime, create_time, modify_time
user_id, project_id, dept_id, work_time, work_day, status, reviewer_id, des, reason, type, is_overtime, create_time, modify_time
</sql>
<sql id="criteria">
<if test="workId != null">and work_id = #{workId}</if>
<if test="userId != null">and user_id = #{userId}</if>
<if test="userName != null">and user_name = #{userName}</if>
<if test="projectId != null">and project_id =#{projectId}</if>
<if test="projectName != null">and project_name = #{projectName}</if>
<if test="deptId != null">and dept_id = #{deptId}</if>
<if test="workTime != null">and work_time = #{workTime}</if>
<if test="workDay != null">and work_day = #{workDay}</if>
......@@ -131,7 +127,7 @@
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
work_id, user_id, user_name, project_id, project_name, dept_id, work_time, work_day, status, reviewer_id, des, reason, type, is_overtime, create_time, modify_time
work_id, user_id, project_id, dept_id, work_time, work_day, status, reviewer_id, des, reason, type, is_overtime, create_time, modify_time
</sql>
<select id="statisticsByProjectType" resultMap="monthlyWorkHourStatistics">
......@@ -176,7 +172,7 @@
</select>
<select id="getWorkTimeAndCostCollect" resultType="cn.wisenergy.model.dto.WorkTimeAndCostCollect" parameterType="integer">
select case when `type`= 1 then '商机' when `type`= 0 then '项目' end AS type,dept_id, project_name,MIN(work_day) AS firstTime,MAX(work_day) AS lastTime,SUM(work_time)/8 AS totalTime,(SUM(work_time))/8*10 AS cost
select case when `type`= 1 then '商机' when `type`= 0 then '项目' end AS type,dept_id, project_id,MIN(work_day) AS firstTime,MAX(work_day) AS lastTime,SUM(work_time)/8 AS totalTime,(SUM(work_time))/8*10 AS cost
from <include refid="table"/>
where status in (2,5) and project_id in
<foreach collection="projectIds" item="projectId" open="(" close=")" separator=",">
......@@ -185,7 +181,7 @@
<if test="firstDayOfMonth != null">
work_day >= #{firstDayOfMonth}
</if>
group by `type`,dept_id, project_name
group by `type`,dept_id, project_id
</select>
<select id="getDaysByDateAndStatus" resultType="date" >
......
......@@ -32,15 +32,9 @@ public class WorkTimeOrder implements Serializable {
@ApiModelProperty(name = "userId",value = "用户id")
private Integer userId;
@ApiModelProperty(name = "userName",value = "用户名")
private String userName;
@ApiModelProperty(name = "projectId",value = "项目id")
private Integer projectId;
@ApiModelProperty(name = "projectName",value = "项目名称")
private String projectName;
@ApiModelProperty(name = "deptId",value = "用户部门主键")
private Integer deptId;
......
......@@ -35,6 +35,12 @@ public class WorkTimeAndCostCollect implements Serializable {
@ApiModelProperty(name = "deptId", value = "部门主键")
private Integer deptId;
/**
* 项目主键
*/
@ApiModelProperty(name = "projectId", value = "项目主键")
private Integer projectId;
/**
* 项目名称
*/
......
......@@ -219,8 +219,10 @@ public class StatisticsServiceImpl implements StatisticsService {
}
List<WorkTimeAndCostCollect> collect = workTimeOrderMapper.getWorkTimeAndCostCollect(projectIds, startTime);
for (WorkTimeAndCostCollect timeAndCostCollect : collect) {
//复制部门名称
//部门名称
timeAndCostCollect.setDeptName(workDeptService.getById(timeAndCostCollect.getDeptId()).getDeptName());
//项目名称
timeAndCostCollect.setProjectName(workProjectService.getById(timeAndCostCollect.getProjectId()).getProjectName());
}
return collect;
}
......
......@@ -129,7 +129,7 @@ public class WorkProjectServiceImpl implements WorkProjectService {
throw new BaseCustomException(BASE_RESP_CODE_ENUM.THE_USER_NOT_MANAGER_PLASE_MANAGER_LOGIN);
}
//存放项目列表
List<WorkProject> workProjects = new ArrayList<>();
List<WorkProject> workProjects;
//存放查询条件
HashMap<String, Object> map = new HashMap<>();
//项目级别查询项目管理员为用户的项目
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment