提交修改
This commit is contained in:
parent
316e4f0d25
commit
89cbd71a7c
@ -77,11 +77,9 @@ public class ResultRecordController extends AbstractController {
|
||||
@RequiresPermissions("user:lzresultrecord:list")
|
||||
public R list(ResultRecordReq req) {
|
||||
SysUserEntity user = getUser();
|
||||
|
||||
if(req.getIsSelf() == 1){
|
||||
req.setStaffId(user.getUserId());
|
||||
}
|
||||
|
||||
PageUtils page = lzResultRecordService.queryPage(req, user);
|
||||
List<DepartmentsDto> departmentList1 = departmentsService.selectByParentDepartmentId("0");
|
||||
return R.ok().put("page", page)
|
||||
@ -116,13 +114,13 @@ public class ResultRecordController extends AbstractController {
|
||||
// 获取权限
|
||||
Auth auth = new Auth();
|
||||
List<RecordAuth> listAuth = new ArrayList<>();
|
||||
if (req.getRecordType() == 1) { //新增目标
|
||||
if (req.getRecordType() == 1 && resultRecord == null) { //新增目标
|
||||
listAuth = recordAuthService.selectAuthInfo(7l);
|
||||
auth = recordAuthService.getAuth(listAuth);
|
||||
resultRecord = resultRecordService.createResultRecord(getUserId(), req.getRecordType(), 7l);
|
||||
flowRecordService.initFlowRecord(resultRecord, 7l, req.getType(), "月初目标");
|
||||
flowRecordService.initFlowRecord(resultRecord, 7l, req.getRecordType(), "月初目标");
|
||||
recordType = 3;
|
||||
} else if (req.getRecordType() == 2) { //新增业绩
|
||||
} else if (req.getRecordType() == 2 && resultRecord == null) { //新增业绩
|
||||
listAuth = recordAuthService.selectAuthInfo(8l);
|
||||
auth = recordAuthService.getAuth(listAuth);
|
||||
auth.setWenHuaEdit(1);
|
||||
@ -133,6 +131,7 @@ public class ResultRecordController extends AbstractController {
|
||||
listAuth = recordAuthService.selectAuthInfo(staffRoleMap.get(getUserId()));
|
||||
auth = recordAuthService.getAuth(listAuth);
|
||||
}
|
||||
|
||||
List<ResultDetail> resultDetails = resultDetailService.selectByRecordId(resultRecord.getId());
|
||||
if (CollectionUtils.isNotEmpty(resultDetails)) {
|
||||
Map<Integer, Long> details = resultDetails.stream().collect(Collectors.groupingBy(ResultDetail::getType, Collectors.counting()));
|
||||
|
||||
@ -11,11 +11,9 @@ import com.lz.modules.flow.model.StaffRoleDto;
|
||||
import com.lz.modules.flow.service.FlowRecordService;
|
||||
import com.lz.modules.sys.entity.app.ResultRecord;
|
||||
import com.lz.modules.sys.service.app.ResultRecordService;
|
||||
import org.apache.tomcat.util.bcel.Const;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -90,7 +88,7 @@ public class FlowRecordServiceImpl extends ServiceImpl<FlowRecordMapper, FlowRec
|
||||
|
||||
|
||||
@Override
|
||||
public void initFlowRecord(ResultRecord resultRecord, Long roleId , Integer type , String name) {
|
||||
public void initFlowRecord(ResultRecord resultRecord, Long roleId, Integer type, String name) {
|
||||
StaffEntity staffEntity = staffService.selectStaffById(resultRecord.getStaffId());
|
||||
FlowRecord flowRecord = new FlowRecord();
|
||||
flowRecord.setFlowStaffIdRole(StaffRoleDto.getStaffRole(resultRecord.getStaffId(), roleId));
|
||||
@ -99,11 +97,12 @@ public class FlowRecordServiceImpl extends ServiceImpl<FlowRecordMapper, FlowRec
|
||||
flowRecord.setApprovalStaffId(resultRecord.getStaffId());
|
||||
flowRecord.setApprovalStaffName(staffEntity.getName());
|
||||
flowRecord.setFlowIndex(0);
|
||||
flowRecord.setFlowName(staffEntity.getName() + "-"+name);
|
||||
flowRecord.setFlowName(staffEntity.getName() + "-" + name);
|
||||
flowRecord.setRecordStaffId(resultRecord.getStaffId());
|
||||
flowRecord.setRecordId(resultRecord.getId());
|
||||
flowRecord.setStatus(0);
|
||||
flowRecord.setDepartmentLevel(Constant.ME);
|
||||
flowRecordMapper.insertFlowRecord(flowRecord);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -70,6 +70,9 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
||||
@Autowired
|
||||
private StaffRoleService staffRoleService;
|
||||
|
||||
@Autowired
|
||||
private DepartmentsService departmentsService;
|
||||
|
||||
|
||||
|
||||
@Autowired
|
||||
@ -91,9 +94,6 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
||||
@Autowired
|
||||
private DepartmentsStaffRelateService departmentsStaffRelateService;
|
||||
|
||||
@Autowired
|
||||
private DepartmentsService departmentsService;
|
||||
|
||||
@Autowired
|
||||
private ResultDetailService resultDetailService;
|
||||
|
||||
@ -249,28 +249,37 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
||||
|
||||
|
||||
@Override
|
||||
public ResultRecord createResultRecord(Long staffId, int type,Long roleId) {
|
||||
public ResultRecord createResultRecord(Long staffId, int type, Long roleId) {
|
||||
StaffEntity staffEntity = staffService.selectStaffById(staffId);
|
||||
ResultRecord resultRecord = new ResultRecord();
|
||||
resultRecord.setMonthTime(new Date());
|
||||
resultRecord.setFlowStaffIdRole(resultDetailService.initRole(staffId,roleId));
|
||||
resultRecord.setFlowStaffIdRole(resultDetailService.initRole(staffId, roleId));
|
||||
resultRecord.setStaffId(staffId);
|
||||
resultRecord.setStatus(0);
|
||||
resultRecord.setType(type);
|
||||
resultRecord.setGmtCreate(new Date());
|
||||
resultRecord.setGmtModified(new Date());
|
||||
resultRecord.setStaffName(staffEntity.getName());
|
||||
DepartmentsStaffRelateEntity relateEntity = departmentsStaffRelateService.selectLastDepartmentByStaffId(staffId);
|
||||
Map<String, String> map = departmentsService.selectUserAllDepartmentIds(relateEntity.getDepartmentId());
|
||||
resultRecord.setDepartmentId(relateEntity.getDepartmentId());
|
||||
resultRecord.setDepartmentName(map.get(relateEntity.getDepartmentId()));
|
||||
resultRecordService.insertResultRecord(resultRecord);
|
||||
return resultRecord;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultRecord initResult(Long staffId ,Integer recordType,Long roleId) {
|
||||
public ResultRecord initResult(Long staffId, Integer recordType, Long roleId) {
|
||||
ResultRecord resultRecordOld = resultRecordService.selectResultRecordByStaffId(staffId);
|
||||
ResultRecord resultRecordNew = null;
|
||||
if (resultRecordOld != null) {
|
||||
Long recordId = resultRecordOld.getId();
|
||||
resultRecordOld.setId(null);
|
||||
resultRecordOld.setType(Constant.TWO);
|
||||
resultRecordOld.setType(Constant.TWO); // 1 表示是目标,2 表示是业绩
|
||||
resultRecordOld.setStatus(0);
|
||||
resultRecordOld.setFlowStaffIdRole(resultDetailService.initRole(resultRecordOld.getStaffId(), roleId));
|
||||
resultRecordService.insertResultRecord(resultRecordOld);
|
||||
flowRecordService.initFlowRecord(resultRecordOld,roleId,recordType,"月未总结");
|
||||
flowRecordService.initFlowRecord(resultRecordOld, roleId, recordType, "月未总结");
|
||||
resultRecordNew = resultRecordOld;
|
||||
List<ResultDetail> resultDetails = resultDetailService.selectByRecordId(recordId);
|
||||
if (CollectionUtils.isNotEmpty(resultDetails)) {
|
||||
@ -278,12 +287,12 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
||||
for (ResultDetail resultDetail : resultDetails) {
|
||||
resultDetail.setRecordId(resultRecordNew.getId());
|
||||
resultDetail.setId(null);
|
||||
resultDetail.setType(Constant.TWO);
|
||||
resultDetail.setType(1); // 表示业绩
|
||||
resultDetailService.insertResultDetail(resultDetail);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
resultRecordNew = resultRecordService.createResultRecord(staffId,recordType,roleId);
|
||||
resultRecordNew = resultRecordService.createResultRecord(staffId, recordType, roleId);
|
||||
}
|
||||
//保存文件价值观
|
||||
resultDetailService.insertWenHuaJiaZhiGua("做人:相信、包容、担当", resultRecordNew.getId(), staffId);
|
||||
@ -325,6 +334,7 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
||||
resultRecordService.updateFlowStaffIdRoleToNull(resultRecord.getId());// 更新用户权限
|
||||
return R.ok("流程审批结束");
|
||||
}
|
||||
|
||||
FlowRecord flowRecord = new FlowRecord();
|
||||
flowRecord.setRecordId(resultRecordId);
|
||||
flowRecord.setRecordStaffId(resultRecord.getStaffId());
|
||||
|
||||
@ -200,7 +200,7 @@
|
||||
and rd.staff_id = #{req.staffId}
|
||||
</if>
|
||||
order by fr.id desc )
|
||||
a GROUP BY department_id and id
|
||||
a GROUP by id order by department_id desc
|
||||
</select>
|
||||
|
||||
<update id="updateFlowStaffIdRoleToNull">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user