提交修改

This commit is contained in:
quyixiao 2020-09-29 10:34:54 +08:00
parent de8fa66bb3
commit a08797fee4
9 changed files with 34 additions and 4 deletions

View File

@ -263,12 +263,14 @@ public class ResultRecordController extends AbstractController {
String superStaff = recordAuthService.selectByStaffId(resultRecord.getStaffId());
int fileCount = recordFileService.selectRecordFileCountByRecordId(resultRecord.getId());
if(resultRecord.getStaffId().equals(getUserId()) && StringUtil.in(resultRecord.getStatus() ,1,2,3,5)){
auth.setSubmited(1);
List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByResultRecordIdType(req.getRecordResultId(),resultRecord.getType());
if(resultRecord.getStaffId().equals(getUserId())){
List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByResultRecordIdTypeStatus(req.getRecordResultId(),resultRecord.getType(),0);
if(flowRecords!=null && flowRecords.size() == 2) { // 表示可以撤回
auth.setCancel(1);
}
if(flowRecords!=null && flowRecords.size() >= 2){
auth.setSubmited(1);
}
}
return R.ok()

View File

@ -46,4 +46,6 @@ public interface FlowRecordMapper extends BaseMapper<FlowRecord> {
FlowRecord selectLastFlowNoStatusRecordByRecordId(@Param("recordId") Long recordId);
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);
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);
}
@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);
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

@ -93,4 +93,6 @@ public interface ResultRecordService extends IService<ResultRecord> {
StaffEntity getApprovalStaff(ResultRecord resultRecord, String departmentLevel, List<StaffRoleDto> staffRoleDtos, Long roleId);
DepartmentsStaffRelateEntity getLeaderDepartmentsStaffRelateEntity(Long staffId);
ResultRecord selectLastResultRecordByStaffIdType(Long staffId, int type);
}

View File

@ -324,6 +324,11 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
return leader;
}
@Override
public ResultRecord selectLastResultRecordByStaffIdType(Long staffId, int type) {
return resultRecordMapper.selectLastResultRecordByStaffIdType(staffId,type);
}
@Override
public ResultRecord createResultRecord(Long staffId, int type, Long roleId) {
@ -347,7 +352,7 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
@Override
public ResultRecord initResult(Long staffId, Integer recordType, Long roleId) {
ResultRecord resultRecordOld = resultRecordService.selectResultRecordByStaffIdStatus(staffId,4);
ResultRecord resultRecordOld = resultRecordService.selectLastResultRecordByStaffIdType(staffId,1);
ResultRecord resultRecordNew = null;
if (resultRecordOld != null) {
Long oldResultRecordId = resultRecordOld.getId();
@ -355,6 +360,10 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
resultRecordOld.setId(null);
resultRecordOld.setType(Constant.TWO); // 1 表示是目标2 表示是业绩
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));
resultRecordService.insertResultRecord(resultRecordOld);
//删除月初目标

View File

@ -322,6 +322,9 @@
GROUP BY r.staff_id
</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>

View File

@ -158,6 +158,9 @@
<select id="selectFlowRecordByResultRecordIdType" resultType="com.lz.modules.flow.entity.FlowRecord">
select * from lz_flow_record where is_delete = 0 and record_id = #{resultRecordId} and type = #{type} and status = 0
</select>
<select id="selectFlowRecordByResultRecordIdTypeStatus" resultType="com.lz.modules.flow.entity.FlowRecord">
select * from lz_flow_record where is_delete = 0 and record_id = #{resultRecordId} and type = #{type} and status = #{status}
</select>
</mapper>