Merge branch 'version_report' of http://gitlab.ldxinyong.com/enterpriseManagement/lz_management into version_report
This commit is contained in:
commit
e2e5bf581e
@ -254,6 +254,8 @@ public class ResultRecordController extends AbstractController {
|
||||
String target = "审批通过";
|
||||
if (resultComment.getStatus() == 5) {
|
||||
target = "驳回";
|
||||
}else if (resultComment.getStatus() == 6){
|
||||
target = "申述";
|
||||
}
|
||||
comment.setTarget(target);
|
||||
comment.setKeyResult(resultComment.getComment());
|
||||
@ -263,12 +265,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()
|
||||
@ -398,12 +402,12 @@ public class ResultRecordController extends AbstractController {
|
||||
}
|
||||
if(batchOpt == 3 ){
|
||||
for (ResultRecord resultRecord : resultRecords) {
|
||||
r = resultRecordService.reject(resultRecord,1); //更新驳回状态
|
||||
r = resultRecordService.approval(resultRecord.getId(), resultRecord.getCurrentApprovalStaffId(),null,false);
|
||||
if (!r.isSuccess()) {
|
||||
return r;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
} else if(batchOpt == 4 ){
|
||||
for (ResultRecord resultRecord : resultRecords) {
|
||||
List<FlowRecord> list = flowRecordService.selectFlowRecordByResultRecordIdType(resultRecord.getId(), 2);
|
||||
for (int i = list.size() - 1; i >= 0; i--) {
|
||||
|
||||
@ -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);
|
||||
}
|
||||
@ -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);
|
||||
}
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -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);
|
||||
}
|
||||
@ -90,7 +90,10 @@ public interface ResultRecordService extends IService<ResultRecord> {
|
||||
ResultRecord selectResultRecordByStaffIdStatus(Long staffId, int status);
|
||||
|
||||
R reject( ResultRecord resultRecord,Integer status);
|
||||
|
||||
StaffEntity getApprovalStaff(ResultRecord resultRecord, String departmentLevel, List<StaffRoleDto> staffRoleDtos, Long roleId);
|
||||
|
||||
DepartmentsStaffRelateEntity getLeaderDepartmentsStaffRelateEntity(Long staffId);
|
||||
|
||||
ResultRecord selectLastResultRecordByStaffIdType(Long staffId, int type);
|
||||
}
|
||||
@ -4,14 +4,16 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.lz.common.utils.BigDecimalUtil;
|
||||
import com.lz.common.utils.Constant;
|
||||
import com.lz.common.utils.StringUtil;
|
||||
import com.lz.modules.app.entity.StaffEntity;
|
||||
import com.lz.modules.app.resp.ResultDetailResp;
|
||||
import com.lz.modules.app.resp.Step;
|
||||
import com.lz.modules.app.service.DepartmentsService;
|
||||
import com.lz.modules.app.service.StaffService;
|
||||
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.StaffRoleDto;
|
||||
import com.lz.modules.flow.service.*;
|
||||
@ -257,14 +259,13 @@ public class ResultDetailServiceImpl extends ServiceImpl<ResultDetailMapper, Res
|
||||
StaffEntity flowStaff = staffService.selectStaffById(flowDepartment.getStaffId());
|
||||
roleNameMap.put(departmentLevel,flowStaff.getName());
|
||||
}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<>();
|
||||
StaffEntity approvalStaff = resultRecordService.getApprovalStaff(resultRecord, departmentLevel, staffRoleDtos, roleId);
|
||||
roleNameMap.put(departmentLevel,approvalStaff.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
log.info("approvalList approval : " + Arrays.toString(approvalList.toArray()) + " roleNameMap : " + JSON.toJSONString(roleNameMap));
|
||||
for (int i = flowIndex; i < flowIndex + 10; i++) {
|
||||
int index = resultRecordService.getDepartmentLevelIndex(flows, i);
|
||||
|
||||
@ -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);
|
||||
//删除月初目标
|
||||
@ -526,7 +535,6 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
||||
.put("type", WorkMsgTypeEnum.SUBMIT);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public StaffEntity getApprovalStaff(ResultRecord resultRecord, String departmentLevel,List<StaffRoleDto> staffRoleDtos, Long roleId) {
|
||||
StaffEntity approvalStaff = null;
|
||||
@ -616,8 +624,9 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
||||
.put("to", approvalStaff)
|
||||
.put("type", WorkMsgTypeEnum.URGING);
|
||||
}else if (req.getStatus() == 6){
|
||||
// 向上级申述
|
||||
resultRecordService.approval(req.getRecordResultId(), userId,req.getStatus(),false);
|
||||
status = 6;
|
||||
// 回滚代码
|
||||
resultRecordService.reject(resultRecord,req.getStatus());
|
||||
}
|
||||
resultCommentService.addOrUpdateComment(req, userId, status,lastUsedFlowRecord);
|
||||
if(r != null){//下面推送消息
|
||||
|
||||
@ -3,9 +3,9 @@ spring:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
druid:
|
||||
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
|
||||
username: ldd_biz
|
||||
password: Hello1234
|
||||
url: jdbc:mysql://rm-bp1xhc66ruz72t68p.mysql.rds.aliyuncs.com:3306/lz_manger?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
|
||||
username: lz_manger
|
||||
password: N8zfBwhOC
|
||||
initial-size: 10
|
||||
max-active: 100
|
||||
min-idle: 10
|
||||
|
||||
@ -97,7 +97,7 @@
|
||||
<if test="priority != null">priority = #{priority}</if>
|
||||
</trim>
|
||||
,gmt_modified = now()
|
||||
where id = #{id}
|
||||
where id = #{id} limit 1
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
@ -327,6 +327,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>
|
||||
|
||||
@ -160,5 +160,11 @@
|
||||
</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>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user