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

This commit is contained in:
杜建超 2020-10-30 09:27:43 +08:00
commit 53ab4efa73
23 changed files with 254 additions and 14 deletions

View File

@ -40,6 +40,7 @@ import java.lang.reflect.Method;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -95,6 +96,12 @@ public class ResultRecordController extends AbstractController {
@Autowired @Autowired
private ResultCalculateService resultCalculateService; private ResultCalculateService resultCalculateService;
@Autowired
private ResultScoreService resultScoreService;
@Autowired
private FlowChartDetailRecordService flowChartDetailRecordService;
/** /**
* 列表 * 列表
*/ */
@ -348,6 +355,50 @@ public class ResultRecordController extends AbstractController {
//获取计算公式 //获取计算公式
List<CalculateModel> calculateModels = getCalculate(resultModels.get(0).getCalculateId()); List<CalculateModel> calculateModels = getCalculate(resultModels.get(0).getCalculateId());
List<ResultScoreDto> scoreDtos = new ArrayList<>();
//查询所有参与评分人以及所占比重
List<FlowChartDetailRecord> flowChartDetailRecords =
flowChartDetailRecordService.selectFlowChartDetailRecordsByFlowProcess(resultRecord.getEvaluationId(), 4);//获取参与评分的人
List<StaffEntity> staffs = new ArrayList<>();
for (FlowChartDetailRecord record:flowChartDetailRecords
) {
if(record.getOptType().intValue() == -1){
//自己
StaffEntity staffEntity = new StaffEntity();
staffEntity.setId(resultRecord.getId());
staffEntity.setName(resultRecord.getStaffName());
staffs.add(staffEntity);
}else if(record.getOptType().intValue() == 0){
//指定人员
//获取人员信息
List<Long> sIds = Arrays.stream(record.getOptIds().split(",")).map(new Function<String, Long>() {
@Override
public Long apply(String s) {
return Long.parseLong(s);
}
}).collect(Collectors.toList());
staffs.addAll(staffService.selectNamesByIds(sIds));//这里不过滤离职人员因为过滤了可能涉及到评分规则的变更
}else{
//领导
DepartManagers departManagers = staffService.findLeader(resultRecord.getStaffId(), record.getOptType());
if(departManagers.getManagers().size() > 0){
staffs.addAll(departManagers.getManagers());
}
}
for (StaffEntity staff:staffs
) {
ResultScoreDto resultScore = new ResultScoreDto();
resultScore.setApprovalId(staff.getId());
resultScore.setApprovalName(staff.getName());
resultScore.setWeight(record.getWeight());
scoreDtos.add(resultScore);
}
}
resultRecordDetailDto.setGradeGroupId(resultModels.get(0).getGradeGroupId());//设置评分等级 resultRecordDetailDto.setGradeGroupId(resultModels.get(0).getGradeGroupId());//设置评分等级
StaffEntity staffEntity = staffService.selectStaffById(resultRecord.getStaffId()); StaffEntity staffEntity = staffService.selectStaffById(resultRecord.getStaffId());
resultRecordDetailDto.setAvatar(staffEntity.getAvatar()); resultRecordDetailDto.setAvatar(staffEntity.getAvatar());
@ -365,6 +416,42 @@ public class ResultRecordController extends AbstractController {
) { ) {
dto.setCalculate(setCalculateValue(calculateModels, dto)) ; dto.setCalculate(setCalculateValue(calculateModels, dto)) ;
weight = weight.add(dto.getCheckWeight()); weight = weight.add(dto.getCheckWeight());
//获取评分详细
List<ResultScore> scores =
resultScoreService.selectResultScoresByDetailIdAndOrderByStaffIds(dto.getId(), scoreDtos);
if(scores.size() > 0){
//
List<ResultScoreDto> scoreDtos1 = new ArrayList<>();
for (ResultScoreDto scoreDto: scoreDtos
) {//
//
boolean isAdd = false;
for (ResultScore score:
scores) {
if(scoreDto.getApprovalId().longValue() == score.getApprovalId().longValue()){
ResultScoreDto scoreDto1 = new ResultScoreDto();
BeanUtils.copyProperties(scoreDto1, score);
scoreDto1.setApprovalId(scoreDto.getApprovalId());
scoreDto1.setApprovalName(scoreDto.getApprovalName());
scoreDto1.setWeight(scoreDto.getWeight());
scoreDtos1.add(scoreDto1);
scores.remove(score);
isAdd = true;
break;
}
}
if(!isAdd){
ResultScoreDto scoreDto1 = new ResultScoreDto();
scoreDto1.setApprovalId(scoreDto.getApprovalId());
scoreDto1.setApprovalName(scoreDto.getApprovalName());
scoreDto1.setWeight(scoreDto.getWeight());
scoreDtos1.add(scoreDto1);
}
}
dto.setScoreDtos(scoreDtos1);
}else{
dto.setScoreDtos(scoreDtos);
}
} }
//下面设置计算公式 //下面设置计算公式
@ -477,6 +564,11 @@ public class ResultRecordController extends AbstractController {
BeanUtils.copyProperties(dto, resultRecord); BeanUtils.copyProperties(dto, resultRecord);
List<ResultDetail> inserts = new ArrayList<>(); List<ResultDetail> inserts = new ArrayList<>();
List<ResultDetail> updates = new ArrayList<>(); List<ResultDetail> updates = new ArrayList<>();
List<ResultScore> insertScores = new ArrayList<>();
List<ResultScore> updateScores = new ArrayList<>();
for (ResultRecortModelDto model:dto.getRecortModelDtos() for (ResultRecortModelDto model:dto.getRecortModelDtos()
) { ) {
int index = 0; int index = 0;
@ -497,13 +589,31 @@ public class ResultRecordController extends AbstractController {
inserts.add(resultDetail); inserts.add(resultDetail);
} }
if(resultDetail.getIsDelete() == null || resultDetail.getIsDelete().intValue() == 0){ if(resultDetail.getIsDelete() == null || resultDetail.getIsDelete().intValue() == 0){
BigDecimal score = BigDecimal.ZERO;
for (ResultScoreDto scoreDto:detailDto.getScoreDtos()
) {
//计算得分
ResultScore resultScore = new ResultScore();
BeanUtils.copyProperties(scoreDto, resultScore);
if(scoreDto.getAcquireScore() != null){
score = score.add(scoreDto.getAcquireScore().multiply(scoreDto.getWeight()));
}
if(resultScore.getId() == null){
insertScores.add(resultScore);
}else{
updateScores.add(resultScore);
}
}
resultDetail.setAcquireScore(score);
weight = weight.add(resultDetail.getCheckWeight()); weight = weight.add(resultDetail.getCheckWeight());
} }
} }
if(weight.compareTo(model.getWeight()) == 1){ if(weight.compareTo(model.getWeight()) == 1){
return R.error(model.getName() + "的指标之和不能超过" + model.getWeight().multiply(BigDecimal.valueOf(100)) + "%"); return R.error(model.getName() + "的指标之和不能超过" + model.getWeight().multiply(BigDecimal.valueOf(100)) + "%");
} }
} }
//下面更新指标记录
if(inserts.size() > 0){ if(inserts.size() > 0){
resultDetailService.saveBatch(inserts); resultDetailService.saveBatch(inserts);
} }
@ -511,6 +621,14 @@ public class ResultRecordController extends AbstractController {
resultDetailService.updateBatchById(updates); resultDetailService.updateBatchById(updates);
} }
//下面更新评分记录
if(insertScores.size() > 0){
resultScoreService.saveBatch(insertScores);
}
if(updateScores.size() > 0){
resultScoreService.updateBatchById(updateScores);
}
return R.ok(); return R.ok();

View File

@ -94,4 +94,6 @@ public interface StaffDao extends BaseMapper<StaffEntity> {
List<StaffEntity> selectOnJobByIds(@Param("mIds") List<Long> mIds); List<StaffEntity> selectOnJobByIds(@Param("mIds") List<Long> mIds);
StaffSimpleInfo selectStaffSimpleInfo(@Param("staffId") Long staffId); StaffSimpleInfo selectStaffSimpleInfo(@Param("staffId") Long staffId);
List<StaffEntity> selectNamesByIds(@Param("list") List<Long> sIds);
} }

View File

@ -7,4 +7,6 @@ public class FlowDetailResp {
private Long currentStaffId; private Long currentStaffId;
private String staffName; private String staffName;
private Long flowRecordId; private Long flowRecordId;
private String departName;
} }

View File

@ -99,5 +99,7 @@ public interface StaffService extends IService<StaffEntity> {
List<StaffEntity> selectOnJobByIds(List<Long> mIds); List<StaffEntity> selectOnJobByIds(List<Long> mIds);
StaffSimpleInfo selectStaffSimpleInfo(Long staffId); StaffSimpleInfo selectStaffSimpleInfo(Long staffId);
List<StaffEntity> selectNamesByIds(List<Long> sIds);
} }

View File

@ -519,5 +519,10 @@ public class StaffServiceImpl extends ServiceImpl<StaffDao, StaffEntity> impleme
return staffDao.selectStaffSimpleInfo(staffId); return staffDao.selectStaffSimpleInfo(staffId);
} }
@Override
public List<StaffEntity> selectNamesByIds(List<Long> sIds){
return staffDao.selectNamesByIds(sIds);
}
} }

View File

@ -41,4 +41,6 @@ public interface FlowChartDetailRecordMapper extends BaseMapper<FlowChartDetailR
int insertFlowChartDetailRecords(@Param("list") List<FlowChartDetailRecord> inserts); int insertFlowChartDetailRecords(@Param("list") List<FlowChartDetailRecord> inserts);
int updateCoverFlowChartDetailRecordByIds(@Param("list") List<FlowChartDetailRecord> updaes); int updateCoverFlowChartDetailRecordByIds(@Param("list") List<FlowChartDetailRecord> updaes);
List<FlowChartDetailRecord> selectFlowChartDetailRecordsByFlowProcess(@Param("groupId") Long groupId, @Param("flowProcess") int flowProcess);
} }

View File

@ -9,8 +9,12 @@ package com.lz.modules.flow.dao;
*/ */
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lz.modules.flow.entity.ResultScore; import com.lz.modules.flow.entity.ResultScore;
import com.lz.modules.flow.model.ResultScoreDto;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper @Mapper
public interface ResultScoreMapper extends BaseMapper<ResultScore> { public interface ResultScoreMapper extends BaseMapper<ResultScore> {
@ -30,4 +34,7 @@ public interface ResultScoreMapper extends BaseMapper<ResultScore> {
int deleteResultScoreById(@Param("id")Long id); int deleteResultScoreById(@Param("id")Long id);
List<ResultScore> selectResultScoresByDetailId(@Param("id") Long id);
List<ResultScore> selectResultScoresByDetailIdAndOrderByStaffIds(@Param("id") Long id, @Param("list") List<ResultScoreDto> scoreDtos);
} }

View File

@ -10,7 +10,7 @@ import java.util.Date;
* <p> * <p>
* </p>*发起考核考核组人员对应关系表 * </p>*发起考核考核组人员对应关系表
* @author quyixiao * @author quyixiao
* @since 2020-10-23 * @since 2020-10-30
*/ */
@Data @Data
@ -38,8 +38,8 @@ public class EvaluationStartStaff implements java.io.Serializable {
//人员id //人员id
@ApiModelProperty(value = "人员id", name = "staffId") @ApiModelProperty(value = "人员id", name = "staffId")
private Long staffId; private Long staffId;
//0考核人员1管理人员 //0考核人员 1考核人员
@ApiModelProperty(value = "0考核人员1管理人员", name = "type") @ApiModelProperty(value = "0考核人员 1考核人员", name = "type")
private Integer type; private Integer type;
//0: 未通知评分 1 已通知评分 //0: 未通知评分 1 已通知评分
@ApiModelProperty(value = "0: 未通知评分 1 已通知评分", name = "score") @ApiModelProperty(value = "0: 未通知评分 1 已通知评分", name = "score")
@ -47,6 +47,9 @@ public class EvaluationStartStaff implements java.io.Serializable {
//考核组名称 //考核组名称
@ApiModelProperty(value = "考核组名称", name = "evaluationName") @ApiModelProperty(value = "考核组名称", name = "evaluationName")
private String evaluationName; private String evaluationName;
//员工所在的部门id
@ApiModelProperty(value = "员工所在的部门id", name = "departmentId")
private String departmentId;
/** /**
* *
* @return * @return
@ -153,14 +156,14 @@ public class EvaluationStartStaff implements java.io.Serializable {
} }
/** /**
* 0考核人员1管理人员 * 0考核人员 1考核人员
* @return * @return
*/ */
public Integer getType() { public Integer getType() {
return type; return type;
} }
/** /**
* 0考核人员1管理人员 * 0考核人员 1考核人员
* @param type * @param type
*/ */
public void setType(Integer type) { public void setType(Integer type) {
@ -197,6 +200,21 @@ public class EvaluationStartStaff implements java.io.Serializable {
this.evaluationName = evaluationName; this.evaluationName = evaluationName;
} }
/**
* 员工所在的部门id
* @return
*/
public String getDepartmentId() {
return departmentId;
}
/**
* 员工所在的部门id
* @param departmentId
*/
public void setDepartmentId(String departmentId) {
this.departmentId = departmentId;
}
@Override @Override
public String toString() { public String toString() {
return "EvaluationStartStaff{" + return "EvaluationStartStaff{" +
@ -210,6 +228,7 @@ public class EvaluationStartStaff implements java.io.Serializable {
",type=" + type + ",type=" + type +
",score=" + score + ",score=" + score +
",evaluationName=" + evaluationName + ",evaluationName=" + evaluationName +
",departmentId=" + departmentId +
"}"; "}";
} }
} }

View File

@ -27,6 +27,8 @@ public class EvaluationStartStaffDto {
//0考核人员1管理人员 //0考核人员1管理人员
@ApiModelProperty(value = "0考核人员1管理人员", name = "type") @ApiModelProperty(value = "0考核人员1管理人员", name = "type")
private Integer type; private Integer type;
@ApiModelProperty(value = "员工所在的部门id", name = "departmentId")
private String departmentId;
/** /**
* *
* @return * @return

View File

@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.List;
/** /**
* <p> * <p>
@ -52,6 +53,9 @@ public class ResultDetailDto {
//优先级从大到小 //优先级从大到小
@ApiModelProperty(value = "优先级,从小到大", name = "priority") @ApiModelProperty(value = "优先级,从小到大", name = "priority")
private Integer priority; private Integer priority;
@ApiModelProperty(value = "评分详细", name = "scoreDtos")
private List<ResultScoreDto> scoreDtos;
/** /**
* *
* @return * @return

View File

@ -27,6 +27,14 @@ public class ResultScoreDto {
//审批人id //审批人id
@ApiModelProperty(value = "审批人id", name = "approvalId") @ApiModelProperty(value = "审批人id", name = "approvalId")
private Long approvalId; private Long approvalId;
//审批人id
@ApiModelProperty(value = "审批人姓名", name = "approvalName")
private String approvalName;
//审批人id
@ApiModelProperty(value = "所占权重", name = "weight")
private BigDecimal weight;
/** /**
* *
* @return * @return

View File

@ -50,6 +50,8 @@ public class EvaluationStartStaffReq implements java.io.Serializable {
//0考核人员1管理人员 //0考核人员1管理人员
@ApiModelProperty(value = "0考核人员1管理人员", name = "type") @ApiModelProperty(value = "0考核人员1管理人员", name = "type")
private Integer type; private Integer type;
@ApiModelProperty(value = "员工所在的部门id", name = "departmentId")
private String departmentId;
/** /**
* *
* @return * @return

View File

@ -40,4 +40,6 @@ public interface FlowChartDetailRecordService extends IService<FlowChartDetailRe
int insertFlowChartDetailRecords(List<FlowChartDetailRecord> inserts); int insertFlowChartDetailRecords(List<FlowChartDetailRecord> inserts);
int updateCoverFlowChartDetailRecordByIds(List<FlowChartDetailRecord> updaes); int updateCoverFlowChartDetailRecordByIds(List<FlowChartDetailRecord> updaes);
List<FlowChartDetailRecord> selectFlowChartDetailRecordsByFlowProcess(Long groupId, int flowProcess);
} }

View File

@ -2,6 +2,9 @@ package com.lz.modules.flow.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.lz.modules.flow.entity.ResultScore; import com.lz.modules.flow.entity.ResultScore;
import com.lz.modules.flow.model.ResultScoreDto;
import java.util.List;
/** /**
* <p> * <p>
@ -30,4 +33,7 @@ public interface ResultScoreService extends IService<ResultScore> {
int deleteResultScoreById(Long id); int deleteResultScoreById(Long id);
List<ResultScore> selectResultScoresByDetailId(Long id);
List<ResultScore> selectResultScoresByDetailIdAndOrderByStaffIds(Long id, List<ResultScoreDto> scoreDtos);
} }

View File

@ -81,6 +81,11 @@ public class FlowChartDetailRecordServiceImpl extends ServiceImpl<FlowChartDetai
return flowChartDetailRecordMapper.updateCoverFlowChartDetailRecordByIds(updaes); return flowChartDetailRecordMapper.updateCoverFlowChartDetailRecordByIds(updaes);
} }
@Override
public List<FlowChartDetailRecord> selectFlowChartDetailRecordsByFlowProcess(Long groupId, int flowProcess){
return flowChartDetailRecordMapper.selectFlowChartDetailRecordsByFlowProcess(groupId, flowProcess);
}

View File

@ -318,7 +318,7 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
List<EvaluationStartStaff> evaluationStartStaffs = new ArrayList<>(); List<EvaluationStartStaff> evaluationStartStaffs = new ArrayList<>();
//下面初始化管理人员对应关系 /*//下面初始化管理人员对应关系
for (StaffEntity entity:staffManagers for (StaffEntity entity:staffManagers
) { ) {
EvaluationStartStaff evaluationStartStaff = new EvaluationStartStaff(); EvaluationStartStaff evaluationStartStaff = new EvaluationStartStaff();
@ -329,7 +329,7 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
evaluationStartStaff.setType(CheckStaffType.MANAGER.getCode()); evaluationStartStaff.setType(CheckStaffType.MANAGER.getCode());
evaluationStartStaffs.add(evaluationStartStaff); evaluationStartStaffs.add(evaluationStartStaff);
} }*/
//下面初始化参与人员 //下面初始化参与人员
@ -340,6 +340,7 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
evaluationStartStaff.setEvaluationName(evaluationGroup.getName()); evaluationStartStaff.setEvaluationName(evaluationGroup.getName());
evaluationStartStaff.setStaffId(staffInfo.getId()); evaluationStartStaff.setStaffId(staffInfo.getId());
evaluationStartStaff.setStartId(flowStart.getId()); evaluationStartStaff.setStartId(flowStart.getId());
evaluationStartStaff.setDepartmentId(staffInfo.getDepartmentId());
evaluationStartStaff.setType(CheckStaffType.STAFF.getCode()); evaluationStartStaff.setType(CheckStaffType.STAFF.getCode());
evaluationStartStaffs.add(evaluationStartStaff); evaluationStartStaffs.add(evaluationStartStaff);

View File

@ -3,10 +3,13 @@ package com.lz.modules.flow.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lz.modules.flow.dao.ResultScoreMapper; import com.lz.modules.flow.dao.ResultScoreMapper;
import com.lz.modules.flow.entity.ResultScore; import com.lz.modules.flow.entity.ResultScore;
import com.lz.modules.flow.model.ResultScoreDto;
import com.lz.modules.flow.service.ResultScoreService; import com.lz.modules.flow.service.ResultScoreService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
/** /**
* <p> * <p>
* 业绩详情评分表 服务类 * 业绩详情评分表 服务类
@ -58,6 +61,16 @@ public class ResultScoreServiceImpl extends ServiceImpl<ResultScoreMapper, Resul
return resultScoreMapper.deleteResultScoreById(id); return resultScoreMapper.deleteResultScoreById(id);
} }
@Override
public List<ResultScore> selectResultScoresByDetailId(Long id){
return resultScoreMapper.selectResultScoresByDetailId(id);
}
@Override
public List<ResultScore> selectResultScoresByDetailIdAndOrderByStaffIds(Long id, List<ResultScoreDto> scoreDtos){
return resultScoreMapper.selectResultScoresByDetailIdAndOrderByStaffIds(id, scoreDtos);
}
} }

View File

@ -3,6 +3,7 @@ package com.lz.modules.sys.service.app.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dingtalk.api.response.OapiDepartmentListResponse;
import com.lz.common.emun.WorkMsgTypeEnum; import com.lz.common.emun.WorkMsgTypeEnum;
import com.lz.common.exception.RRException; import com.lz.common.exception.RRException;
import com.lz.common.utils.*; import com.lz.common.utils.*;
@ -1125,6 +1126,11 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
flowDetailResp.setCurrentStaffId(flowRecord.getApprovalStaffId()); flowDetailResp.setCurrentStaffId(flowRecord.getApprovalStaffId());
flowDetailResp.setStaffName(flowRecord.getApprovalStaffName()); flowDetailResp.setStaffName(flowRecord.getApprovalStaffName());
flowDetailResp.setFlowRecordId(flowRecord.getId()); flowDetailResp.setFlowRecordId(flowRecord.getId());
DepartmentsStaffRelateEntity departmentsStaffRelateEntity = departmentsStaffRelateService.selectLastDepartmentByStaffId(flowRecord.getApprovalStaffId());
if(departmentsStaffRelateEntity !=null){
DepartmentsEntity departmentsEntity = departmentsDao.selectByDepartmentId(departmentsStaffRelateEntity.getDepartmentId());
flowDetailResp.setDepartName(departmentsEntity.getDepartmentName());
}
flowDetailRespList.add(flowDetailResp); flowDetailRespList.add(flowDetailResp);
} }

View File

@ -14,12 +14,13 @@
<result column="type" property="type"/> <result column="type" property="type"/>
<result column="score" property="score"/> <result column="score" property="score"/>
<result column="evaluation_name" property="evaluationName"/> <result column="evaluation_name" property="evaluationName"/>
<result column="department_id" property="departmentId"/>
</resultMap> </resultMap>
<!-- 通用查询结果列 --> <!-- 通用查询结果列 -->
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, evaluation_id AS evaluationId, start_id AS startId, staff_id AS staffId, type AS type, score AS score, evaluation_name AS evaluationName id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, evaluation_id AS evaluationId, start_id AS startId, staff_id AS staffId, type AS type, score AS score, evaluation_name AS evaluationName, department_id AS departmentId
</sql> </sql>
@ -38,6 +39,7 @@
<if test="type != null">type, </if> <if test="type != null">type, </if>
<if test="score != null">score, </if> <if test="score != null">score, </if>
<if test="evaluationName != null">evaluation_name, </if> <if test="evaluationName != null">evaluation_name, </if>
<if test="departmentId != null">department_id, </if>
is_delete, is_delete,
gmt_create, gmt_create,
gmt_modified gmt_modified
@ -48,6 +50,7 @@
<if test="type != null">#{ type}, </if> <if test="type != null">#{ type}, </if>
<if test="score != null">#{ score}, </if> <if test="score != null">#{ score}, </if>
<if test="evaluationName != null">#{ evaluationName}, </if> <if test="evaluationName != null">#{ evaluationName}, </if>
<if test="departmentId != null">#{ departmentId}, </if>
0, 0,
now(), now(),
now() now()
@ -66,7 +69,8 @@
<if test="staffId != null">staff_id = #{staffId},</if> <if test="staffId != null">staff_id = #{staffId},</if>
<if test="type != null">type = #{type},</if> <if test="type != null">type = #{type},</if>
<if test="score != null">score = #{score},</if> <if test="score != null">score = #{score},</if>
<if test="evaluationName != null">evaluation_name = #{evaluationName}</if> <if test="evaluationName != null">evaluation_name = #{evaluationName},</if>
<if test="departmentId != null">department_id = #{departmentId}</if>
</trim> </trim>
,gmt_modified = now() ,gmt_modified = now()
where id = #{id} where id = #{id}
@ -84,7 +88,8 @@
staff_id = #{staffId}, staff_id = #{staffId},
type = #{type}, type = #{type},
score = #{score}, score = #{score},
evaluation_name = #{evaluationName} evaluation_name = #{evaluationName},
department_id = #{departmentId}
,gmt_modified = now() ,gmt_modified = now()
where id = #{id} where id = #{id}
</update> </update>
@ -102,6 +107,7 @@
staff_id, staff_id,
type, type,
evaluation_name, evaluation_name,
department_id,
is_delete is_delete
)values )values
<foreach collection="list" item="item" separator=",">( <foreach collection="list" item="item" separator=",">(
@ -110,6 +116,7 @@
#{ item.staffId}, #{ item.staffId},
#{ item.type}, #{ item.type},
#{ item.evaluationName}, #{ item.evaluationName},
#{ item.departmentId},
0 0
) )
</foreach> </foreach>

View File

@ -109,9 +109,7 @@
update lz_flow_chart_detail_record set is_delete = 1 where id=#{id} limit 1 update lz_flow_chart_detail_record set is_delete = 1 where id=#{id} limit 1
</update> </update>
<select id="selectFlowChartDetailRecordByGroupIdAndChartId" resultType="FlowChartDetailRecord" >
select * from lz_flow_chart_detail_record where evaluation_group_id=#{groupId} and chart_id = #{chartId} and is_delete = 0 order by step_index asc
</select>
<select id="selectFlowChartDetailRecordByGroupId" resultType="FlowChartDetailRecord" > <select id="selectFlowChartDetailRecordByGroupId" resultType="FlowChartDetailRecord" >
select * from lz_flow_chart_detail_record where evaluation_group_id=#{groupId} and is_delete = 0 order by step_index asc select * from lz_flow_chart_detail_record where evaluation_group_id=#{groupId} and is_delete = 0 order by step_index asc
@ -169,5 +167,10 @@
</update> </update>
<select id="selectFlowChartDetailRecordsByFlowProcess" resultType="FlowChartDetailRecord" >
select * from lz_flow_chart_detail_record where evaluation_group_id=(select copy_id from lz_evaluation_group where id = #{groupId})
and chart_id = (select id from lz_flow_chart where flow_process = #{flowProcess}) and is_delete = 0 order by step_index asc
</select>
</mapper> </mapper>

View File

@ -79,5 +79,17 @@
update lz_result_score set is_delete = 1 where id=#{id} limit 1 update lz_result_score set is_delete = 1 where id=#{id} limit 1
</update> </update>
<select id="selectResultScoresByDetailId" resultType="ResultScore" >
select * from lz_result_score where detail_id=#{id} and is_delete = 0
</select>
<select id="selectResultScoresByDetailIdAndOrderByStaffIds" resultType="ResultScore" >
select * from lz_result_score where detail_id=#{id} and is_delete = 0 order by field(approval_id,
<foreach collection="list" item="item" separator=",">
#{item.approvalId}
</foreach>
)
</select>
</mapper> </mapper>

View File

@ -526,4 +526,16 @@
) as staffinfo left join lz_departments_staff_relate relate on staffinfo.id = relate.staff_id ) as staffinfo left join lz_departments_staff_relate relate on staffinfo.id = relate.staff_id
) as info left join lz_departments dep on info.department_id = dep.department_id GROUP BY info.id ) as info left join lz_departments dep on info.department_id = dep.department_id GROUP BY info.id
</select> </select>
<select id="selectNamesByIds" resultType="com.lz.modules.app.entity.StaffEntity">
select * from lz_staff where id in (
<foreach collection="list" item="item" separator=",">
#{item}
</foreach>
) order by field(id,
<foreach collection="list" item="item" separator=",">
#{item}
</foreach>
)
</select>
</mapper> </mapper>

View File

@ -110,7 +110,7 @@ public class MysqlMain {
//list.add(new TablesBean("lz_flow_chart_detail_record")); //list.add(new TablesBean("lz_flow_chart_detail_record"));
//list.add(new TablesBean("lz_flow_approval_role")); //list.add(new TablesBean("lz_flow_approval_role"));
list.add(new TablesBean("lz_flow_chart")); list.add(new TablesBean("lz_evaluation_start_staff"));
List<TablesBean> list2 = new ArrayList<TablesBean>(); List<TablesBean> list2 = new ArrayList<TablesBean>();
Map<String, String> map = MysqlUtil2ShowCreateTable.getComments(); Map<String, String> map = MysqlUtil2ShowCreateTable.getComments();