提交修改
This commit is contained in:
parent
546b964a1e
commit
c4ca52bcf3
@ -134,14 +134,15 @@ public class ResultRecordController extends AbstractController {
|
||||
}
|
||||
}
|
||||
|
||||
PageUtils page = lzResultRecordService.queryPage(req, user);
|
||||
return R.ok().put("page", page)
|
||||
.put("departmentList1", departmentList1)
|
||||
R r = lzResultRecordService.queryPage(req, user);
|
||||
r .put("departmentList1", departmentList1)
|
||||
.put("departmentList2", departmentList2)
|
||||
.put("departmentList3", departmentList3)
|
||||
.put("department1", department1)
|
||||
.put("department2", department2)
|
||||
.put("department3", department3);
|
||||
return r ;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -270,7 +271,12 @@ public class ResultRecordController extends AbstractController {
|
||||
|
||||
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(flowRecords!=null && flowRecords.size() == 2) { // 表示可以撤回
|
||||
auth.setCancel(1);
|
||||
}
|
||||
}
|
||||
|
||||
return R.ok()
|
||||
.put("staffName", staffEntity.getName())
|
||||
.put("department1", departmentDto.getDepartment1())
|
||||
@ -351,7 +357,7 @@ public class ResultRecordController extends AbstractController {
|
||||
* 信息
|
||||
*/
|
||||
@RequestMapping("/recordIdsSubmit")
|
||||
public R recordIdsSubmit(String recordIds) {
|
||||
public R recordIdsSubmit(String recordIds,Integer batchOpt) {
|
||||
if (StringUtil.isBlank(recordIds)) {
|
||||
return R.error("请选择提交");
|
||||
}
|
||||
@ -367,20 +373,26 @@ public class ResultRecordController extends AbstractController {
|
||||
if (records == null) {
|
||||
return R.error("请选择状态为待提交的记录");
|
||||
}
|
||||
List<ResultRecord> resultRecords = resultRecordService.selectResultRecordByIds(records);
|
||||
for (ResultRecord resultRecord : resultRecords) {
|
||||
if (!resultRecord.getStatus().equals(3)) {
|
||||
return R.error("您的提交记录中有状态不为侍提交的,请重新选择。");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
R r = null;
|
||||
for (ResultRecord resultRecord : resultRecords) {
|
||||
r = resultRecordService.approval(resultRecord.getId(), getUserId());
|
||||
if (!r.isSuccess()) {
|
||||
return r;
|
||||
if(batchOpt == 1){
|
||||
List<ResultRecord> resultRecords = resultRecordService.selectResultRecordByIds(records);
|
||||
for (ResultRecord resultRecord : resultRecords) {
|
||||
if (!resultRecord.getStatus().equals(3)) {
|
||||
return R.error("您的提交记录中有状态不为侍提交的,请重新选择。");
|
||||
}
|
||||
}
|
||||
for (ResultRecord resultRecord : resultRecords) {
|
||||
r = resultRecordService.approval(resultRecord.getId(), getUserId(),null);
|
||||
if (!r.isSuccess()) {
|
||||
return r;
|
||||
}
|
||||
}
|
||||
}else if(batchOpt ==2 ){
|
||||
|
||||
}else if (batchOpt == 3 ){
|
||||
|
||||
}else if (batchOpt == 4 ){
|
||||
|
||||
}
|
||||
if (r != null && r.isSuccess()) {//批量提交
|
||||
StaffEntity mySelf = (StaffEntity) r.get("from");
|
||||
|
||||
@ -30,5 +30,6 @@ public class Auth {
|
||||
private int deleteDetail;
|
||||
private int dissatisfied;
|
||||
private int submited;//是否己经提交
|
||||
private int cancel;
|
||||
|
||||
}
|
||||
|
||||
@ -44,7 +44,7 @@ public interface ResultRecordService extends IService<ResultRecord> {
|
||||
|
||||
int deleteResultRecordById(Long id);
|
||||
|
||||
PageUtils queryPage(ResultRecordReq params, SysUserEntity user);
|
||||
R queryPage(ResultRecordReq params, SysUserEntity user);
|
||||
|
||||
|
||||
void deleteBatchIds(List<Long> asList);
|
||||
@ -53,7 +53,7 @@ public interface ResultRecordService extends IService<ResultRecord> {
|
||||
|
||||
void updateFlowStaffIdRoleToNull(Long id);
|
||||
|
||||
R approval(Long resultRecordId, Long userId);
|
||||
R approval(Long resultRecordId, Long userId,Integer status);
|
||||
|
||||
List<ResultRecord> selectResultRecordByIds(List<Long> recordIds);
|
||||
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
package com.lz.modules.sys.service.app.impl;
|
||||
|
||||
import cn.hutool.db.StatementUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@ -153,7 +152,7 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(ResultRecordReq params, SysUserEntity user) {
|
||||
public R queryPage(ResultRecordReq params, SysUserEntity user) {
|
||||
List<String> departmentIds = new ArrayList<>();
|
||||
List<DepartmentsEntity> tDepartments = departmentsDao.selectAll();
|
||||
if (StringUtil.isNotBlank(params.getDepartment1()) || StringUtil.isNotBlank(params.getDepartment2())
|
||||
@ -209,6 +208,7 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
||||
PageUtils pageUtils = PageUtils.startPage(params.getPage(), params.getLimit()).doSelect(
|
||||
page -> resultRecordMapper.selectByConditionByLeader(page, params)
|
||||
);
|
||||
|
||||
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM");
|
||||
List<ResultRecord> resultRecords = pageUtils.getList();
|
||||
if (CollectionUtils.isNotEmpty(resultRecords)) {
|
||||
@ -225,7 +225,8 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
||||
}
|
||||
pageUtils.setList(list);
|
||||
}
|
||||
return pageUtils;
|
||||
return R.ok().put("page", pageUtils)
|
||||
.put("departmentLevel",departmentLevel);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -397,7 +398,7 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
||||
}
|
||||
|
||||
@Override
|
||||
public R approval(Long resultRecordId, Long userId) {
|
||||
public R approval(Long resultRecordId, Long userId,Integer status) {
|
||||
ResultRecord resultRecord = resultRecordService.selectResultRecordById(resultRecordId);
|
||||
R r = resultRecordService.checkApproval(resultRecord,userId);
|
||||
if (!r.isSuccess()) {
|
||||
@ -438,6 +439,7 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
||||
.put("to", staff)
|
||||
.put("type", WorkMsgTypeEnum.PASS);
|
||||
}
|
||||
|
||||
FlowRecord flowRecord = new FlowRecord();
|
||||
flowRecord.setRecordId(resultRecordId);
|
||||
flowRecord.setRecordStaffId(resultRecord.getStaffId());
|
||||
@ -491,10 +493,9 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
||||
}
|
||||
flowRecordService.updateFlowRecordById(lastFlowRecordNoStatus);
|
||||
}
|
||||
|
||||
flowRecordService.insertFlowRecord(flowRecord);
|
||||
resultRecord.setFlowStaffIdRole(staffRoles);
|
||||
resultRecord.setStatus(1); //审批中
|
||||
resultRecord.setStatus(status != null ? status : 1); //如果状态不为空,则使用传入进来的状态,如果状态为空,则默认1,审批中
|
||||
resultRecord.setCurrentApprovalStaffId(approvalStaff != null ? approvalStaff.getId() : null);
|
||||
resultRecord.setCurrentApprovalStaffName(approvalStaff != null ? approvalStaff.getName() : null);
|
||||
resultRecordService.updateResultRecordById(resultRecord);// 更新用户权限
|
||||
@ -563,11 +564,12 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
||||
return R.error("请勿重复提交");
|
||||
}
|
||||
}
|
||||
|
||||
R r = null;
|
||||
int status = 1;
|
||||
FlowRecord lastUsedFlowRecord = flowRecordService.selectLastFlowRecordByRecordId(req.getRecordResultId());
|
||||
if (req.getStatus() == 2) {
|
||||
r = resultRecordService.approval(req.getRecordResultId(), userId);
|
||||
r = resultRecordService.approval(req.getRecordResultId(), userId,null);
|
||||
} else if (req.getStatus() == 3) { //侍提交
|
||||
resultRecord.setStatus(Constant.STATUS_3);
|
||||
resultRecordService.updateResultRecordById(resultRecord);
|
||||
@ -577,11 +579,11 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
||||
}else if (req.getStatus() == 7){
|
||||
List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByResultRecordIdType(req.getRecordResultId(),resultRecord.getType());
|
||||
if(flowRecords!=null && flowRecords.size() == 2){ // 表示可以撤回
|
||||
r = reject(resultRecord,req,userId);
|
||||
}else if(flowRecords!=null && flowRecords.size() > 2){
|
||||
r = reject(resultRecord, req, userId);
|
||||
} else if (flowRecords != null && flowRecords.size() > 2) {
|
||||
return R.error("你的领导己经审批,不能撤回了");
|
||||
}
|
||||
}else if(req.getStatus() == 8 ){
|
||||
} else if (req.getStatus() == 8) {
|
||||
Long staffId = resultRecord.getStaffId();
|
||||
Long approvalStaffId = resultRecord.getCurrentApprovalStaffId();
|
||||
StaffEntity mySelf = staffService.selectStaffById(staffId);
|
||||
@ -590,6 +592,9 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
||||
.put("from", mySelf)
|
||||
.put("to", approvalStaff)
|
||||
.put("type", WorkMsgTypeEnum.URGING);
|
||||
}else if (req.getStatus() == 6){
|
||||
// 向上级申述
|
||||
resultRecordService.approval(req.getRecordResultId(), userId,req.getStatus());
|
||||
}
|
||||
resultCommentService.addOrUpdateComment(req, userId, status,lastUsedFlowRecord);
|
||||
if(r != null){//下面推送消息
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user