Merge branch 'version_performance_2.0' of http://gitlab.ldxinyong.com/enterpriseManagement/lz_management into version_performance_2.0

This commit is contained in:
wulin 2020-11-03 17:27:48 +08:00
commit 84c6c42bd7
8 changed files with 59 additions and 5 deletions

View File

@ -45,4 +45,6 @@ public interface EvaluationGroupMapper extends BaseMapper<EvaluationGroup> {
void deleteByCopyIds(@Param("ids") List<Long> ids);
List<Long> selectIdsByCopyIds(@Param("copyIds")String copyIds);
}

View File

@ -75,4 +75,6 @@ public interface FlowRecordMapper extends BaseMapper<FlowRecord> {
List<FlowRecord> selectFlowRecordByResultRecordId(@Param("resultRecordId") Long resultRecordId);
FlowRecord selectFlowRecordByRecordIdMinIdStatus(@Param("resultRecordId") Long resultRecordId, @Param("id") Long id, @Param("status") int status);
int batchUpdateExecution(@Param("recordIds")List<Long> recordIds,@Param("processId") Long processId);
}

View File

@ -35,4 +35,6 @@ public class AssessDetailReq extends BasePage{
private List<String> departmentIds;
private Long loginUserId;
private String copyEvaluationIds;
}

View File

@ -11,7 +11,9 @@ import com.lz.modules.app.dto.ApprovalDto;
import com.lz.modules.app.dto.StaffSimpleDto;
import com.lz.modules.app.entity.StaffEntity;
import com.lz.modules.app.service.StaffService;
import com.lz.modules.flow.dao.EvaluationGroupMapper;
import com.lz.modules.flow.dao.EvaluationStartStaffMapper;
import com.lz.modules.flow.dao.FlowRecordMapper;
import com.lz.modules.flow.dao.FlowStartMapper;
import com.lz.modules.flow.entity.EvaluationGroup;
import com.lz.modules.flow.entity.EvaluationStartStaff;
@ -36,6 +38,7 @@ import com.lz.modules.sys.service.app.ResultRecordService;
import com.sun.org.apache.regexp.internal.RE;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -76,6 +79,14 @@ public class AssessManagerServiceImpl implements AssessManagerService {
private FlowStartService flowStartService;
@Autowired
private AssessService assessService;
@Autowired
private EvaluationGroupMapper evaluationGroupMapper;
@Autowired
private FlowRecordMapper flowRecordMapper;
public static final Long processId = 1L;
@Override
public PageUtils assessList(AssessListReq req) {
@ -115,6 +126,11 @@ public class AssessManagerServiceImpl implements AssessManagerService {
@Override
public PageUtils assessDetail(AssessDetailReq req) {
//拼接拷贝组
if(StringUtil.isNotBlank(req.getEvaluationIds())){
List<Long> evaluationIds = evaluationGroupMapper.selectIdsByCopyIds(req.getEvaluationIds());
req.setCopyEvaluationIds(StringUtils.join(evaluationIds,","));
}
PageUtils pageUtils = PageUtils.startPage(req.getCurrPage(),req.getPageSize()).doSelect(
page -> resultRecordMapper.selectAssessListByStartId(page,req)
);
@ -259,6 +275,15 @@ public class AssessManagerServiceImpl implements AssessManagerService {
log.error("执行中状态跳过失败 recorId:" + aLong,e);
}
});
//更新flowRecord记录
List<Object> objects = resultRecordService.listObjs(new QueryWrapper<ResultRecord>()
.eq("is_delete", 0)
.eq("start_id", req.getStartId())
.eq("evaluation_id", evaluation).select("id"));
List<Long> collect = objects.stream().map(o -> Long.valueOf(String.valueOf(o))).collect(toList());
flowRecordMapper.batchUpdateExecution(collect,processId);
}

View File

@ -67,6 +67,8 @@ public class ChartResultServiceImpl implements ChartResultService {
@Autowired
private AssessService assessService;
private static final Long processId = 1L;
@Override
public List<ChartStatisticalRes> chartReport(Long startId,Long staffId) {
@ -236,7 +238,7 @@ public class ChartResultServiceImpl implements ChartResultService {
int count = resultRecordService.count(new QueryWrapper<ResultRecord>()
.eq("is_delete", 0)
.eq("start_id", startId)
.in("department_id",mandepartmentIds));
.in(CollectionUtils.isNotEmpty(mandepartmentIds),"department_id",mandepartmentIds));
ChartStatistical all = new ChartStatistical();
all.setDesc("参与人数");
@ -246,7 +248,7 @@ public class ChartResultServiceImpl implements ChartResultService {
for(ChartStatistical statistical:process){
map.put(statistical.getDesc(),statistical.getNum());
}
List<FlowChart> charts = flowChartService.selectFlowChartByFlowManagerId(1L);
List<FlowChart> charts = flowChartService.selectFlowChartByFlowManagerId(processId);
for(FlowChart chart:charts){
ChartStatistical statistical = new ChartStatistical();

View File

@ -434,14 +434,14 @@
</select>
<select id="selectAssessListByStartId" resultType="com.lz.modules.performance.res.AssessManagerDetailRes">
select r.id,r.staff_id,staff_name,department_name,all_score,score_level,evaluation_name from lz_result_record r
select DISTINCT (r.id),r.staff_id,staff_name,department_name,all_score,score_level,evaluation_name from lz_result_record r
LEFT JOIN lz_evaluation_start_staff s
ON r.start_id = s.start_id and r.staff_id = s.staff_id
where r.is_delete = 0 and s.is_delete = 0
and r.start_id = #{req.startId}
<if test="req.evaluationIds !=null and req.evaluationIds !=''">
<if test="req.copyEvaluationIds !=null and req.copyEvaluationIds !=''">
and r.evaluation_id in(
<foreach collection="req.evaluationIds.split(',')" item="evaluation_id" open="(" separator="," close=")">
<foreach collection="req.copyEvaluationIds.split(',')" item="evaluation_id" open="(" separator="," close=")">
#{evaluation_id}
</foreach>
)

View File

@ -142,5 +142,14 @@
</foreach>
)
</update>
<select id="selectIdsByCopyIds" resultType="long">
select id from lz_evaluation_group where is_delete = 0
and copy_id in (
<foreach collection="copyIds" item="copy_id" separator=",">
#{copy_id}
</foreach>
)
</select>
</mapper>

View File

@ -261,6 +261,18 @@
select * from lz_flow_record where is_delete = 0 and record_id = #{resultRecordId} and id > #{id} and status = #{status} order by id asc limit 1
</select>
<update id="batchUpdateExecution">
UPDATE lz_flow_record
SET status = 4
,gmt_modified = now()
where is_delete = 0 and status !=4 and flow_process = 2 and process_id = #{processId}
<if test="recordIds !=null and recordIds.size()!=0">
<foreach collection="recordIds" item="record_id" separator=",">
#{record_id}
</foreach>
)
</if>
</update>
</mapper>