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

This commit is contained in:
杜建超 2020-09-29 13:58:00 +08:00
commit e2e5bf581e
12 changed files with 54 additions and 17 deletions

View File

@ -254,6 +254,8 @@ public class ResultRecordController extends AbstractController {
String target = "审批通过"; String target = "审批通过";
if (resultComment.getStatus() == 5) { if (resultComment.getStatus() == 5) {
target = "驳回"; target = "驳回";
}else if (resultComment.getStatus() == 6){
target = "申述";
} }
comment.setTarget(target); comment.setTarget(target);
comment.setKeyResult(resultComment.getComment()); comment.setKeyResult(resultComment.getComment());
@ -263,12 +265,14 @@ public class ResultRecordController extends AbstractController {
String superStaff = recordAuthService.selectByStaffId(resultRecord.getStaffId()); String superStaff = recordAuthService.selectByStaffId(resultRecord.getStaffId());
int fileCount = recordFileService.selectRecordFileCountByRecordId(resultRecord.getId()); int fileCount = recordFileService.selectRecordFileCountByRecordId(resultRecord.getId());
if(resultRecord.getStaffId().equals(getUserId()) && StringUtil.in(resultRecord.getStatus() ,1,2,3,5)){ if(resultRecord.getStaffId().equals(getUserId())){
auth.setSubmited(1); List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByResultRecordIdTypeStatus(req.getRecordResultId(),resultRecord.getType(),0);
List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByResultRecordIdType(req.getRecordResultId(),resultRecord.getType());
if(flowRecords!=null && flowRecords.size() == 2) { // 表示可以撤回 if(flowRecords!=null && flowRecords.size() == 2) { // 表示可以撤回
auth.setCancel(1); auth.setCancel(1);
} }
if(flowRecords!=null && flowRecords.size() >= 2){
auth.setSubmited(1);
}
} }
return R.ok() return R.ok()
@ -398,12 +402,12 @@ public class ResultRecordController extends AbstractController {
} }
if(batchOpt == 3 ){ if(batchOpt == 3 ){
for (ResultRecord resultRecord : resultRecords) { for (ResultRecord resultRecord : resultRecords) {
r = resultRecordService.reject(resultRecord,1); //更新驳回状态 r = resultRecordService.approval(resultRecord.getId(), resultRecord.getCurrentApprovalStaffId(),null,false);
if (!r.isSuccess()) { if (!r.isSuccess()) {
return r; return r;
} }
} }
} else { } else if(batchOpt == 4 ){
for (ResultRecord resultRecord : resultRecords) { for (ResultRecord resultRecord : resultRecords) {
List<FlowRecord> list = flowRecordService.selectFlowRecordByResultRecordIdType(resultRecord.getId(), 2); List<FlowRecord> list = flowRecordService.selectFlowRecordByResultRecordIdType(resultRecord.getId(), 2);
for (int i = list.size() - 1; i >= 0; i--) { for (int i = list.size() - 1; i >= 0; i--) {

View File

@ -46,4 +46,6 @@ public interface FlowRecordMapper extends BaseMapper<FlowRecord> {
FlowRecord selectLastFlowNoStatusRecordByRecordId(@Param("recordId") Long recordId); FlowRecord selectLastFlowNoStatusRecordByRecordId(@Param("recordId") Long recordId);
List<FlowRecord> selectFlowRecordByResultRecordIdType(@Param("resultRecordId") Long resultRecordId, @Param("type") Integer type); List<FlowRecord> selectFlowRecordByResultRecordIdType(@Param("resultRecordId") Long resultRecordId, @Param("type") Integer type);
List<FlowRecord> selectFlowRecordByResultRecordIdTypeStatus(@Param("recordResultId") Long recordResultId, @Param("type") Integer type, @Param("status") int status);
} }

View File

@ -48,4 +48,6 @@ public interface FlowRecordService extends IService<FlowRecord> {
FlowRecord selectLastFlowNoStatusRecordByRecordId(Long resultRecordId); FlowRecord selectLastFlowNoStatusRecordByRecordId(Long resultRecordId);
List<FlowRecord> selectFlowRecordByResultRecordIdType(Long recordResultId, Integer type); List<FlowRecord> selectFlowRecordByResultRecordIdType(Long recordResultId, Integer type);
List<FlowRecord> selectFlowRecordByResultRecordIdTypeStatus(Long recordResultId, Integer type, int status);
} }

View File

@ -128,5 +128,10 @@ public class FlowRecordServiceImpl extends ServiceImpl<FlowRecordMapper, FlowRec
return flowRecordMapper.selectFlowRecordByResultRecordIdType(resultRecordId,type); return flowRecordMapper.selectFlowRecordByResultRecordIdType(resultRecordId,type);
} }
@Override
public List<FlowRecord> selectFlowRecordByResultRecordIdTypeStatus(Long recordResultId, Integer type, int status) {
return flowRecordMapper.selectFlowRecordByResultRecordIdTypeStatus(recordResultId,type,status);
}
} }

View File

@ -63,4 +63,6 @@ public interface ResultRecordMapper extends BaseMapper<ResultRecord> {
ResultRecord selectResultRecordByStaffIdStatus(@Param("staffId") Long staffId, @Param("status") int status); ResultRecord selectResultRecordByStaffIdStatus(@Param("staffId") Long staffId, @Param("status") int status);
List<ReportProgressListDto> targetReportList(@Param("req")ReportListReq req, @Param("staffIds") List<String> staffIds, @Param("page") IPage page); List<ReportProgressListDto> targetReportList(@Param("req")ReportListReq req, @Param("staffIds") List<String> staffIds, @Param("page") IPage page);
ResultRecord selectLastResultRecordByStaffIdType(@Param("staffId") Long staffId, @Param("type") int type);
} }

View File

@ -90,7 +90,10 @@ public interface ResultRecordService extends IService<ResultRecord> {
ResultRecord selectResultRecordByStaffIdStatus(Long staffId, int status); ResultRecord selectResultRecordByStaffIdStatus(Long staffId, int status);
R reject( ResultRecord resultRecord,Integer status); R reject( ResultRecord resultRecord,Integer status);
StaffEntity getApprovalStaff(ResultRecord resultRecord, String departmentLevel, List<StaffRoleDto> staffRoleDtos, Long roleId); StaffEntity getApprovalStaff(ResultRecord resultRecord, String departmentLevel, List<StaffRoleDto> staffRoleDtos, Long roleId);
DepartmentsStaffRelateEntity getLeaderDepartmentsStaffRelateEntity(Long staffId); DepartmentsStaffRelateEntity getLeaderDepartmentsStaffRelateEntity(Long staffId);
ResultRecord selectLastResultRecordByStaffIdType(Long staffId, int type);
} }

View File

@ -4,14 +4,16 @@ import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lz.common.utils.BigDecimalUtil; import com.lz.common.utils.BigDecimalUtil;
import com.lz.common.utils.Constant; import com.lz.common.utils.Constant;
import com.lz.common.utils.StringUtil;
import com.lz.modules.app.entity.StaffEntity; import com.lz.modules.app.entity.StaffEntity;
import com.lz.modules.app.resp.ResultDetailResp; import com.lz.modules.app.resp.ResultDetailResp;
import com.lz.modules.app.resp.Step; import com.lz.modules.app.resp.Step;
import com.lz.modules.app.service.DepartmentsService; import com.lz.modules.app.service.DepartmentsService;
import com.lz.modules.app.service.StaffService; import com.lz.modules.app.service.StaffService;
import com.lz.modules.app.utils.t.TwoTuple; import com.lz.modules.app.utils.t.TwoTuple;
import com.lz.modules.flow.entity.*; import com.lz.modules.flow.entity.Flow;
import com.lz.modules.flow.entity.FlowDepartment;
import com.lz.modules.flow.entity.FlowRecord;
import com.lz.modules.flow.entity.FlowRelation;
import com.lz.modules.flow.model.Auth; import com.lz.modules.flow.model.Auth;
import com.lz.modules.flow.model.StaffRoleDto; import com.lz.modules.flow.model.StaffRoleDto;
import com.lz.modules.flow.service.*; import com.lz.modules.flow.service.*;
@ -257,14 +259,13 @@ public class ResultDetailServiceImpl extends ServiceImpl<ResultDetailMapper, Res
StaffEntity flowStaff = staffService.selectStaffById(flowDepartment.getStaffId()); StaffEntity flowStaff = staffService.selectStaffById(flowDepartment.getStaffId());
roleNameMap.put(departmentLevel,flowStaff.getName()); roleNameMap.put(departmentLevel,flowStaff.getName());
}else{ }else{
Long roleId = flows.get(flowIndex - 1).getRoleId(); Long roleId = flows.size() > flowIndex - 1 ? flows.get(flowIndex - 1).getRoleId() : null;
List<StaffRoleDto> staffRoleDtos = new ArrayList<>(); List<StaffRoleDto> staffRoleDtos = new ArrayList<>();
StaffEntity approvalStaff = resultRecordService.getApprovalStaff(resultRecord, departmentLevel, staffRoleDtos, roleId); StaffEntity approvalStaff = resultRecordService.getApprovalStaff(resultRecord, departmentLevel, staffRoleDtos, roleId);
roleNameMap.put(departmentLevel,approvalStaff.getName()); roleNameMap.put(departmentLevel,approvalStaff.getName());
} }
} }
} }
log.info("approvalList approval : " + Arrays.toString(approvalList.toArray()) + " roleNameMap : " + JSON.toJSONString(roleNameMap)); log.info("approvalList approval : " + Arrays.toString(approvalList.toArray()) + " roleNameMap : " + JSON.toJSONString(roleNameMap));
for (int i = flowIndex; i < flowIndex + 10; i++) { for (int i = flowIndex; i < flowIndex + 10; i++) {
int index = resultRecordService.getDepartmentLevelIndex(flows, i); int index = resultRecordService.getDepartmentLevelIndex(flows, i);

View File

@ -324,6 +324,11 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
return leader; return leader;
} }
@Override
public ResultRecord selectLastResultRecordByStaffIdType(Long staffId, int type) {
return resultRecordMapper.selectLastResultRecordByStaffIdType(staffId,type);
}
@Override @Override
public ResultRecord createResultRecord(Long staffId, int type, Long roleId) { public ResultRecord createResultRecord(Long staffId, int type, Long roleId) {
@ -347,7 +352,7 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
@Override @Override
public ResultRecord initResult(Long staffId, Integer recordType, Long roleId) { public ResultRecord initResult(Long staffId, Integer recordType, Long roleId) {
ResultRecord resultRecordOld = resultRecordService.selectResultRecordByStaffIdStatus(staffId,4); ResultRecord resultRecordOld = resultRecordService.selectLastResultRecordByStaffIdType(staffId,1);
ResultRecord resultRecordNew = null; ResultRecord resultRecordNew = null;
if (resultRecordOld != null) { if (resultRecordOld != null) {
Long oldResultRecordId = resultRecordOld.getId(); Long oldResultRecordId = resultRecordOld.getId();
@ -355,6 +360,10 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
resultRecordOld.setId(null); resultRecordOld.setId(null);
resultRecordOld.setType(Constant.TWO); // 1 表示是目标2 表示是业绩 resultRecordOld.setType(Constant.TWO); // 1 表示是目标2 表示是业绩
resultRecordOld.setStatus(0); resultRecordOld.setStatus(0);
resultRecordOld.setCurrentApprovalStaffId(staffId);
resultRecordOld.setScoreLevel("0");
StaffEntity staffEntity = staffService.selectStaffById(staffId);
resultRecordOld.setCurrentApprovalStaffName(staffEntity.getName());
resultRecordOld.setFlowStaffIdRole(resultDetailService.initRole(resultRecordOld.getStaffId(), roleId)); resultRecordOld.setFlowStaffIdRole(resultDetailService.initRole(resultRecordOld.getStaffId(), roleId));
resultRecordService.insertResultRecord(resultRecordOld); resultRecordService.insertResultRecord(resultRecordOld);
//删除月初目标 //删除月初目标
@ -526,7 +535,6 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
.put("type", WorkMsgTypeEnum.SUBMIT); .put("type", WorkMsgTypeEnum.SUBMIT);
} }
@Override @Override
public StaffEntity getApprovalStaff(ResultRecord resultRecord, String departmentLevel,List<StaffRoleDto> staffRoleDtos, Long roleId) { public StaffEntity getApprovalStaff(ResultRecord resultRecord, String departmentLevel,List<StaffRoleDto> staffRoleDtos, Long roleId) {
StaffEntity approvalStaff = null; StaffEntity approvalStaff = null;
@ -616,8 +624,9 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
.put("to", approvalStaff) .put("to", approvalStaff)
.put("type", WorkMsgTypeEnum.URGING); .put("type", WorkMsgTypeEnum.URGING);
}else if (req.getStatus() == 6){ }else if (req.getStatus() == 6){
// 向上级申述 status = 6;
resultRecordService.approval(req.getRecordResultId(), userId,req.getStatus(),false); // 回滚代码
resultRecordService.reject(resultRecord,req.getStatus());
} }
resultCommentService.addOrUpdateComment(req, userId, status,lastUsedFlowRecord); resultCommentService.addOrUpdateComment(req, userId, status,lastUsedFlowRecord);
if(r != null){//下面推送消息 if(r != null){//下面推送消息

View File

@ -3,9 +3,9 @@ spring:
type: com.alibaba.druid.pool.DruidDataSource type: com.alibaba.druid.pool.DruidDataSource
druid: druid:
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://172.16.157.238:3306/lz_management?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai url: jdbc:mysql://rm-bp1xhc66ruz72t68p.mysql.rds.aliyuncs.com:3306/lz_manger?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
username: ldd_biz username: lz_manger
password: Hello1234 password: N8zfBwhOC
initial-size: 10 initial-size: 10
max-active: 100 max-active: 100
min-idle: 10 min-idle: 10

View File

@ -97,7 +97,7 @@
<if test="priority != null">priority = #{priority}</if> <if test="priority != null">priority = #{priority}</if>
</trim> </trim>
,gmt_modified = now() ,gmt_modified = now()
where id = #{id} where id = #{id} limit 1
</update> </update>

View File

@ -327,6 +327,9 @@
GROUP BY r.staff_id GROUP BY r.staff_id
</select> </select>
<select id="selectLastResultRecordByStaffIdType" resultType="com.lz.modules.sys.entity.app.ResultRecord">
select * from lz_result_record where is_delete = 0 and staff_id = #{staffId} and type = #{type} order by id desc limit 1
</select>
</mapper> </mapper>

View File

@ -160,5 +160,11 @@
</select> </select>
<select id="selectFlowRecordByResultRecordIdTypeStatus" resultType="com.lz.modules.flow.entity.FlowRecord">
select * from lz_flow_record where is_delete = 0 and record_id = #{recordResultId} and type = #{type} and status = #{status}
</select>
</mapper> </mapper>