提交修改
This commit is contained in:
parent
8dc09d65ef
commit
4dd07a1444
@ -633,6 +633,9 @@ public class StringUtil extends StringUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static String decodeBase64(String res) {
|
public static String decodeBase64(String res) {
|
||||||
|
if (StringUtil.isBlank(res)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
return new String(Base64.getDecoder().decode(res), "UTF-8");
|
return new String(Base64.getDecoder().decode(res), "UTF-8");
|
||||||
} catch (UnsupportedEncodingException e) {
|
} catch (UnsupportedEncodingException e) {
|
||||||
@ -642,6 +645,9 @@ public class StringUtil extends StringUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static String removeHtml(String html) {
|
public static String removeHtml(String html) {
|
||||||
|
if(StringUtil.isBlank(html)){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return html.replaceAll("\\<.*?>","");
|
return html.replaceAll("\\<.*?>","");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -65,6 +65,7 @@ public class ResultRecordController extends AbstractController {
|
|||||||
private ResultCommentService resultCommentService;
|
private ResultCommentService resultCommentService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 列表
|
* 列表
|
||||||
*/
|
*/
|
||||||
@ -87,11 +88,10 @@ public class ResultRecordController extends AbstractController {
|
|||||||
|
|
||||||
@RequestMapping("/getStaffResultDetail")
|
@RequestMapping("/getStaffResultDetail")
|
||||||
public R getStaffResultDetail(ResultRecordReq req) {
|
public R getStaffResultDetail(ResultRecordReq req) {
|
||||||
int firstRowspan = 0;
|
int yeJiCheckNum = 0;
|
||||||
int secondRowspan = 0;
|
int wenHuaJiaZhiGuanNum = 0;
|
||||||
int threeRowspan = 0;
|
int lastResultNum = 2;
|
||||||
int fourRowspan = 0;
|
int commentNum = 0;
|
||||||
int fiveRowspan = 0;
|
|
||||||
int recordType = req.getRecordType();
|
int recordType = req.getRecordType();
|
||||||
ResultRecord resultRecord = resultRecordService.selectResultRecordById(req.getRecordResultId());
|
ResultRecord resultRecord = resultRecordService.selectResultRecordById(req.getRecordResultId());
|
||||||
StaffEntity staffEntity = staffService.getById(resultRecord != null ? resultRecord.getStaffId() : getUserId());
|
StaffEntity staffEntity = staffService.getById(resultRecord != null ? resultRecord.getStaffId() : getUserId());
|
||||||
@ -146,55 +146,41 @@ public class ResultRecordController extends AbstractController {
|
|||||||
Map<Integer, Long> details = resultDetails.stream().collect(Collectors.groupingBy(ResultDetail::getType, Collectors.counting()));
|
Map<Integer, Long> details = resultDetails.stream().collect(Collectors.groupingBy(ResultDetail::getType, Collectors.counting()));
|
||||||
int tempType1 = NumberUtil.objToIntDefault(details.get(new Integer(1)), 0);
|
int tempType1 = NumberUtil.objToIntDefault(details.get(new Integer(1)), 0);
|
||||||
int tempType2 = NumberUtil.objToIntDefault(details.get(new Integer(2)), 0);
|
int tempType2 = NumberUtil.objToIntDefault(details.get(new Integer(2)), 0);
|
||||||
int type1 = tempType1;
|
yeJiCheckNum = tempType1;
|
||||||
int type2 = tempType2;
|
wenHuaJiaZhiGuanNum = tempType2;
|
||||||
if (tempType1 == 0) {
|
if (tempType1 == 0) {
|
||||||
type1 = 1;
|
yeJiCheckNum = 1;
|
||||||
list.add(resultDetailService.getYeJi());
|
list.add(resultDetailService.getYeJi());
|
||||||
list.add(resultDetailService.getYeJiKaoHe());
|
list.add(resultDetailService.getYeJiKaoHe());
|
||||||
}
|
}
|
||||||
if (tempType2 == 0) {
|
|
||||||
type2 = 2;
|
|
||||||
}
|
|
||||||
firstRowspan = type1;
|
|
||||||
secondRowspan = type1 + 1;
|
|
||||||
threeRowspan = type1 + 1 + type2;
|
|
||||||
fourRowspan = type1 + 1 + type2 + 1;
|
|
||||||
fiveRowspan = type1 + 1 + type2 + 2;
|
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for (ResultDetail resultDetail : resultDetails) {
|
for (ResultDetail resultDetail : resultDetails) {
|
||||||
count++;
|
count++;
|
||||||
ResultDetailResp resp = new ResultDetailResp();
|
ResultDetailResp resp = new ResultDetailResp();
|
||||||
BeanUtils.copyProperties(resultDetail, resp);
|
BeanUtils.copyProperties(resultDetail, resp);
|
||||||
resp.setCheckWeight(BigDecimalUtil.set2Scale(resp.getCheckWeight()));
|
|
||||||
if (resultDetail.getType() == 1) {
|
if (resultDetail.getType() == 1) {
|
||||||
resp.setCheckRange("业绩");
|
resp.setCheckRange("业绩");
|
||||||
} else if (resultDetail.getType() == 2) {
|
} else if (resultDetail.getType() == 2) {
|
||||||
resp.setCheckRange("文化价值观");
|
resp.setCheckRange("文化价值观");
|
||||||
}
|
}
|
||||||
if (count == type1) {
|
if (count == yeJiCheckNum) {
|
||||||
resp.setIsAdd(1);
|
resp.setIsAdd(1);
|
||||||
}
|
}
|
||||||
resp.setIsEdit(1);
|
resp.setIsEdit(1);
|
||||||
if (count == type1 + 1 && tempType1 != 0) {
|
if (count == yeJiCheckNum + 1 && tempType1 != 0) {
|
||||||
list.add(resultDetailService.getYeJiKaoHe());
|
list.add(resultDetailService.getYeJiKaoHe());
|
||||||
}
|
}
|
||||||
list.add(resp);
|
list.add(resp);
|
||||||
}
|
}
|
||||||
if (tempType2 == 0) {
|
if (tempType2 == 0) {
|
||||||
|
wenHuaJiaZhiGuanNum = 2;
|
||||||
list.add(resultDetailService.getYeJiKaoHe());
|
list.add(resultDetailService.getYeJiKaoHe());
|
||||||
list.add(resultDetailService.getWenHuaJiaZhiGua1(auth));
|
list.add(resultDetailService.getWenHuaJiaZhiGua1(auth));
|
||||||
list.add(resultDetailService.getWenHuaJiaZhiGua2(auth));
|
list.add(resultDetailService.getWenHuaJiaZhiGua2(auth));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
int type1 = 1;
|
yeJiCheckNum = 1;
|
||||||
int type2 = 2;
|
wenHuaJiaZhiGuanNum = 2;
|
||||||
firstRowspan = type1;
|
|
||||||
secondRowspan = type1 + 1;
|
|
||||||
threeRowspan = type1 + 1 + type2;
|
|
||||||
fourRowspan = type1 + 1 + type2 + 1;
|
|
||||||
fiveRowspan = type1 + 1 + type2 + 2;
|
|
||||||
|
|
||||||
list.add(resultDetailService.getYeJi());
|
list.add(resultDetailService.getYeJi());
|
||||||
list.add(resultDetailService.getYeJiKaoHe());
|
list.add(resultDetailService.getYeJiKaoHe());
|
||||||
list.add(resultDetailService.getWenHuaJiaZhiGua1(auth));
|
list.add(resultDetailService.getWenHuaJiaZhiGua1(auth));
|
||||||
@ -203,34 +189,44 @@ public class ResultRecordController extends AbstractController {
|
|||||||
list.add(resultDetailService.getWenHuaJiaZhiGuaResult1());
|
list.add(resultDetailService.getWenHuaJiaZhiGuaResult1());
|
||||||
list.add(resultDetailService.getWenHuaJiaZhiGuaResult2());
|
list.add(resultDetailService.getWenHuaJiaZhiGuaResult2());
|
||||||
list.add(resultDetailService.getLastResult());
|
list.add(resultDetailService.getLastResult());
|
||||||
|
|
||||||
|
List<ResultComment> comments = resultCommentService.selectByRecordId(resultRecord.getId());
|
||||||
|
if (CollectionUtils.isNotEmpty(comments)) {
|
||||||
|
ResultDetailResp header = new ResultDetailResp();
|
||||||
|
header.setCheckRange("领导");
|
||||||
|
header.setTarget("意见");
|
||||||
|
list.add(header);
|
||||||
|
commentNum = comments.size();
|
||||||
|
for (ResultComment resultComment : comments) {
|
||||||
|
ResultDetailResp comment = new ResultDetailResp();
|
||||||
|
comment.setCheckRange(resultComment.getStaffName());
|
||||||
|
comment.setTarget(resultComment.getComment());
|
||||||
|
list.add(comment);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String superStaff = recordAuthService.selectByStaffId(resultRecord.getStaffId());
|
||||||
return R.ok()
|
return R.ok()
|
||||||
.put("staffName", staffEntity.getName())
|
.put("staffName", staffEntity.getName())
|
||||||
.put("department1", departmentDto.getDepartment1())
|
.put("department1", departmentDto.getDepartment1())
|
||||||
.put("department2", departmentDto.getDepartment2())
|
.put("department2", departmentDto.getDepartment2())
|
||||||
.put("department3", departmentDto.getDepartment3())
|
.put("department3", departmentDto.getDepartment3())
|
||||||
.put("checkMonth", sdf3.format(resultRecord == null ? new Date() : resultRecord.getGmtCreate()))
|
.put("checkMonth", sdf3.format(resultRecord == null ? new Date() : resultRecord.getGmtCreate()))
|
||||||
.put("firstRowspan", firstRowspan)
|
|
||||||
.put("secondRowspan", secondRowspan)
|
|
||||||
.put("threeRowspan", threeRowspan)
|
|
||||||
.put("fourRowspan", fourRowspan)
|
|
||||||
.put("fiveRowspan", fiveRowspan)
|
|
||||||
.put("list", list)
|
.put("list", list)
|
||||||
.put("auth", auth)
|
.put("auth", auth)
|
||||||
.put("recordType", recordType)
|
.put("recordType", recordType)
|
||||||
.put("recordResultId", recordResultId);
|
.put("recordResultId", recordResultId)
|
||||||
|
.put("yeJiCheckNum", yeJiCheckNum)
|
||||||
|
.put("wenHuaJiaZhiGuanNum", wenHuaJiaZhiGuanNum)
|
||||||
|
.put("lastResultNum", lastResultNum)
|
||||||
|
.put("commentNum", commentNum)
|
||||||
|
.put("superStaff",superStaff);
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/commitApproval")
|
@RequestMapping("/commitApproval")
|
||||||
public R commitApproval(ResultRecordReq req) {
|
public R commitApproval(ResultRecordReq req) {
|
||||||
|
resultCommentService.addOrUpdateComment(req, getUserId());
|
||||||
if (req.getStatus() == 2) {
|
if (req.getStatus() == 2) {
|
||||||
String resultComment = StringUtil.decodeBase64(req.getResultComment());
|
|
||||||
resultComment = StringUtil.removeHtml(resultComment);
|
|
||||||
if (StringUtil.isNotBlank(resultComment)) {
|
|
||||||
ResultComment comment = new ResultComment();
|
|
||||||
comment.setCommentUserId(getUserId());
|
|
||||||
comment.setRecordId(req.getRecordResultId());
|
|
||||||
resultCommentService.insertResultComment(comment);
|
|
||||||
}
|
|
||||||
return resultRecordService.approval(req.getRecordResultId(), getUserId());
|
return resultRecordService.approval(req.getRecordResultId(), getUserId());
|
||||||
} else if (req.getStatus() == 3) { //侍提交
|
} else if (req.getStatus() == 3) { //侍提交
|
||||||
ResultRecord resultRecord = resultRecordService.selectResultRecordById(req.getRecordResultId());
|
ResultRecord resultRecord = resultRecordService.selectResultRecordById(req.getRecordResultId());
|
||||||
@ -259,6 +255,17 @@ public class ResultRecordController extends AbstractController {
|
|||||||
return R.ok().put("detailInfo", detail);
|
return R.ok().put("detailInfo", detail);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 信息
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getResultComment/{recordId}")
|
||||||
|
public R getResultComment(@PathVariable("recordId") Long recordId) {
|
||||||
|
ResultComment resultComment = resultCommentService.selectLastComment(recordId);
|
||||||
|
if (resultComment == null || !getUserId().equals(resultComment.getStaffId())) {
|
||||||
|
resultComment = new ResultComment();
|
||||||
|
}
|
||||||
|
return R.ok().put("resultComment", resultComment);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 信息
|
* 信息
|
||||||
@ -269,6 +276,43 @@ public class ResultRecordController extends AbstractController {
|
|||||||
return R.ok("删除成功");
|
return R.ok("删除成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 信息
|
||||||
|
*/
|
||||||
|
@RequestMapping("/recordIdsSubmit")
|
||||||
|
public R recordIdsSubmit(String recordIds) {
|
||||||
|
if (StringUtil.isBlank(recordIds)) {
|
||||||
|
return R.error("请选择状态为待提交的记录");
|
||||||
|
}
|
||||||
|
List<Long> records = new ArrayList<>();
|
||||||
|
String ids[] = recordIds.split(",");
|
||||||
|
if (ids != null && ids.length > 0) {
|
||||||
|
for (String id : ids) {
|
||||||
|
if (StringUtil.isNotBlank(id)) {
|
||||||
|
records.add(NumberUtil.objToLongDefault(id, 0));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (recordIds == null) {
|
||||||
|
return R.error("请选择状态为待提交的记录");
|
||||||
|
}
|
||||||
|
List<ResultRecord> resultRecords = resultRecordService.selectResultRecordByIds(records);
|
||||||
|
for (ResultRecord resultRecord : resultRecords) {
|
||||||
|
if (!resultRecord.getStatus().equals(3)) {
|
||||||
|
return R.error("您的提交记录中有状态不为侍提交的,请重新选择。");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
new Thread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
for (ResultRecord resultRecord : resultRecords) {
|
||||||
|
resultRecordService.approval(resultRecord.getId(), getUserId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
return R.ok("批量提交成功");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 信息
|
* 信息
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -54,4 +54,6 @@ public interface DepartmentsStaffRelateDao extends BaseMapper<DepartmentsStaffRe
|
|||||||
DepartmentsStaffRelateEntity selectLastDepartmentByStaffId(@Param("staffId") Long staffId);
|
DepartmentsStaffRelateEntity selectLastDepartmentByStaffId(@Param("staffId") Long staffId);
|
||||||
|
|
||||||
DepartmentsStaffRelateEntity selectLeaderByDepartmentId(@Param("departmentId") String departmentId);
|
DepartmentsStaffRelateEntity selectLeaderByDepartmentId(@Param("departmentId") String departmentId);
|
||||||
|
|
||||||
|
DepartmentsStaffRelateEntity selectDepartmentByDepartmentId(@Param("departmentId") String departmentId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -33,4 +33,5 @@ public class ResultRecordReq {
|
|||||||
private Integer recordType;
|
private Integer recordType;
|
||||||
private String departmentLevel ;
|
private String departmentLevel ;
|
||||||
private String resultComment;
|
private String resultComment;
|
||||||
|
private Long resultCommitId;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -36,5 +36,7 @@ public interface DepartmentsStaffRelateService extends IService<DepartmentsStaff
|
|||||||
DepartmentsStaffRelateEntity selectLastDepartmentByStaffId(Long staffId);
|
DepartmentsStaffRelateEntity selectLastDepartmentByStaffId(Long staffId);
|
||||||
|
|
||||||
DepartmentsStaffRelateEntity selectLeaderByDepartmentId(String departmentId);
|
DepartmentsStaffRelateEntity selectLeaderByDepartmentId(String departmentId);
|
||||||
|
|
||||||
|
DepartmentsStaffRelateEntity selectDepartmentByDepartmentId(String departmentId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,6 @@ package com.lz.modules.app.service.impl;
|
|||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.lz.common.utils.StringUtil;
|
import com.lz.common.utils.StringUtil;
|
||||||
import com.lz.modules.app.entity.StaffEntity;
|
|
||||||
import com.lz.modules.job.model.responseBo.DepartmentStaffBo;
|
import com.lz.modules.job.model.responseBo.DepartmentStaffBo;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@ -81,5 +80,10 @@ public class DepartmentsStaffRelateServiceImpl extends ServiceImpl<DepartmentsSt
|
|||||||
return departmentsStaffRelateDao.selectLeaderByDepartmentId(departmentId);
|
return departmentsStaffRelateDao.selectLeaderByDepartmentId(departmentId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DepartmentsStaffRelateEntity selectDepartmentByDepartmentId(String departmentId) {
|
||||||
|
return departmentsStaffRelateDao.selectDepartmentByDepartmentId(departmentId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,6 +20,7 @@ public class Auth {
|
|||||||
private int acquireScore;
|
private int acquireScore;
|
||||||
private int wenhuaAdd;
|
private int wenhuaAdd;
|
||||||
private int wenHuaEdit;
|
private int wenHuaEdit;
|
||||||
|
private int waitCommit;
|
||||||
|
private int approvelCommit;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,4 +39,6 @@ public interface RecordAuthService extends IService<RecordAuth> {
|
|||||||
Map<Long ,Long > selectRoleIdByStaffRoleInfo(String flowStaffIdRole);
|
Map<Long ,Long > selectRoleIdByStaffRoleInfo(String flowStaffIdRole);
|
||||||
|
|
||||||
Auth getAuth(List<RecordAuth> listAuth);
|
Auth getAuth(List<RecordAuth> listAuth);
|
||||||
|
|
||||||
|
String selectByStaffId(Long staffId);
|
||||||
}
|
}
|
||||||
@ -4,6 +4,12 @@ import com.alibaba.fastjson.JSONObject;
|
|||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.lz.common.utils.NumberUtil;
|
import com.lz.common.utils.NumberUtil;
|
||||||
import com.lz.common.utils.StringUtil;
|
import com.lz.common.utils.StringUtil;
|
||||||
|
import com.lz.modules.app.entity.DepartmentsEntity;
|
||||||
|
import com.lz.modules.app.entity.DepartmentsStaffRelateEntity;
|
||||||
|
import com.lz.modules.app.entity.StaffEntity;
|
||||||
|
import com.lz.modules.app.service.DepartmentsService;
|
||||||
|
import com.lz.modules.app.service.DepartmentsStaffRelateService;
|
||||||
|
import com.lz.modules.app.service.StaffService;
|
||||||
import com.lz.modules.flow.dao.RecordAuthMapper;
|
import com.lz.modules.flow.dao.RecordAuthMapper;
|
||||||
import com.lz.modules.flow.entity.RecordAuth;
|
import com.lz.modules.flow.entity.RecordAuth;
|
||||||
import com.lz.modules.flow.model.Auth;
|
import com.lz.modules.flow.model.Auth;
|
||||||
@ -34,6 +40,14 @@ public class RecordAuthServiceImpl extends ServiceImpl<RecordAuthMapper, RecordA
|
|||||||
@Autowired
|
@Autowired
|
||||||
private RecordAuthMapper recordAuthMapper;
|
private RecordAuthMapper recordAuthMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private StaffService staffService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DepartmentsStaffRelateService departmentsStaffRelateService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DepartmentsService departmentsService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public RecordAuth selectRecordAuthById(Long id){
|
public RecordAuth selectRecordAuthById(Long id){
|
||||||
@ -104,8 +118,32 @@ public class RecordAuthServiceImpl extends ServiceImpl<RecordAuthMapper, RecordA
|
|||||||
auth.setTarget(NumberUtil.objToIntDefault(map.get("target"), 0));
|
auth.setTarget(NumberUtil.objToIntDefault(map.get("target"), 0));
|
||||||
auth.setEdit(NumberUtil.objToIntDefault(map.get("edit"), 0));
|
auth.setEdit(NumberUtil.objToIntDefault(map.get("edit"), 0));
|
||||||
auth.setAcquireScore(NumberUtil.objToIntDefault(map.get("acquireScore"), 0));
|
auth.setAcquireScore(NumberUtil.objToIntDefault(map.get("acquireScore"), 0));
|
||||||
|
auth.setWenhuaAdd(NumberUtil.objToIntDefault(map.get("wenhuaAdd"), 0));
|
||||||
|
auth.setWenHuaEdit(NumberUtil.objToIntDefault(map.get("wenHuaEdit"), 0));
|
||||||
|
auth.setWaitCommit(NumberUtil.objToIntDefault(map.get("waitCommit"), 0));
|
||||||
|
auth.setApprovelCommit(NumberUtil.objToIntDefault(map.get("approvelCommit"), 0));
|
||||||
|
|
||||||
return auth;
|
return auth;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String selectByStaffId(Long staffId) {
|
||||||
|
DepartmentsStaffRelateEntity departmentsStaffRelateEntity = departmentsStaffRelateService.selectLastDepartmentByStaffId(staffId);
|
||||||
|
if (departmentsStaffRelateEntity.getIsLeader().equals(1)) {//如果是部门领导
|
||||||
|
DepartmentsEntity department = departmentsService.selectByDepartmentId(departmentsStaffRelateEntity.getDepartmentId());
|
||||||
|
DepartmentsStaffRelateEntity parentRelation = departmentsStaffRelateService.selectDepartmentByDepartmentId(department.getDepartmentId());
|
||||||
|
if(parentRelation !=null){
|
||||||
|
StaffEntity staffEntity = staffService.selectStaffById(parentRelation.getStaffId());
|
||||||
|
return staffEntity.getName();
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
} else {
|
||||||
|
DepartmentsStaffRelateEntity leader = departmentsStaffRelateService.selectLeaderByDepartmentId(departmentsStaffRelateEntity.getDepartmentId());
|
||||||
|
StaffEntity staffEntity = staffService.selectStaffById(leader.getStaffId());
|
||||||
|
return staffEntity.getName();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,6 +11,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||||||
import com.lz.modules.sys.entity.app.ResultComment;
|
import com.lz.modules.sys.entity.app.ResultComment;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface ResultCommentMapper extends BaseMapper<ResultComment> {
|
public interface ResultCommentMapper extends BaseMapper<ResultComment> {
|
||||||
|
|
||||||
@ -30,4 +33,9 @@ public interface ResultCommentMapper extends BaseMapper<ResultComment> {
|
|||||||
int deleteResultCommentById(@Param("id")Long id);
|
int deleteResultCommentById(@Param("id")Long id);
|
||||||
|
|
||||||
|
|
||||||
|
List<ResultComment> selectByRecordId(@Param("recordId") Long recordId);
|
||||||
|
|
||||||
|
ResultComment selectLastComment(@Param("recordId") Long recordId);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -48,4 +48,6 @@ public interface ResultRecordMapper extends BaseMapper<ResultRecord> {
|
|||||||
List<ResultRecordDto> selectByConditionByLeader(@Param("page") IPage page, @Param("req") ResultRecordReq params);
|
List<ResultRecordDto> selectByConditionByLeader(@Param("page") IPage page, @Param("req") ResultRecordReq params);
|
||||||
|
|
||||||
void updateFlowStaffIdRoleToNull(@Param("id") Long id);
|
void updateFlowStaffIdRoleToNull(@Param("id") Long id);
|
||||||
|
|
||||||
|
List<ResultRecord> selectResultRecordByIds(@Param("recordIds") List<Long> recordIds);
|
||||||
}
|
}
|
||||||
@ -9,7 +9,7 @@ import java.util.Date;
|
|||||||
* 菜单权限表
|
* 菜单权限表
|
||||||
* </p>*业绩评论表
|
* </p>*业绩评论表
|
||||||
* @author quyixiao
|
* @author quyixiao
|
||||||
* @since 2020-08-10
|
* @since 2020-08-21
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@ -27,7 +27,11 @@ public class ResultComment implements java.io.Serializable {
|
|||||||
//记录id
|
//记录id
|
||||||
private Long recordId;
|
private Long recordId;
|
||||||
//评论用户id
|
//评论用户id
|
||||||
private Long commentUserId;
|
private Long staffId;
|
||||||
|
//评论内容
|
||||||
|
private String comment;
|
||||||
|
//评论用户名称
|
||||||
|
private String staffName;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
@ -107,15 +111,45 @@ public class ResultComment implements java.io.Serializable {
|
|||||||
* 评论用户id
|
* 评论用户id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Long getCommentUserId() {
|
public Long getStaffId() {
|
||||||
return commentUserId;
|
return staffId;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 评论用户id
|
* 评论用户id
|
||||||
* @param commentUserId
|
* @param staffId
|
||||||
*/
|
*/
|
||||||
public void setCommentUserId(Long commentUserId) {
|
public void setStaffId(Long staffId) {
|
||||||
this.commentUserId = commentUserId;
|
this.staffId = staffId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 评论内容
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String getComment() {
|
||||||
|
return comment;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 评论内容
|
||||||
|
* @param comment
|
||||||
|
*/
|
||||||
|
public void setComment(String comment) {
|
||||||
|
this.comment = comment;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 评论用户名称
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String getStaffName() {
|
||||||
|
return staffName;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 评论用户名称
|
||||||
|
* @param staffName
|
||||||
|
*/
|
||||||
|
public void setStaffName(String staffName) {
|
||||||
|
this.staffName = staffName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -126,7 +160,9 @@ public class ResultComment implements java.io.Serializable {
|
|||||||
",gmtCreate=" + gmtCreate +
|
",gmtCreate=" + gmtCreate +
|
||||||
",gmtModified=" + gmtModified +
|
",gmtModified=" + gmtModified +
|
||||||
",recordId=" + recordId +
|
",recordId=" + recordId +
|
||||||
",commentUserId=" + commentUserId +
|
",staffId=" + staffId +
|
||||||
|
",comment=" + comment +
|
||||||
|
",staffName=" + staffName +
|
||||||
"}";
|
"}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,8 +1,11 @@
|
|||||||
package com.lz.modules.sys.service.app;
|
package com.lz.modules.sys.service.app;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.lz.modules.app.req.ResultRecordReq;
|
||||||
import com.lz.modules.sys.entity.app.ResultComment;
|
import com.lz.modules.sys.entity.app.ResultComment;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 业绩评论表 服务类
|
* 业绩评论表 服务类
|
||||||
@ -30,4 +33,10 @@ public interface ResultCommentService extends IService<ResultComment> {
|
|||||||
int deleteResultCommentById(Long id);
|
int deleteResultCommentById(Long id);
|
||||||
|
|
||||||
|
|
||||||
|
List<ResultComment> selectByRecordId(Long id);
|
||||||
|
|
||||||
|
ResultComment selectLastComment(Long recordId);
|
||||||
|
|
||||||
|
|
||||||
|
void addOrUpdateComment(ResultRecordReq req,Long userId);
|
||||||
}
|
}
|
||||||
@ -46,4 +46,6 @@ public interface ResultRecordService extends IService<ResultRecord> {
|
|||||||
void updateFlowStaffIdRoleToNull(Long id);
|
void updateFlowStaffIdRoleToNull(Long id);
|
||||||
|
|
||||||
R approval(Long resultRecordId, Long userId);
|
R approval(Long resultRecordId, Long userId);
|
||||||
|
|
||||||
|
List<ResultRecord> selectResultRecordByIds(List<Long> recordIds);
|
||||||
}
|
}
|
||||||
@ -1,12 +1,18 @@
|
|||||||
package com.lz.modules.sys.service.app.impl;
|
package com.lz.modules.sys.service.app.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.lz.common.utils.StringUtil;
|
||||||
|
import com.lz.modules.app.entity.StaffEntity;
|
||||||
|
import com.lz.modules.app.req.ResultRecordReq;
|
||||||
|
import com.lz.modules.app.service.StaffService;
|
||||||
import com.lz.modules.sys.dao.app.ResultCommentMapper;
|
import com.lz.modules.sys.dao.app.ResultCommentMapper;
|
||||||
import com.lz.modules.sys.entity.app.ResultComment;
|
import com.lz.modules.sys.entity.app.ResultComment;
|
||||||
import com.lz.modules.sys.service.app.ResultCommentService;
|
import com.lz.modules.sys.service.app.ResultCommentService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 业绩评论表 服务类
|
* 业绩评论表 服务类
|
||||||
@ -23,6 +29,11 @@ public class ResultCommentServiceImpl extends ServiceImpl<ResultCommentMapper, R
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ResultCommentMapper resultCommentMapper;
|
private ResultCommentMapper resultCommentMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ResultCommentService resultCommentService;
|
||||||
|
@Autowired
|
||||||
|
private StaffService staffService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -58,6 +69,40 @@ public class ResultCommentServiceImpl extends ServiceImpl<ResultCommentMapper, R
|
|||||||
return resultCommentMapper.deleteResultCommentById(id);
|
return resultCommentMapper.deleteResultCommentById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ResultComment> selectByRecordId(Long recordId) {
|
||||||
|
return resultCommentMapper.selectByRecordId(recordId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResultComment selectLastComment(Long recordId) {
|
||||||
|
return resultCommentMapper.selectLastComment(recordId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addOrUpdateComment(ResultRecordReq req, Long staffId) {
|
||||||
|
ResultComment comment = resultCommentService.selectResultCommentById(req.getResultCommitId());
|
||||||
|
//如果评论不为空
|
||||||
|
String resultComment = StringUtil.decodeBase64(req.getResultComment());
|
||||||
|
String content = StringUtil.removeHtml(resultComment);
|
||||||
|
if (StringUtil.isNotBlank(content)) { //如果不为空,则
|
||||||
|
if (comment == null) {
|
||||||
|
StaffEntity mySelf = staffService.selectStaffById(staffId);
|
||||||
|
comment = new ResultComment();
|
||||||
|
comment.setStaffId(staffId);
|
||||||
|
comment.setRecordId(req.getRecordResultId());
|
||||||
|
comment.setComment(resultComment);
|
||||||
|
comment.setStaffName(mySelf.getName());
|
||||||
|
resultCommentService.insertResultComment(comment);
|
||||||
|
} else {
|
||||||
|
comment.setComment(resultComment);
|
||||||
|
resultCommentService.updateResultCommentById(comment);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (comment != null) { //如果 comment 不为空,删除评论
|
||||||
|
resultCommentService.deleteResultCommentById(comment.getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -91,6 +91,7 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResultRecord selectResultRecordById(Long id) {
|
public ResultRecord selectResultRecordById(Long id) {
|
||||||
return resultRecordMapper.selectResultRecordById(id);
|
return resultRecordMapper.selectResultRecordById(id);
|
||||||
@ -270,7 +271,6 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
|||||||
resultRecordService.updateFlowStaffIdRoleToNull(resultRecord.getId());// 更新用户权限
|
resultRecordService.updateFlowStaffIdRoleToNull(resultRecord.getId());// 更新用户权限
|
||||||
return R.ok("流程审批结束");
|
return R.ok("流程审批结束");
|
||||||
}
|
}
|
||||||
|
|
||||||
FlowRecord flowRecord = new FlowRecord();
|
FlowRecord flowRecord = new FlowRecord();
|
||||||
flowRecord.setRecordId(resultRecordId);
|
flowRecord.setRecordId(resultRecordId);
|
||||||
flowRecord.setRecordStaffId(resultRecord.getStaffId());
|
flowRecord.setRecordStaffId(resultRecord.getStaffId());
|
||||||
@ -315,10 +315,16 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
|||||||
flowRecord.setFlowStaffIdRole(staffRoles);
|
flowRecord.setFlowStaffIdRole(staffRoles);
|
||||||
flowRecordService.insertFlowRecord(flowRecord);
|
flowRecordService.insertFlowRecord(flowRecord);
|
||||||
resultRecord.setFlowStaffIdRole(staffRoles);
|
resultRecord.setFlowStaffIdRole(staffRoles);
|
||||||
|
resultRecord.setStatus(1); //审批中
|
||||||
resultRecordService.updateResultRecordById(resultRecord);// 更新用户权限
|
resultRecordService.updateResultRecordById(resultRecord);// 更新用户权限
|
||||||
return R.ok("提交审批成功");
|
return R.ok("提交审批成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ResultRecord> selectResultRecordByIds(List<Long> recordIds) {
|
||||||
|
return resultRecordMapper.selectResultRecordByIds(recordIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public int getDepartmentLevelIndex(List<Flow> list, int flowIndex) {
|
public int getDepartmentLevelIndex(List<Flow> list, int flowIndex) {
|
||||||
if (flowIndex > list.size()) {
|
if (flowIndex > list.size()) {
|
||||||
|
|||||||
@ -9,13 +9,15 @@
|
|||||||
<result column="gmt_create" property="gmtCreate"/>
|
<result column="gmt_create" property="gmtCreate"/>
|
||||||
<result column="gmt_modified" property="gmtModified"/>
|
<result column="gmt_modified" property="gmtModified"/>
|
||||||
<result column="record_id" property="recordId"/>
|
<result column="record_id" property="recordId"/>
|
||||||
<result column="comment_user_id" property="commentUserId"/>
|
<result column="staff_id" property="staffId"/>
|
||||||
|
<result column="comment" property="comment"/>
|
||||||
|
<result column="staff_name" property="staffName"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
<!-- 通用查询结果列 -->
|
<!-- 通用查询结果列 -->
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, record_id AS recordId, comment_user_id AS commentUserId
|
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, record_id AS recordId, staff_id AS staffId, comment AS comment, staff_name AS staffName
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
|
||||||
@ -29,13 +31,17 @@
|
|||||||
<insert id="insertResultComment" parameterType="ResultComment" useGeneratedKeys="true" keyProperty="id" >
|
<insert id="insertResultComment" parameterType="ResultComment" useGeneratedKeys="true" keyProperty="id" >
|
||||||
insert into lz_result_comment(
|
insert into lz_result_comment(
|
||||||
<if test="recordId != null">record_id, </if>
|
<if test="recordId != null">record_id, </if>
|
||||||
<if test="commentUserId != null">comment_user_id, </if>
|
<if test="staffId != null">staff_id, </if>
|
||||||
|
<if test="comment != null">comment, </if>
|
||||||
|
<if test="staffName != null">staff_name, </if>
|
||||||
is_delete,
|
is_delete,
|
||||||
gmt_create,
|
gmt_create,
|
||||||
gmt_modified
|
gmt_modified
|
||||||
)values(
|
)values(
|
||||||
<if test="recordId != null">#{ recordId}, </if>
|
<if test="recordId != null">#{ recordId}, </if>
|
||||||
<if test="commentUserId != null">#{ commentUserId}, </if>
|
<if test="staffId != null">#{ staffId}, </if>
|
||||||
|
<if test="comment != null">#{ comment}, </if>
|
||||||
|
<if test="staffName != null">#{ staffName}, </if>
|
||||||
0,
|
0,
|
||||||
now(),
|
now(),
|
||||||
now()
|
now()
|
||||||
@ -50,7 +56,9 @@
|
|||||||
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
||||||
<if test="gmtCreate != null">gmt_create = #{gmtCreate},</if>
|
<if test="gmtCreate != null">gmt_create = #{gmtCreate},</if>
|
||||||
<if test="recordId != null">record_id = #{recordId},</if>
|
<if test="recordId != null">record_id = #{recordId},</if>
|
||||||
<if test="commentUserId != null">comment_user_id = #{commentUserId}</if>
|
<if test="staffId != null">staff_id = #{staffId},</if>
|
||||||
|
<if test="comment != null">comment = #{comment},</if>
|
||||||
|
<if test="staffName != null">staff_name = #{staffName}</if>
|
||||||
</trim>
|
</trim>
|
||||||
,gmt_modified = now()
|
,gmt_modified = now()
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
@ -64,7 +72,9 @@
|
|||||||
is_delete = #{isDelete},
|
is_delete = #{isDelete},
|
||||||
gmt_create = #{gmtCreate},
|
gmt_create = #{gmtCreate},
|
||||||
record_id = #{recordId},
|
record_id = #{recordId},
|
||||||
comment_user_id = #{commentUserId}
|
staff_id = #{staffId},
|
||||||
|
comment = #{comment},
|
||||||
|
staff_name = #{staffName}
|
||||||
,gmt_modified = now()
|
,gmt_modified = now()
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
@ -74,5 +84,17 @@
|
|||||||
update lz_result_comment set is_delete = 1 where id=#{id} limit 1
|
update lz_result_comment set is_delete = 1 where id=#{id} limit 1
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectByRecordId" resultType="com.lz.modules.sys.entity.app.ResultComment">
|
||||||
|
select * from lz_result_comment where record_id=#{recordId} and is_delete = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectLastComment" resultType="com.lz.modules.sys.entity.app.ResultComment">
|
||||||
|
select * from lz_result_comment where record_id=#{recordId} and is_delete = 0 order by id desc limit 1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|||||||
@ -204,9 +204,15 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<update id="updateFlowStaffIdRoleToNull">
|
<update id="updateFlowStaffIdRoleToNull">
|
||||||
update lz_result_record set flow_staff_id_role = '[]' where id = #{id}
|
update lz_result_record set flow_staff_id_role = '[]',status = 4 where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<select id="selectResultRecordByIds" resultType="com.lz.modules.sys.entity.app.ResultRecord">
|
||||||
|
select * from lz_result_record where is_delete = 0 and id in
|
||||||
|
<foreach collection="recordIds" item="item" index="index" separator="," open="(" close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|||||||
@ -71,5 +71,10 @@
|
|||||||
select * from lz_departments_staff_relate where is_delete=0 and department_id = #{departmentId} and is_leader = 1 limit 1
|
select * from lz_departments_staff_relate where is_delete=0 and department_id = #{departmentId} and is_leader = 1 limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectDepartmentByDepartmentId"
|
||||||
|
resultType="com.lz.modules.app.entity.DepartmentsStaffRelateEntity">
|
||||||
|
select * from lz_departments_staff_relate where is_delete=0 and department_id = #{departmentId} limit 1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@ -62,7 +62,7 @@ public class MysqlMain {
|
|||||||
List<TablesBean> list = new ArrayList<TablesBean>();
|
List<TablesBean> list = new ArrayList<TablesBean>();
|
||||||
|
|
||||||
|
|
||||||
list.add(new TablesBean("lz_flow_record"));
|
list.add(new TablesBean("lz_result_comment"));
|
||||||
|
|
||||||
|
|
||||||
List<TablesBean> list2 = new ArrayList<TablesBean>();
|
List<TablesBean> list2 = new ArrayList<TablesBean>();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user