This commit is contained in:
杜建超 2020-11-16 17:01:36 +08:00
parent ce2b2d6fa7
commit 650bbd91a5
6 changed files with 44 additions and 9 deletions

View File

@ -12,6 +12,7 @@ import com.lz.modules.flow.entity.FlowStart;
import com.lz.modules.flow.service.FlowStartService;
import com.lz.modules.performance.req.ChartResultReq;
import com.lz.modules.performance.req.ChartStartsReq;
import com.lz.modules.performance.req.OwnResultReq;
import com.lz.modules.performance.res.ChartStartsRes;
import com.lz.modules.performance.res.ChartStatisticalRes;
import com.lz.modules.performance.res.ResultRankListRes;
@ -94,12 +95,12 @@ public class ChartController extends AbstractController{
@PostMapping("/own/result")
@ApiOperation("获取个人成长曲线")
@ApiResponses({@ApiResponse(code = 200,message = "成功",response = OwnResultResp.class)})
public R ownResult(Long userId){
if(userId == null){
public R ownResult(@RequestBody @ApiParam(name = "body",value = "body请求体",required = true) OwnResultReq req){
if(req.getUserId() == null){
//如果id为空查询自己信息
userId = getUserId();
req.setUserId(getUserId());
}
List<OwnResultResp> ownResultResps = resultRecordService.ownResult(userId);
List<OwnResultResp> ownResultResps = resultRecordService.ownResult(req);
return R.ok().put("data",ownResultResps);
}

View File

@ -0,0 +1,24 @@
package com.lz.modules.performance.req;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Author: djc
* @Desc:
* @Date: 2020/11/16 16:50
*/
@Data
@ApiModel("个人曲线请求实体")
public class OwnResultReq {
@ApiModelProperty("用户id,可不传")
private Long userId;
@ApiModelProperty("开始时间,必传")
private String startTime;
@ApiModelProperty("结束时间,必传")
private String endTime;
}

View File

@ -18,6 +18,7 @@ import com.lz.modules.app.resp.OwnResultResp;
import com.lz.modules.flow.model.ResultRecordDto;
import com.lz.modules.performance.dto.ToScoreDingTalkDto;
import com.lz.modules.performance.req.AssessDetailReq;
import com.lz.modules.performance.req.OwnResultReq;
import com.lz.modules.performance.res.AssessManagerDetailRes;
import com.lz.modules.performance.res.ChartStatistical;
import com.lz.modules.sys.entity.app.ResultRecord;
@ -61,7 +62,7 @@ public interface ResultRecordMapper extends BaseMapper<ResultRecord> {
List<ResultRecord> selectResultRecordByIds(@Param("recordIds") List<Long> recordIds);
List<OwnResultResp> ownResult(@Param("staffId") Long staffId);
List<OwnResultResp> ownResult(@Param("req") OwnResultReq req);
List<GraphicsStatisticalDto> staffDistribution(@Param("monthTime") String monthTime,@Param("staffIds") List<String> staffIds);

View File

@ -15,6 +15,7 @@ import com.lz.modules.app.utils.t.TwoTuple;
import com.lz.modules.flow.entity.Flow;
import com.lz.modules.flow.model.StaffRoleDto;
import com.lz.modules.performance.req.AssessDetailReq;
import com.lz.modules.performance.req.OwnResultReq;
import com.lz.modules.performance.res.ChartStatistical;
import com.lz.modules.sys.entity.SysUserEntity;
import com.lz.modules.sys.entity.app.ResultRecord;
@ -77,7 +78,7 @@ public interface ResultRecordService extends IService<ResultRecord> {
void sendWorkMSG(StaffEntity mySelf, StaffEntity toSelf, WorkMsgTypeEnum workMsgTypeEnum
, Long recordResultId, int count);
List<OwnResultResp> ownResult(Long staffId);
List<OwnResultResp> ownResult(OwnResultReq req);
/**
* 人员等级排布

View File

@ -33,6 +33,7 @@ import com.lz.modules.flow.enums.FlowRecordEnum;
import com.lz.modules.flow.model.*;
import com.lz.modules.flow.service.*;
import com.lz.modules.job.business.DingtalkBusiness;
import com.lz.modules.performance.req.OwnResultReq;
import com.lz.modules.performance.res.ChartStatistical;
import com.lz.modules.sys.dao.app.ResultRecordMapper;
import com.lz.modules.sys.entity.SysUserEntity;
@ -743,8 +744,8 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
@Override
public List<OwnResultResp> ownResult(Long staffId) {
return resultRecordMapper.ownResult(staffId);
public List<OwnResultResp> ownResult(OwnResultReq req) {
return resultRecordMapper.ownResult(req);
}
@Override

View File

@ -284,7 +284,14 @@
SELECT all_score,CONCAT_WS('至',DATE_FORMAT(start_time,'%Y.%m'),DATE_FORMAT(end_time,'%Y.%m')) as 'name' FROM lz_result_record r
LEFT JOIN lz_flow_start f
ON r.start_id = f.id
where r.is_delete = 0 and f.is_delete = 0 and flow_process = 5 and staff_id = #{staffId}
where r.is_delete = 0 and f.is_delete = 0 and flow_process = 5 and staff_id = #{req.userId}
<if test="req.startTime != null and req.endTime!=null">
and (
(DATE_FORMAT(start_time,'%Y-%m') &lt;= #{req.startTime} and DATE_FORMAT(end_time,'%Y-%m') &gt;= #{req.endTime})
or (DATE_FORMAT(end_time,'%Y-%m') &lt;= #{req.endTime} and DATE_FORMAT(end_time,'%Y-%m') &gt;= #{req.startTime})
or (DATE_FORMAT(start_time,'%Y-%m') &lt;= #{req.endTime} and DATE_FORMAT(start_time,'%Y-%m') &gt;= #{req.startTime})
)
</if>
order by start_id desc