提交修改

This commit is contained in:
quyixiao 2020-11-20 17:13:38 +08:00
commit 67049f5df3
33 changed files with 677 additions and 207 deletions

View File

@ -23,6 +23,7 @@ public enum WorkMsgTypeEnum {
SCORE(9, "绩效考评待办事项", "评分", "\n @的绩效\n \n 需您去评分"),
SKIP(10, "绩效跳过", "跳过", "# @的绩效\n ## 己经跳过"),
TRANSFER(11, "绩效转交", "转交", "# @的绩效\n ## 己经转交"),
CLEARN(10, "绩效转交", "转交", "# @的绩效\n ## 己经转交"),
// 您的2020年10月绩效考核已经开始请尽快制定绩效目标
// 吴林的2020年12月绩效考核的目标需要您确认点击前往确认
;

View File

@ -19,6 +19,7 @@ import com.lz.modules.sys.entity.SysUserEntity;
import com.lz.modules.sys.service.SysUserTokenService;
import com.lz.modules.third.entity.ThirdAppConfig;
import com.lz.modules.third.entity.ThirdMsgSendRecord;
import com.lz.modules.third.entity.WorkMsg;
import com.lz.modules.third.service.ThirdAppConfigService;
import com.lz.modules.third.service.ThirdMsgSendRecordService;
import com.taobao.api.ApiException;
@ -319,20 +320,22 @@ public class DingTalkUtil {
return msg;
}
//发送待办任务
public String sendSingleWorkMSG(String appid, StaffEntity staff, String title, String title1,
String content1, String title2,
String content2, String title3,
String content3, String singleUrl, String token, String from) {
public String sendSingleWorkMSG(String appid, StaffEntity staff, String title, List<WorkMsg> msgs,
String singleUrl, String token, String from,
int type, Long workId) {
String msg = "OK";
ThirdMsgSendRecord thirdMsgSendRecord = new ThirdMsgSendRecord();
thirdMsgSendRecord.setMsgType("work_msg");
thirdMsgSendRecord.setStaffId(staff.getId());
thirdMsgSendRecord.setMsgTitle(title1 + "#" + title2 + "#" + title3);
thirdMsgSendRecord.setMsgTitle("待办任务");
thirdMsgSendRecord.setAppId(appid);
thirdMsgSendRecord.setHeadText(title);
thirdMsgSendRecord.setMsgContent(content1 + "#" + content2 + "#" + content3);
thirdMsgSendRecord.setMsgContent(JSONObject.toJSONString(msgs));
thirdMsgSendRecord.setMsgUrl(singleUrl);
thirdMsgSendRecord.setWorkType(type);
thirdMsgSendRecord.setEmployeeId(staff.getEmployeeId());
thirdMsgSendRecord.setWorkId(workId);
thirdMsgSendRecord.setStatus(0);
try{
DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/workrecord/add");
@ -343,22 +346,16 @@ public class DingTalkUtil {
req.setUrl(singleUrl);
req.setSourceName(from);
List<OapiWorkrecordAddRequest.FormItemVo> list2 = new ArrayList<OapiWorkrecordAddRequest.FormItemVo>();
OapiWorkrecordAddRequest.FormItemVo obj3 = new OapiWorkrecordAddRequest.FormItemVo();
list2.add(obj3);
obj3.setTitle(title1);
obj3.setContent(content1);
obj3 = new OapiWorkrecordAddRequest.FormItemVo();
list2.add(obj3);
obj3.setTitle(title2);
obj3.setContent(content2);
obj3 = new OapiWorkrecordAddRequest.FormItemVo();
list2.add(obj3);
obj3.setTitle(title3);
obj3.setContent(content3);
for (WorkMsg workMsg:msgs
) {
OapiWorkrecordAddRequest.FormItemVo obj3 = new OapiWorkrecordAddRequest.FormItemVo();
list2.add(obj3);
obj3.setTitle(workMsg.getTitle());
obj3.setContent(workMsg.getContent());
}
req.setFormItemList(list2);
OapiWorkrecordAddResponse rsp = client.execute(req, token);
logger.info("钉钉待办任务请求返回{}", rsp.getBody());
//插入数据库
JSONObject json = JSONObject.parseObject(rsp.getBody());
@ -383,6 +380,37 @@ public class DingTalkUtil {
return msg;
}
//发送待办任务
public String updateWorkMSG(ThirdMsgSendRecord thirdMsgSendRecord, String token) {
String msg = "OK";
try{
logger.info("更新待办任务处理{}", thirdMsgSendRecord);
DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/workrecord/update");
OapiWorkrecordUpdateRequest req = new OapiWorkrecordUpdateRequest();
req.setUserid(thirdMsgSendRecord.getEmployeeId());
req.setRecordId(thirdMsgSendRecord.getTaskId());
OapiWorkrecordUpdateResponse rsp = client.execute(req, token);
logger.info("钉钉更新待办任务请求返回{}", rsp.getBody());
//插入数据库
JSONObject json = JSONObject.parseObject(rsp.getBody());
if(json.getIntValue("errcode") == 0){
//thirdMsgSendRecord.setTaskId(json.getString("record_id"));
thirdMsgSendRecord.setStatus(8);
thirdMsgSendRecordService.updateThirdMsgSendRecordById(thirdMsgSendRecord);
}else{
logger.info("更新待办任务失败");
}
logger.info("发送消息{}", thirdMsgSendRecord);
}catch (ApiException e) {
e.printStackTrace();
logger.info("更新待办任务异常");
msg = thirdMsgSendRecord.getRemark();
}
return msg;
}
public R getUserIdByCode(String code, String token) {
try {
DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/user/getuserinfo");

View File

@ -54,7 +54,6 @@ public class ShiroConfig {
filterMap.put("/file/**", "anon");
filterMap.put("/test/**", "anon");
filterMap.put("/druid/**", "anon");
filterMap.put("/user/lzresultrecord/new/resultRecordDetail/**", "anon");
filterMap.put("/app/**", "anon");
filterMap.put("/sys/login", "anon");
filterMap.put("/sys/sendSMS", "anon");

View File

@ -349,33 +349,37 @@ public class ResultRecordController extends AbstractController {
String value = param.get("id").toString();
if(value.length() > 0){
id = Long.parseLong(value);
resultRecord = lzResultRecordService.selectResultRecordById(id);
if(resultRecord == null){
return R.error("绩效不存在");
}
//下面判断权限
if(user.getUserId().longValue() != resultRecord.getStaffId().longValue()){
//不是自己的绩效判断是否为绩效管理人员老板部门管理人员
log.info("不是自己的绩效");
}
}
}else if(param.containsKey("startId")){//根据startId和token获取
String value = param.get("startId").toString();
if(value.length() > 0){
startId = Long.parseLong(value);
}
}
if(id == null){
if(startId == null){
//根据token获取
resultRecord = lzResultRecordService.selectLastResultRecordByUserId(getUserId());
if(resultRecord == null){
return R.error("绩效不存在");
}
}else{
resultRecord = lzResultRecordService.selectResultRecordByStaffIdAndStartId(getUserId(), startId);
if(resultRecord == null){
return R.error("绩效不存在");
}
}
}else{
//根据token获取
resultRecord = lzResultRecordService.selectLastResultRecordByUserId(getUserId());
resultRecord = lzResultRecordService.selectResultRecordById(id);
if(resultRecord == null){
return R.error("绩效不存在");
}
//下面判断权限
if(user.getUserId().longValue() != resultRecord.getStaffId().longValue()){
//不是自己的绩效判断是否为绩效管理人员老板部门管理人员
log.info("不是自己的绩效");
}
}
//获取考核维度等信息

View File

@ -30,4 +30,5 @@ public interface FlowChangeMapper extends BaseMapper<FlowChange> {
int deleteFlowChangeById(@Param("id")Long id);
FlowChange selectFlowChangeByRecordIdAndToIdAndType(@Param("recordId") Long recordId, @Param("toStaffId") Long toStaffId, @Param("type") int type);
}

View File

@ -82,4 +82,9 @@ public interface FlowRecordMapper extends BaseMapper<FlowRecord> {
int batchDeleteByRecordIds(@Param("recordIds")List<Long> recordIds);
List<FlowRecord> selectAndOrFlowRecordsById(@Param("flowRecordId") Long flowRecordId, @Param("recordId") Long recordId);
List<FlowRecord> selectLastFlowRecordsById(@Param("recordId") Long recordId);
List<FlowRecord> selectLastFlowRecordsByIdAndFlowIndex(@Param("recordId") Long recordId, @Param("flowIndex") int flowIndex);
}

View File

@ -41,4 +41,6 @@ public interface ResultModelMapper extends BaseMapper<ResultModel> {
int deleteResultModelByGroupId(Long id);
int updateCoverWeightResultModelById(ResultModel resultModel);
}

View File

@ -33,4 +33,6 @@ public interface FlowChangeService extends IService<FlowChange> {
void saveChange(ApprovalDto approvalDto, FlowRecord flowRecord, int i);
FlowChange selectFlowChangeByRecordIdAndToIdAndType(Long recordId, Long toStaffId, int type);
}

View File

@ -76,4 +76,10 @@ public interface FlowRecordService extends IService<FlowRecord> {
FlowRecord selectFlowRecordByRecordIdMinIdStatus(Long resultRecordId, Long id, int i);
List<FlowRecord> selectFlowRecordByRecordIdFlowProcess(Long id, int flowProcess);
//获取同一个节点下面的或签或者会签
List<FlowRecord> selectAndOrFlowRecordsById(Long flowRecordId, Long recordId);
//获取最后流程同一个小节点的所有数据
List<FlowRecord> selectLastFlowRecordsById(Long recordId);
//获取制定步骤一个小节点的所有数据
List<FlowRecord> selectLastFlowRecordsByIdAndFlowIndex(Long recordId, int flowIndex);
}

View File

@ -79,5 +79,10 @@ public class FlowChangeServiceImpl extends ServiceImpl<FlowChangeMapper, FlowCha
flowChangeMapper.insertFlowChange(flowChange);
}
@Override
public FlowChange selectFlowChangeByRecordIdAndToIdAndType(Long recordId, Long toStaffId, int type){
return flowChangeMapper.selectFlowChangeByRecordIdAndToIdAndType(recordId, toStaffId, type);
}
}

View File

@ -16,6 +16,7 @@ import com.lz.modules.flow.service.FlowRecordService;
import com.lz.modules.performance.req.AssessTaskReq;
import com.lz.modules.sys.entity.app.ResultRecord;
import com.lz.modules.sys.service.app.ResultRecordService;
import lombok.Builder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -205,5 +206,19 @@ public class FlowRecordServiceImpl extends ServiceImpl<FlowRecordMapper, FlowRec
return flowRecordMapper.selectFlowRecordByRecordIdFlowProcess(id,flowProcess);
}
@Override
public List<FlowRecord> selectAndOrFlowRecordsById(Long flowRecordId, Long recordId){
return flowRecordMapper.selectAndOrFlowRecordsById(flowRecordId, recordId);
}
@Override
public List<FlowRecord> selectLastFlowRecordsById(Long recordId){
return flowRecordMapper.selectLastFlowRecordsById(recordId);
}
@Override
public List<FlowRecord> selectLastFlowRecordsByIdAndFlowIndex(Long recordId, int flowIndex){
return flowRecordMapper.selectLastFlowRecordsByIdAndFlowIndex(recordId, flowIndex);
}
}

View File

@ -129,11 +129,16 @@ public class ResultModelServiceImpl extends ServiceImpl<ResultModelMapper, Resul
resultModel.setGradeStatus(resultModelDetailReq.getGradeStatus());
resultModel.setEvaluationGroupId(resultModelDetailReq.getEvaluationGroupId());
resultModel.setOrderBy(resultModelOrderBy);
if(resultModel.getWeight() == null){
resultModel.setWeight(BigDecimal.ZERO);
}
if(resultModel.getId() == null){
resultModelMapper.insertResultModel(resultModel);
}else{
resultModelMapper.updateResultModelById(resultModel);
if(resultModel.getIsDelete() != null && resultModel.getIsDelete().intValue() == 1){
delCount--;
}
@ -149,9 +154,9 @@ public class ResultModelServiceImpl extends ServiceImpl<ResultModelMapper, Resul
BeanUtils.copyProperties(req, resultTagetLib);
resultTagetLib.setModelId(resultModel.getId());
resultTagetLib.setOrderBy(libOrderBy);
if(req.getWeight() != null){
if(req.getWeight() != null && (req.getIsDelete() == null || req.getIsDelete().intValue() == 0)){
tagLibWeight = tagLibWeight.add(req.getWeight());
if(resultModel.getWeight() != null && tagLibWeight.compareTo(resultModel.getWeight()) == 1){
if(!resultModel.getWeight().equals(BigDecimal.ZERO) && tagLibWeight.compareTo(resultModel.getWeight()) == 1){
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();//事务回滚
return R.error(resultModel.getName() +
"维度的指标之和不能大于" + (resultModel.getWeight().multiply(BigDecimal.valueOf(100))) + "%");

View File

@ -13,8 +13,10 @@ import com.lz.modules.app.service.DepartmentsService;
import com.lz.modules.app.service.DepartmentsStaffRelateService;
import com.lz.modules.app.service.StaffOccupationService;
import com.lz.modules.app.service.StaffService;
import com.lz.modules.flow.entity.FlowChange;
import com.lz.modules.flow.entity.FlowRecord;
import com.lz.modules.flow.entity.FlowStart;
import com.lz.modules.flow.service.FlowChangeService;
import com.lz.modules.flow.service.FlowRecordService;
import com.lz.modules.flow.service.FlowStartService;
import com.lz.modules.job.model.responseBo.DepartmentInfosBo;
@ -24,7 +26,10 @@ import com.lz.modules.sys.entity.SysUserTokenEntity;
import com.lz.modules.sys.entity.app.ResultRecord;
import com.lz.modules.sys.service.app.ResultRecordService;
import com.lz.modules.third.entity.ThirdAppConfig;
import com.lz.modules.third.entity.ThirdMsgSendRecord;
import com.lz.modules.third.entity.WorkMsg;
import com.lz.modules.third.service.ThirdAppConfigService;
import com.lz.modules.third.service.ThirdMsgSendRecordService;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@ -79,11 +84,15 @@ public class DingtalkBusiness {
@Autowired
private FlowStartService flowStartService;
@Autowired
private FlowChangeService flowChangeService;
@Autowired
private ThirdMsgSendRecordService thirdMsgSendRecordService;
@Resource
StaffDao staffDao;
List<ThreadSendMessage> threadSendMessages = new ArrayList<>();
@Value("${dingtalk.appid}")
private String appid;
@ -212,6 +221,17 @@ public class DingtalkBusiness {
return sendWorkMSGByEntity(appid, fromStaffEntity, toStaffEntity, workMsgTypeEnum, "https://www.baidu.com");
}
public String delWorkMSGWithStart(List<Long> recordIds){
logger.info("批量删除待办任务{}", recordIds.size());
ThreadSendMessage threadSendMessage = new ThreadSendMessage();
threadSendMessage.setUpdateData(recordIds, WorkMsgTypeEnum.CLEARN, appid);
Thread thread = new Thread(threadSendMessage);
thread.start();
return "OK";
}
//流程流转发送消息
public String sendWorkMSGWithAsyn(Long resultRecordId , int type) {
@ -221,13 +241,14 @@ public class DingtalkBusiness {
StaffSimpleInfo fromStaff = staffService.selectStaffSimpleInfo(resultRecord.getStaffId());
fromStaff.setResultRecord(resultRecord);
fromStaff.setFlowStart(flowStart);
List<StaffSimpleInfo> toStaffids;
List<StaffSimpleInfo> toStaffids = new ArrayList<>();
toStaffids.add(fromStaff);
sendWorkMSGWithAsyn(null, toStaffids, WorkMsgTypeEnum.PROCESS.getType());
if(type == WorkMsgTypeEnum.REJECT.getType()){//被拒
toStaffids = new ArrayList<>();
toStaffids.add(fromStaff);
sendWorkMSGWithAsyn(fromStaff, toStaffids, WorkMsgTypeEnum.REJECT.getType());
sendWorkMSGWithAsyn(null, toStaffids, WorkMsgTypeEnum.REJECT.getType());
}else{
List<FlowRecord> flowRecords =
/*List<FlowRecord> flowRecords =
flowRecordService.selectFlowRecordByRecordIdStatus(resultRecordId, 2);
List<Long> ids = flowRecords.stream().map(new Function<FlowRecord, Long>() {
@Override
@ -240,8 +261,8 @@ public class DingtalkBusiness {
) {
simpleInfo.setResultRecord(resultRecord);
simpleInfo.setFlowStart(flowStart);
}
sendWorkMSGWithAsyn(fromStaff, toStaffids, WorkMsgTypeEnum.PROCESS.getType());
}*/
sendWorkMSGWithAsyn(null, toStaffids, WorkMsgTypeEnum.PROCESS.getType());
}
@ -251,7 +272,7 @@ public class DingtalkBusiness {
}
public String sendWorkMSGWithAsyn(StaffSimpleInfo fromStaff, List<StaffSimpleInfo> toStaffids, int type) {
public String sendWorkMSGWithAsyn(StaffSimpleInfo fromStaff, List<StaffSimpleInfo> toStaffids, int type) {
if(toStaffids.size() > 0){
if (toStaffids.get(0).getEmployeeId() == null || toStaffids.get(0).getEmployeeId().length() == 0) {
//查询第三方id
@ -271,8 +292,7 @@ public class DingtalkBusiness {
}
WorkMsgTypeEnum workMsgTypeEnum = WorkMsgTypeEnum.findRoleTypeByCode(type);
ThreadSendMessage threadSendMessage = new ThreadSendMessage(fromStaff, toStaffids, workMsgTypeEnum, appid);
threadSendMessages.add(threadSendMessage);//防止提前回收
ThreadSendMessage threadSendMessage = new ThreadSendMessage(toStaffids, workMsgTypeEnum, appid);
Thread thread = new Thread(threadSendMessage);
thread.start();
@ -354,93 +374,222 @@ public class DingtalkBusiness {
public class ThreadSendMessage implements Runnable{
List<StaffSimpleInfo> toStaffids;
StaffSimpleInfo fromStaff = null;
//StaffSimpleInfo fromStaff = null;
List<Long> recordIds;
WorkMsgTypeEnum workMsgTypeEnum;
String appid;
String hostUrl = "https://lzmanagement.ldxinyong.com/digitization";
public ThreadSendMessage(StaffSimpleInfo fromStaff, List<StaffSimpleInfo> toStaffids, WorkMsgTypeEnum typeEnum, String appid){
public ThreadSendMessage(List<StaffSimpleInfo> toStaffids, WorkMsgTypeEnum typeEnum, String appid){
this.toStaffids = toStaffids;
workMsgTypeEnum = typeEnum;
this.fromStaff = fromStaff;
this.appid = appid;
}
public void setUpdateData(List<Long> recordIds, WorkMsgTypeEnum typeEnum, String appid){
this.recordIds = recordIds;
workMsgTypeEnum = typeEnum;
this.appid = appid;
}
public ThreadSendMessage(){
}
private void sendNotic(Long staffId, String employeeId,
String content1, String content2, String content3,
String token, String url, Long recordId){
StaffEntity entity = new StaffEntity();
entity.setId(staffId);
entity.setEmployeeId(employeeId);
List<WorkMsg> msgs = new ArrayList<>();
WorkMsg workMsg = new WorkMsg("任务内容", content1);
msgs.add(workMsg);
workMsg = new WorkMsg("考核名称", content2);
msgs.add(workMsg);
workMsg = new WorkMsg("被考核人", content3);
msgs.add(workMsg);
dingTalkUtil.sendSingleWorkMSG(appid, entity, workMsgTypeEnum.getTitle(),
msgs,
url, token, "霖梓控股", 1, recordId);
}
@Override
public void run() {
logger.info("开始批量推送消息,数量{}, appid{}", toStaffids.size(), appid);
ThirdAppConfig thirdAppConfig = thirdAppConfigService.getByAppId(appid);
String token = dingTalkUtil.getAccessTokenWitchEntity(thirdAppConfig);
for (StaffSimpleInfo info:toStaffids
) {
if(token != null && token.length() > 0){
//下面防止第二次发送消息时钉钉不推送
String url = hostUrl;
if(url.contains("?")){
url += "&halokit=" + System.currentTimeMillis();
}else{
url += "?halokit=" + System.currentTimeMillis();
}
url += ("&detail=1&id=" + info.getResultRecord().getId());
url = URLEncoder.encode(url);
if(workMsgTypeEnum.getType() == WorkMsgTypeEnum.CLEARN.getType()){
//绩效催办
logger.info("绩效清空");
url = "dingtalk://dingtalkclient/action/openapp?corpid=" + thirdAppConfig.getCorpId() +
"&container_type=work_platform&app_id=0_" +
appid + "&redirect_type=jump&redirect_url=" + url;
if(workMsgTypeEnum.getType() == WorkMsgTypeEnum.START_WORK.getType()){
//发送制定目标通知
StaffEntity entity = new StaffEntity();
entity.setId(info.getId());
entity.setEmployeeId(info.getEmployeeId());
dingTalkUtil.sendSingleWorkMSG(appid, entity, workMsgTypeEnum.getTitle(),
"任务内容", "目标制定",
"考核名称", info.getFlowStart().getName(),
"被考核人", info.getResultRecord().getStaffName(),
url, token, "霖梓控股");
}else if(workMsgTypeEnum.getType() == WorkMsgTypeEnum.START_SCORE.getType()){
//发送开始评分通知
StaffEntity entity = new StaffEntity();
entity.setId(info.getId());
entity.setEmployeeId(info.getEmployeeId());
dingTalkUtil.sendSingleWorkMSG(appid, entity, workMsgTypeEnum.getTitle(),
"任务内容", "结果录入",
"考核名称", info.getFlowStart().getName(),
"被考核人", info.getResultRecord().getStaffName(),
url, token, "霖梓控股");
}else{
//流程流转通知
List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByRecordIdStatus(info.getResultRecord().getId(), 2);
if(flowRecords.size() == 0){
//任务结束
List<ThirdMsgSendRecord> threadSendMessages
= thirdMsgSendRecordService.selectThirdMsgSendRecordsByRecordIds(recordIds, 1, 1);
logger.info("需要删除的条数为{}", threadSendMessages.size());
for (ThirdMsgSendRecord thirdMsgSendRecord:threadSendMessages
) {
dingTalkUtil.updateWorkMSG(thirdMsgSendRecord, token);
}
}else{
logger.info("开始批量推送消息,数量{}, appid{}", toStaffids.size(), appid);
for (StaffSimpleInfo info:toStaffids
) {
if(token != null && token.length() > 0){
//下面防止第二次发送消息时钉钉不推送
String url = hostUrl;
if(url.contains("?")){
url += "&halokit=" + System.currentTimeMillis();
}else{
List<Long> ids = flowRecords.stream().map(new Function<FlowRecord, Long>() {
@Override
public Long apply(FlowRecord flowRecord) {
return flowRecord.getApprovalStaffId();
}
}).collect(Collectors.toList());
List<StaffSimpleInfo> staffSimpleInfos = staffService.selectStaffSimpleInfos(ids);
for (StaffSimpleInfo staffSimpleInfo:staffSimpleInfos
) {
StaffEntity entity = new StaffEntity();
entity.setId(staffSimpleInfo.getId());
entity.setEmployeeId(staffSimpleInfo.getEmployeeId());
dingTalkUtil.sendSingleWorkMSG(appid, entity, workMsgTypeEnum.getTitle(),
"任务内容", flowRecords.get(0).getFlowName(),
"考核名称", info.getFlowStart().getName(),
"被考核人", info.getResultRecord().getStaffName(),
url, token, "霖梓控股");
}
url += "?halokit=" + System.currentTimeMillis();
}
}
url += ("&detail=1&id=" + info.getResultRecord().getId());
url = URLEncoder.encode(url);
}else{
logger.info("ThreadSendMessage token无效"); ;
url = "dingtalk://dingtalkclient/action/openapp?corpid=" + thirdAppConfig.getCorpId() +
"&container_type=work_platform&app_id=0_" +
appid + "&redirect_type=jump&redirect_url=" + url;
if(workMsgTypeEnum.getType() == WorkMsgTypeEnum.START_WORK.getType()){
//发送制定目标通知
logger.info("目标制定");
sendNotic(info.getId(), info.getEmployeeId(),
"目标制定", info.getFlowStart().getName(),
info.getResultRecord().getStaffName(), token, url, info.getResultRecord().getId());
}else if(workMsgTypeEnum.getType() == WorkMsgTypeEnum.START_SCORE.getType()){
//发送开始评分通知
logger.info("结果录入");
sendNotic(info.getId(), info.getEmployeeId(),
"结果录入", info.getFlowStart().getName(),
info.getResultRecord().getStaffName(), token, url, info.getResultRecord().getId());
}else if(workMsgTypeEnum.getType() == WorkMsgTypeEnum.URGING.getType()){
//绩效催办
logger.info("绩效催办");
}else {
//流程流转通知
if(workMsgTypeEnum.getType() == WorkMsgTypeEnum.TRANSFER.getType()){//转交
//转交
logger.info("转交待办任务处理");
FlowChange flowChange = flowChangeService.selectFlowChangeByRecordIdAndToIdAndType(info.getResultRecord().getId(),
info.getId(), 0);
ThirdMsgSendRecord thirdMsgSendRecord =
thirdMsgSendRecordService.selectThirdMsgSendRecordByWorkIdAndStaffIdAndTypeAndStatus(
info.getResultRecord().getId(), flowChange.getApprovalId(), 1, 1);
if(thirdMsgSendRecord != null){//把原来的任务更新掉
dingTalkUtil.updateWorkMSG(thirdMsgSendRecord, token);
}
List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByRecordIdStatus(info.getResultRecord().getId(), 2);
//发送待办任务到新指定人员转交过来一定会有数据
sendNotic(info.getId(), info.getEmployeeId(),
flowRecords.get(0).getFlowName(), info.getFlowStart().getName(),
info.getResultRecord().getStaffName(), token, url, info.getResultRecord().getId());
}else if(workMsgTypeEnum.getType() == WorkMsgTypeEnum.SKIP.getType()){//跳过
//跳过
logger.info("跳过待办任务处理");
FlowChange flowChange = flowChangeService.selectFlowChangeByRecordIdAndToIdAndType(info.getResultRecord().getId(),
info.getId(), 1);
ThirdMsgSendRecord thirdMsgSendRecord =
thirdMsgSendRecordService.selectThirdMsgSendRecordByWorkIdAndStaffIdAndTypeAndStatus(
info.getResultRecord().getId(),
flowChange.getApprovalId(), 1, 1);
if(thirdMsgSendRecord != null){//把原来的任务更新掉
dingTalkUtil.updateWorkMSG(thirdMsgSendRecord, token);
}
List<FlowRecord> flowRecords = flowRecordService.selectAndOrFlowRecordsById(flowChange.getFlowRecordId(), info.getResultRecord().getId());
logger.info("查询到可能需要更新待办任务数量{}", flowRecords.size());
if(flowRecords.size() > 0){
if(flowRecords.get(0).getType().intValue() == 1){
//或签
logger.info("或签,需要更新该节点下所有人员的待办任务");
for (FlowRecord flowRecord:flowRecords
) {
if(flowRecord.getApprovalStaffId().longValue() != info.getId()){
logger.info("更新非直接跳关人员的待办任务人员id:{}, 姓名:{}", flowRecord.getApprovalStaffId(),
flowRecord.getApprovalStaffName());
thirdMsgSendRecord =
thirdMsgSendRecordService.selectThirdMsgSendRecordByWorkIdAndStaffIdAndTypeAndStatus(
info.getResultRecord().getId(),
flowRecord.getApprovalStaffId(), 1, 1);
if(thirdMsgSendRecord != null){//把原来的任务更新掉
dingTalkUtil.updateWorkMSG(thirdMsgSendRecord, token);
}
}
}
}
}
}else{
List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByRecordIdStatus(info.getResultRecord().getId(), 2);
if(flowRecords.size() > 0){//给下一步骤需要处理的人发送待办任务
if(flowRecords.get(0).getFlowProcess().intValue() != 2){//执行中的不发送待办
logger.info("非执行中的节点发送待办任务{}", flowRecords.get(0).getFlowName());
List<Long> ids = flowRecords.stream().map(new Function<FlowRecord, Long>() {
@Override
public Long apply(FlowRecord flowRecord) {
return flowRecord.getApprovalStaffId();
}
}).collect(Collectors.toList());
List<StaffSimpleInfo> staffSimpleInfos = staffService.selectStaffSimpleInfos(ids);
for (StaffSimpleInfo staffSimpleInfo:staffSimpleInfos
) {
sendNotic(staffSimpleInfo.getId(), staffSimpleInfo.getEmployeeId(),
flowRecords.get(0).getFlowName(), info.getFlowStart().getName(),
info.getResultRecord().getStaffName(), token, url, info.getResultRecord().getId());
}
}
}
//取消上一步骤发送的待办任务
if(flowRecords.size() == 0){//任务结束了
flowRecords = flowRecordService.selectLastFlowRecordsById(info.getResultRecord().getId());
}else{
if(workMsgTypeEnum.getType() == WorkMsgTypeEnum.REJECT.getType()){//被拒
flowRecords = flowRecordService.selectLastFlowRecordsByIdAndFlowIndex(info.getResultRecord().getId()
, flowRecords.get(0).getFlowIndex().intValue() + 1);//获取下一步的数据
}else{
flowRecords = flowRecordService.selectLastFlowRecordsByIdAndFlowIndex(info.getResultRecord().getId()
, flowRecords.get(0).getFlowIndex().intValue() - 1);//获取上一步的数据
}
}
logger.info("查询到可能需要更新的待办任务数量{}", flowRecords.size());
if(flowRecords.size() > 0){
for (FlowRecord flowRecord:flowRecords
) {
if(flowRecord.getStatus().intValue() == 1
|| flowRecord.getStatus().intValue() == 3
|| flowRecord.getStatus().intValue() == 4
|| workMsgTypeEnum.getType() == WorkMsgTypeEnum.REJECT.getType()){
logger.info("将要更新人员的待办任务人员id:{}, 姓名:{}", flowRecord.getApprovalStaffId(),
flowRecord.getApprovalStaffName());
ThirdMsgSendRecord thirdMsgSendRecord =
thirdMsgSendRecordService.selectThirdMsgSendRecordByWorkIdAndStaffIdAndTypeAndStatus(
info.getResultRecord().getId(),
flowRecord.getApprovalStaffId(), 1, 1);
if(thirdMsgSendRecord != null){//把原来的任务更新掉
dingTalkUtil.updateWorkMSG(thirdMsgSendRecord, token);
}else{
logger.info("无需更新待办任务");
}
}
}
}
}
}
}else{
logger.info("ThreadSendMessage token无效"); ;
}
}
}
threadSendMessages.remove(this);
}
}
}

View File

@ -16,6 +16,7 @@ import com.lz.modules.performance.req.CheckStaffReq;
import com.lz.modules.sys.controller.AbstractController;
import com.lz.modules.sys.entity.SysUserEntity;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -27,6 +28,7 @@ import java.util.stream.Collectors;
@RestController
@RequestMapping("/evaluationGroup")
@Api(tags="考评组")
@Slf4j
public class EvaluationGroupController extends AbstractController {
@ -116,6 +118,7 @@ public class EvaluationGroupController extends AbstractController {
@ApiOperation("获取考评组列表")
@ApiResponses({@ApiResponse(code=200,message = "成功", response=EvaluationGroup.class)})
public R getGroups(@RequestBody @ApiParam EvaluationGroupReq req) {
log.info("获取考评组列表数据{}", req);
SysUserEntity sysUserEntity = getUser();
PageUtils pageUtils = evaluationGroupService.selectEvaluationGroupByReq(req, sysUserEntity);
return R.ok().put("data",pageUtils);
@ -134,6 +137,7 @@ public class EvaluationGroupController extends AbstractController {
@ApiOperation("保存考评组")
@ApiResponses({@ApiResponse(code = 200, message = "成功", response = EvaluationGroup.class)})
public R save(@RequestBody @ApiParam EvaluationGroup evaluationGroup) {
log.info("保存考评组数据{}", evaluationGroup);
EvaluationGroup evaluationGroup1 = evaluationGroupService.selectEvaluationGroupByName(evaluationGroup.getName());
List<StaffRole> staffRoles = null;
if(evaluationGroup.getId() != null && evaluationGroup.getId().intValue() > 0){
@ -228,6 +232,7 @@ public class EvaluationGroupController extends AbstractController {
@ApiOperation("校验是否有跨组人员")
@ApiResponses({@ApiResponse(code = 200,message = "成功"),@ApiResponse(code = 504,message = "已跨组",response = StaffSimpleDto.class)})
public R checkStaff(@RequestBody @ApiParam(required = true,name = "body") CheckStaffReq checkStaffReq) {
log.info("校验跨组人员接受数据{}", checkStaffReq);
return evaluationGroupService.checkStaff(checkStaffReq);
}
}

View File

@ -17,6 +17,7 @@ import com.lz.modules.flow.service.FlowChartRoleService;
import com.lz.modules.flow.service.FlowChartService;
import com.lz.modules.flow.service.FlowManagerService;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -30,6 +31,7 @@ import java.util.stream.Stream;
@RestController
@RequestMapping("/flowChart")
@Api(tags={"考核节点"})
@Slf4j
public class FlowChartController {
@ -142,6 +144,7 @@ public class FlowChartController {
@ApiOperation("保存流程节点小流程列表")
@ApiResponses({@ApiResponse(code = 200, message = "成功", response = FlowChartDetailRecord.class)})
public R saveDetailProcs(@RequestBody @ApiParam FlowChartDetailRecordListReq flowChartDetailRecordListReq) {
log.info("保存流程小结点接受的数据{}", flowChartDetailRecordListReq);
if(flowChartDetailRecordListReq.getRecordSimpleDtos() != null && flowChartDetailRecordListReq.getRecordSimpleDtos().size() > 0){
List<FlowChartDetailRecord> inserts = new ArrayList<>();
List<FlowChartDetailRecord> updaes = new ArrayList<>();

View File

@ -23,6 +23,7 @@ import com.lz.modules.sys.entity.app.ResultRecord;
import com.lz.modules.sys.service.app.ResultDetailService;
import com.lz.modules.sys.service.app.ResultRecordService;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.map.HashedMap;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -37,6 +38,7 @@ import java.util.stream.Collectors;
@RestController
@RequestMapping("/flowStart")
@Api(tags = "发起考核")
@Slf4j
public class FlowStartController {
@ -69,6 +71,7 @@ public class FlowStartController {
@ApiOperation("发起新的考核任务")
@ApiResponses({@ApiResponse(code = 200, message = "成功", response = FlowStart.class)})
public R save(@RequestBody @ApiParam FlowStart flowStart) {
log.info("发起考核接受数据{}", flowStart);
return flowStartService.saveStart(flowStart);
}

View File

@ -12,6 +12,7 @@ import com.lz.modules.flow.req.ResultTagetLibItemReq;
import com.lz.modules.flow.service.ResultModelService;
import com.lz.modules.performance.service.ResultTagetLibService;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
@ -24,6 +25,7 @@ import java.util.List;
@RestController
@RequestMapping("/resultModel")
@Api(tags = "考核模板相关")
@Slf4j
public class ResultModelController {
@ -86,6 +88,7 @@ public class ResultModelController {
@PostMapping("/save")
@ApiOperation("保存模板中的考核维度")
public R save(@RequestBody @ApiParam ResultModel resultModel) {
log.info("保存模板中的考核数据{}", resultModel);
if(resultModel.getId() != null && resultModel.getId().intValue() > 0){
return update(resultModel);
}
@ -96,6 +99,7 @@ public class ResultModelController {
@PostMapping("/saveDetail")
@ApiOperation("保存模板中的考核维度及指标")
public R saveDetail(@RequestBody @ApiParam ResultModelDetailReq resultModelDetailReq) {
log.info("保存指标的数据{}", resultModelDetailReq);
return resultModelService.saveDetail(resultModelDetailReq);
}

View File

@ -8,12 +8,14 @@ import com.lz.modules.flow.model.ResultTagetLibDto;
import com.lz.modules.flow.req.ResultTagetLibSearchReq;
import com.lz.modules.performance.service.ResultTagetLibService;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/resultTagetLib")
@Api(tags = "考核指标相关")
@Slf4j
public class ResultTagetLibController {
@ -28,6 +30,7 @@ public class ResultTagetLibController {
@ApiOperation("搜索指标库")
@ApiResponses({@ApiResponse(code = 200,message = "成功",response = ResultTagetLibDto.class)})
public R GetTargetLibs(@RequestBody @ApiParam ResultTagetLibSearchReq req) {
log.info("搜索指标请求的数据{}", req);
PageUtils pageUtils = resultTagetLibService.selectResultTagetLibByReq(req);
return R.ok().put("data",pageUtils);
}
@ -50,7 +53,7 @@ public class ResultTagetLibController {
@PostMapping("/save")
@ApiOperation("保存考核指标")
public R save(@RequestBody @ApiParam ResultTagetLib resultTagetLib) {
log.info("保存考核指标{}", resultTagetLib);
if(resultTagetLib.getId() != null && resultTagetLib.getId().intValue() > 0){
return update(resultTagetLib);
}

View File

@ -169,6 +169,13 @@ public class AssessManagerServiceImpl implements AssessManagerService {
resultRecordMapper.batchDeleteByResultRecordIds(ids);
//删除flowRecord
flowRecordMapper.batchDeleteByRecordIds(ids);
//删除钉钉任务
try {
String s = dingtalkBusiness.delWorkMSGWithStart(ids);
log.info("清除钉钉任务响应res: " +s);
} catch (Exception e) {
log.error("调用钉钉清除任务异常,e:" ,e);
}
}
return ;
@ -264,6 +271,14 @@ public class AssessManagerServiceImpl implements AssessManagerService {
//删除本次考核任务
resultRecordMapper.batchDeleteByStartIdAndStaffId(req.getStartId(),change);
evaluationStartStaffMapper.deleteEvaluationStartStaffChangeAssess(req.getStartId(),change);
//删除钉钉任务
try {
List<Long> recordIds = resultRecordMapper.selectIdsByStartId(req.getStartId());
String s = dingtalkBusiness.delWorkMSGWithStart(recordIds);
log.info("清除钉钉任务响应res: " +s);
} catch (Exception e) {
log.error("调用钉钉清除任务异常,e:" ,e);
}
return R.ok();
}
return R.ok();

View File

@ -106,4 +106,6 @@ public interface ResultRecordMapper extends BaseMapper<ResultRecord> {
int batchDeleteByResultRecordIds(@Param("resultRecordIds")List<Long> resultRecordIds);
List<ResultRecord> selectResultRecordsByStartId(Long startId);
}

View File

@ -122,4 +122,7 @@ public interface ResultRecordService extends IService<ResultRecord> {
ResultRecord selectLastResultRecordByUserId(Long userId);
ResultRecord selectResultRecordByStaffIdAndStartId(Long userId, Long startId);
List<ResultRecord> selectResultRecordsByStartId(Long startId);
List<Long> selectResultRecordIdsByStartId(Long startId);
}

View File

@ -1334,4 +1334,14 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
public ResultRecord selectResultRecordByStaffIdAndStartId(Long userId, Long startId){
return resultRecordMapper.selectResultRecordByStaffIdAndStartId(userId, startId);
}
@Override
public List<ResultRecord> selectResultRecordsByStartId(Long startId){
return resultRecordMapper.selectResultRecordsByStartId(startId);
}
@Override
public List<Long> selectResultRecordIdsByStartId(Long startId){
return resultRecordMapper.selectIdsByStartId(startId);
}
}

View File

@ -11,6 +11,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lz.modules.third.entity.ThirdMsgSendRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface ThirdMsgSendRecordMapper extends BaseMapper<ThirdMsgSendRecord> {
@ -30,4 +33,13 @@ public interface ThirdMsgSendRecordMapper extends BaseMapper<ThirdMsgSendRecord>
int deleteThirdMsgSendRecordById(@Param("id")Long id);
ThirdMsgSendRecord selectThirdMsgSendRecordByWorkIdAndStaffIdAndTypeAndStatus(
@Param("workId") Long workId,
@Param("staffId") Long staffId,
@Param("workType") int workType,
@Param("status") int status);
List<ThirdMsgSendRecord> selectThirdMsgSendRecordsByRecordIds(@Param("list") List<Long> recordIds,
@Param("type") int type,
@Param("status") int status);
}

View File

@ -1,73 +1,109 @@
package com.lz.modules.third.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* <p>
* 菜单权限表
* </p>*第三方消息发送记录
* @author quyixiao
* @since 2020-08-19
* @since 2020-11-19
*/
@Data
@TableName("third_msg_send_record")
@ApiModel(value = "第三方消息发送记录")
public class ThirdMsgSendRecord implements java.io.Serializable {
//
@TableId(value = "id", type = IdType.AUTO)
private Long id;
//
@ApiModelProperty(value = "", name = "isDelete")
private Integer isDelete;
//
private Date createTime;
@ApiModelProperty(value = "", name = "gmtCreate")
private Date gmtCreate;
//
private Date updateTime;
//消息类型textimagevoicefilelinkoamarkdownaction_card
@ApiModelProperty(value = "", name = "gmtModified")
private Date gmtModified;
//消息类型textimagevoicefilelinkoamarkdownaction_cardwork_msg待办任务
@ApiModelProperty(value = "消息类型textimagevoicefilelinkoamarkdownaction_cardwork_msg待办任务", name = "msgType")
private String msgType;
//消息头背景色 oa消息中才有
@ApiModelProperty(value = "消息头背景色 oa消息中才有", name = "headBgcolor")
private String headBgcolor;
//消息头部标题最多10个字符 oa消息中action_card的title
@ApiModelProperty(value = "消息头部标题最多10个字符 oa消息中action_card的title", name = "headText")
private String headText;
//消息标题oa中的消息体的消息头link,markdown,action_card的single_title
@ApiModelProperty(value = "消息标题oa中的消息体的消息头link,markdown,action_card的single_title", name = "msgTitle")
private String msgTitle;
//消息内容textlinkoa正文markdown的markdown内容action_card的markdown内容
@ApiModelProperty(value = "消息内容textlinkoa正文markdown的markdown内容action_card的markdown内容", name = "msgContent")
private String msgContent;
//imagevoicefile消息的文件附件id
@ApiModelProperty(value = "imagevoicefile消息的文件附件id", name = "mediaId")
private Long mediaId;
//voice消息的时常信息 不超过60秒
@ApiModelProperty(value = "voice消息的时常信息 不超过60秒", name = "duration")
private String duration;
//linkoa的message_urlaction_card的single_url
@ApiModelProperty(value = "link、oa的message_urlaction_card的single_url", name = "msgUrl")
private String msgUrl;
//linkoa中的图片如果使用钉钉中的资源ID请用@资源id的形式
@ApiModelProperty(value = "linkoa中的图片如果使用钉钉中的资源ID请用@资源id的形式", name = "picUrl")
private String picUrl;
//oa的pc端url
@ApiModelProperty(value = "oa的pc端url", name = "pcUrl")
private String pcUrl;
//oa中的消息体jsonArray串[{"key":"说明A","value":"值A"},{"key":"说明B","value":"值B"}]最多显示6个
@ApiModelProperty(value = "oa中的消息体jsonArray串[{\"key\":\"说明A\",\"value\":\"值A\"},{\"key\":\"说明B\",\"value\":\"值B\"}]最多显示6个", name = "form")
private String form;
//oa中的单文本信息的数目
@ApiModelProperty(value = "oa中的单文本信息的数目", name = "richNum")
private String richNum;
//oa中的单文本信息的单位
@ApiModelProperty(value = "oa中的单文本信息的单位", name = "richUnit")
private String richUnit;
//oa中显示的附件数目不做校验只展示
@ApiModelProperty(value = "oa中显示的附件数目不做校验只展示", name = "fileCount")
private String fileCount;
//oa中的自定义作者
@ApiModelProperty(value = "oa中的自定义作者", name = "author")
private String author;
//action_card独立跳转是按钮的排列0是竖向排列 1是横向排列
@ApiModelProperty(value = "action_card独立跳转是按钮的排列0是竖向排列 1是横向排列", name = "actionCardBtnOrientation")
private String actionCardBtnOrientation;
//action_card独立跳转的jsonarray [{"tilte":"A按钮","action_url":"A按钮链接"},{"tilte":"B按钮","action_url":"B按钮链接"}]
@ApiModelProperty(value = "action_card独立跳转的jsonarray [{\"tilte\":\"A按钮\",\"action_url\":\"A按钮链接\"},{\"tilte\":\"B按钮\",\"action_url\":\"B按钮链接\"}]", name = "actionCardBtnList")
private String actionCardBtnList;
//lz_staff id
@ApiModelProperty(value = "lz_staff id", name = "staffId")
private Long staffId;
//发送状态0新建1已发送2处理中3已送达4未读5已读6发送失败7撤回
@ApiModelProperty(value = "发送状态0新建1已发送2处理中3已送达4未读5已读6发送失败7撤回", name = "status")
private Integer status;
//应用ID
@ApiModelProperty(value = "应用ID", name = "appId")
private String appId;
//钉钉返回的任务id
@ApiModelProperty(value = "钉钉返回的任务id", name = "taskId")
private String taskId;
//备注一些说明
@ApiModelProperty(value = "备注,一些说明", name = "remark")
private String remark;
//消息任务对应的工作ID
@ApiModelProperty(value = "消息任务对应的工作ID", name = "workId")
private Long workId;
//1表示绩效待办...
@ApiModelProperty(value = "1表示绩效待办...", name = "workType")
private Integer workType;
//第三方用户所在组织id
@ApiModelProperty(value = "第三方用户所在组织id", name = "employeeId")
private String employeeId;
/**
*
* @return
@ -102,41 +138,41 @@ public class ThirdMsgSendRecord implements java.io.Serializable {
*
* @return
*/
public Date getCreateTime() {
return createTime;
public Date getGmtCreate() {
return gmtCreate;
}
/**
*
* @param createTime
* @param gmtCreate
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
public void setGmtCreate(Date gmtCreate) {
this.gmtCreate = gmtCreate;
}
/**
*
* @return
*/
public Date getUpdateTime() {
return updateTime;
public Date getGmtModified() {
return gmtModified;
}
/**
*
* @param updateTime
* @param gmtModified
*/
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
public void setGmtModified(Date gmtModified) {
this.gmtModified = gmtModified;
}
/**
* 消息类型textimagevoicefilelinkoamarkdownaction_card
* 消息类型textimagevoicefilelinkoamarkdownaction_cardwork_msg待办任务
* @return
*/
public String getMsgType() {
return msgType;
}
/**
* 消息类型textimagevoicefilelinkoamarkdownaction_card
* 消息类型textimagevoicefilelinkoamarkdownaction_cardwork_msg待办任务
* @param msgType
*/
public void setMsgType(String msgType) {
@ -458,13 +494,58 @@ public class ThirdMsgSendRecord implements java.io.Serializable {
this.remark = remark;
}
/**
* 消息任务对应的工作ID
* @return
*/
public Long getWorkId() {
return workId;
}
/**
* 消息任务对应的工作ID
* @param workId
*/
public void setWorkId(Long workId) {
this.workId = workId;
}
/**
* 1表示绩效待办...
* @return
*/
public Integer getWorkType() {
return workType;
}
/**
* 1表示绩效待办...
* @param workType
*/
public void setWorkType(Integer workType) {
this.workType = workType;
}
/**
* 第三方用户所在组织id
* @return
*/
public String getEmployeeId() {
return employeeId;
}
/**
* 第三方用户所在组织id
* @param employeeId
*/
public void setEmployeeId(String employeeId) {
this.employeeId = employeeId;
}
@Override
public String toString() {
return "ThirdMsgSendRecord{" +
",id=" + id +
",isDelete=" + isDelete +
",createTime=" + createTime +
",updateTime=" + updateTime +
",gmtCreate=" + gmtCreate +
",gmtModified=" + gmtModified +
",msgType=" + msgType +
",headBgcolor=" + headBgcolor +
",headText=" + headText +
@ -487,6 +568,9 @@ public class ThirdMsgSendRecord implements java.io.Serializable {
",appId=" + appId +
",taskId=" + taskId +
",remark=" + remark +
",workId=" + workId +
",workType=" + workType +
",employeeId=" + employeeId +
"}";
}
}

View File

@ -0,0 +1,13 @@
package com.lz.modules.third.entity;
import lombok.Data;
@Data
public class WorkMsg {
private String title;
private String content;
public WorkMsg(String title, String content){
this.title = title;
this.content = content;
}
}

View File

@ -2,8 +2,10 @@ package com.lz.modules.third.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.lz.common.utils.PageUtils;
import com.lz.modules.job.business.DingtalkBusiness;
import com.lz.modules.third.entity.ThirdMsgSendRecord;
import java.util.List;
import java.util.Map;
/**
@ -36,4 +38,8 @@ public interface ThirdMsgSendRecordService extends IService<ThirdMsgSendRecord>
PageUtils queryPage(Map<String, Object> params);
void insert(ThirdMsgSendRecord thirdMsgSendRecord);
ThirdMsgSendRecord selectThirdMsgSendRecordByWorkIdAndStaffIdAndTypeAndStatus(Long workId, Long staffId, int workType, int status);
List<ThirdMsgSendRecord> selectThirdMsgSendRecordsByRecordIds(List<Long> recordIds, int type, int status);
}

View File

@ -12,6 +12,7 @@ import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
/**
@ -85,4 +86,20 @@ public class ThirdMsgSendRecordServiceImpl extends ServiceImpl<ThirdMsgSendRecor
thirdMsgSendRecordMapper.insert(thirdMsgSendRecord);
}
@Override
public ThirdMsgSendRecord selectThirdMsgSendRecordByWorkIdAndStaffIdAndTypeAndStatus(Long workId,
Long staffId,
int workType,
int status){
return thirdMsgSendRecordMapper.selectThirdMsgSendRecordByWorkIdAndStaffIdAndTypeAndStatus(workId,
staffId,
workType,
status);
}
@Override
public List<ThirdMsgSendRecord> selectThirdMsgSendRecordsByRecordIds(List<Long> recordIds, int type, int status){
return thirdMsgSendRecordMapper.selectThirdMsgSendRecordsByRecordIds(recordIds, type, status);
}
}

View File

@ -612,5 +612,13 @@
</foreach>
)
</update>
<select id="selectResultRecordsByStartId" resultType="ResultRecord">
select * from lz_result_record where
is_delete = 0
and start_id = #{startId}
</select>
</mapper>

View File

@ -99,5 +99,9 @@
update lz_flow_change set is_delete = 1 where id=#{id} limit 1
</update>
<select id="selectFlowChangeByRecordIdAndToIdAndType" resultType="FlowChange" >
select * from lz_flow_change where record_id=#{recordId} and to_approval_id = #{toStaffId} and type = #{type} and is_delete = 0 limit 1
</select>
</mapper>

View File

@ -295,5 +295,20 @@
)
</update>
<select id="selectAndOrFlowRecordsById" resultType="com.lz.modules.flow.entity.FlowRecord">
select * from lz_flow_record where is_delete = 0 and flow_index = (
select flow_index from lz_flow_record where is_delete = 0 and id=#{flowRecordId}) and record_id = #{recordId}
</select>
<select id="selectLastFlowRecordsById" resultType="com.lz.modules.flow.entity.FlowRecord">
select * from lz_flow_record where is_delete = 0 and flow_index = (
select flow_index from lz_flow_record where is_delete = 0 and record_id = #{recordId} order by flow_index desc limit 1
) and record_id = #{recordId}
</select>
<select id="selectLastFlowRecordsByIdAndFlowIndex" resultType="com.lz.modules.flow.entity.FlowRecord">
select * from lz_flow_record where is_delete = 0 and flow_index = #{flowIndex} and record_id = #{recordId}
</select>
</mapper>

View File

@ -121,6 +121,26 @@
update lz_result_model set is_delete = 1 where evaluation_group_id=#{id}
</update>
<update id="updateCoverWeightResultModelById" parameterType="ResultModel" >
update
lz_result_model
<trim prefix="set" suffixOverrides=",">
<if test="isDelete != null">is_delete = #{isDelete},</if>
<if test="gmtCreate != null">gmt_create = #{gmtCreate},</if>
<if test="name != null">name = #{name},</if>
<if test="evaluationGroupId != null">evaluation_group_id = #{evaluationGroupId},</if>
<if test="type != null">type = #{type},</if>
<if test="maxCount != null">max_count = #{maxCount},</if>
<if test="calculateId != null">calculate_id = #{calculateId},</if>
<if test="gradeStatus != null">grade_status = #{gradeStatus},</if>
<if test="gradeGroupId != null">grade_group_id = #{gradeGroupId},</if>
<if test="orderBy != null">order_by = #{orderBy}</if>
</trim>
weight = #{weight},
,gmt_modified = now()
where id = #{id}
</update>
</mapper>

View File

@ -6,8 +6,8 @@
<resultMap id="BaseResultMap" type="com.lz.modules.third.entity.ThirdMsgSendRecord">
<id column="id" property="id"/>
<result column="is_delete" property="isDelete"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="gmt_create" property="gmtCreate"/>
<result column="gmt_modified" property="gmtModified"/>
<result column="msg_type" property="msgType"/>
<result column="head_bgcolor" property="headBgcolor"/>
<result column="head_text" property="headText"/>
@ -30,90 +30,94 @@
<result column="app_id" property="appId"/>
<result column="task_id" property="taskId"/>
<result column="remark" property="remark"/>
<result column="work_id" property="workId"/>
<result column="work_type" property="workType"/>
<result column="employee_id" property="employeeId"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id AS id, is_delete AS isDelete, create_time AS createTime, update_time AS updateTime, msg_type AS msgType, head_bgcolor AS headBgcolor, head_text AS headText, msg_title AS msgTitle, msg_content AS msgContent, media_id AS mediaId, duration AS duration, msg_url AS msgUrl, pic_url AS picUrl, pc_url AS pcUrl, form AS form, rich_num AS richNum, rich_unit AS richUnit, file_count AS fileCount, author AS author, action_card_btn_orientation AS actionCardBtnOrientation, action_card_btn_list AS actionCardBtnList, staff_id AS staffId, status AS status, app_id AS appId, task_id AS taskId, remark AS remark
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, msg_type AS msgType, head_bgcolor AS headBgcolor, head_text AS headText, msg_title AS msgTitle, msg_content AS msgContent, media_id AS mediaId, duration AS duration, msg_url AS msgUrl, pic_url AS picUrl, pc_url AS pcUrl, form AS form, rich_num AS richNum, rich_unit AS richUnit, file_count AS fileCount, author AS author, action_card_btn_orientation AS actionCardBtnOrientation, action_card_btn_list AS actionCardBtnList, staff_id AS staffId, status AS status, app_id AS appId, task_id AS taskId, remark AS remark, work_id AS workId, work_type AS workType, employee_id AS employeeId
</sql>
<select id="selectThirdMsgSendRecordById" resultType="ThirdMsgSendRecord" >
select * from third_msg_send_record where id=#{id} and is_delete = 0 limit 1
select * from third_msg_send_record where id=#{id} and is_delete = 0 limit 1
</select>
<insert id="insertThirdMsgSendRecord" parameterType="ThirdMsgSendRecord" useGeneratedKeys="true" keyProperty="id" >
insert into third_msg_send_record(
<if test="createTime != null">create_time, </if>
<if test="updateTime != null">update_time, </if>
<if test="msgType != null">msg_type, </if>
<if test="headBgcolor != null">head_bgcolor, </if>
<if test="headText != null">head_text, </if>
<if test="msgTitle != null">msg_title, </if>
<if test="msgContent != null">msg_content, </if>
<if test="mediaId != null">media_id, </if>
<if test="duration != null">duration, </if>
<if test="msgUrl != null">msg_url, </if>
<if test="picUrl != null">pic_url, </if>
<if test="pcUrl != null">pc_url, </if>
<if test="form != null">form, </if>
<if test="richNum != null">rich_num, </if>
<if test="richUnit != null">rich_unit, </if>
<if test="fileCount != null">file_count, </if>
<if test="author != null">author, </if>
<if test="actionCardBtnOrientation != null">action_card_btn_orientation, </if>
<if test="actionCardBtnList != null">action_card_btn_list, </if>
<if test="staffId != null">staff_id, </if>
<if test="status != null">status, </if>
<if test="appId != null">app_id, </if>
<if test="taskId != null">task_id, </if>
<if test="remark != null">remark, </if>
is_delete,
gmt_create,
gmt_modified
<if test="msgType != null">msg_type, </if>
<if test="headBgcolor != null">head_bgcolor, </if>
<if test="headText != null">head_text, </if>
<if test="msgTitle != null">msg_title, </if>
<if test="msgContent != null">msg_content, </if>
<if test="mediaId != null">media_id, </if>
<if test="duration != null">duration, </if>
<if test="msgUrl != null">msg_url, </if>
<if test="picUrl != null">pic_url, </if>
<if test="pcUrl != null">pc_url, </if>
<if test="form != null">form, </if>
<if test="richNum != null">rich_num, </if>
<if test="richUnit != null">rich_unit, </if>
<if test="fileCount != null">file_count, </if>
<if test="author != null">author, </if>
<if test="actionCardBtnOrientation != null">action_card_btn_orientation, </if>
<if test="actionCardBtnList != null">action_card_btn_list, </if>
<if test="staffId != null">staff_id, </if>
<if test="status != null">status, </if>
<if test="appId != null">app_id, </if>
<if test="taskId != null">task_id, </if>
<if test="remark != null">remark, </if>
<if test="workId != null">work_id, </if>
<if test="workType != null">work_type, </if>
<if test="employeeId != null">employee_id, </if>
is_delete,
gmt_create,
gmt_modified
)values(
<if test="createTime != null">#{ createTime}, </if>
<if test="updateTime != null">#{ updateTime}, </if>
<if test="msgType != null">#{ msgType}, </if>
<if test="headBgcolor != null">#{ headBgcolor}, </if>
<if test="headText != null">#{ headText}, </if>
<if test="msgTitle != null">#{ msgTitle}, </if>
<if test="msgContent != null">#{ msgContent}, </if>
<if test="mediaId != null">#{ mediaId}, </if>
<if test="duration != null">#{ duration}, </if>
<if test="msgUrl != null">#{ msgUrl}, </if>
<if test="picUrl != null">#{ picUrl}, </if>
<if test="pcUrl != null">#{ pcUrl}, </if>
<if test="form != null">#{ form}, </if>
<if test="richNum != null">#{ richNum}, </if>
<if test="richUnit != null">#{ richUnit}, </if>
<if test="fileCount != null">#{ fileCount}, </if>
<if test="author != null">#{ author}, </if>
<if test="actionCardBtnOrientation != null">#{ actionCardBtnOrientation}, </if>
<if test="actionCardBtnList != null">#{ actionCardBtnList}, </if>
<if test="staffId != null">#{ staffId}, </if>
<if test="status != null">#{ status}, </if>
<if test="appId != null">#{ appId}, </if>
<if test="taskId != null">#{ taskId}, </if>
<if test="remark != null">#{ remark}, </if>
0,
now(),
now()
<if test="msgType != null">#{ msgType}, </if>
<if test="headBgcolor != null">#{ headBgcolor}, </if>
<if test="headText != null">#{ headText}, </if>
<if test="msgTitle != null">#{ msgTitle}, </if>
<if test="msgContent != null">#{ msgContent}, </if>
<if test="mediaId != null">#{ mediaId}, </if>
<if test="duration != null">#{ duration}, </if>
<if test="msgUrl != null">#{ msgUrl}, </if>
<if test="picUrl != null">#{ picUrl}, </if>
<if test="pcUrl != null">#{ pcUrl}, </if>
<if test="form != null">#{ form}, </if>
<if test="richNum != null">#{ richNum}, </if>
<if test="richUnit != null">#{ richUnit}, </if>
<if test="fileCount != null">#{ fileCount}, </if>
<if test="author != null">#{ author}, </if>
<if test="actionCardBtnOrientation != null">#{ actionCardBtnOrientation}, </if>
<if test="actionCardBtnList != null">#{ actionCardBtnList}, </if>
<if test="staffId != null">#{ staffId}, </if>
<if test="status != null">#{ status}, </if>
<if test="appId != null">#{ appId}, </if>
<if test="taskId != null">#{ taskId}, </if>
<if test="remark != null">#{ remark}, </if>
<if test="workId != null">#{ workId}, </if>
<if test="workType != null">#{ workType}, </if>
<if test="employeeId != null">#{ employeeId}, </if>
0,
now(),
now()
)
</insert>
<update id="updateThirdMsgSendRecordById" parameterType="ThirdMsgSendRecord" >
update
third_msg_send_record
third_msg_send_record
<trim prefix="set" suffixOverrides=",">
<if test="isDelete != null">is_delete = #{isDelete},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="gmtCreate != null">gmt_create = #{gmtCreate},</if>
<if test="msgType != null">msg_type = #{msgType},</if>
<if test="headBgcolor != null">head_bgcolor = #{headBgcolor},</if>
<if test="headText != null">head_text = #{headText},</if>
@ -135,7 +139,10 @@
<if test="status != null">status = #{status},</if>
<if test="appId != null">app_id = #{appId},</if>
<if test="taskId != null">task_id = #{taskId},</if>
<if test="remark != null">remark = #{remark}</if>
<if test="remark != null">remark = #{remark},</if>
<if test="workId != null">work_id = #{workId},</if>
<if test="workType != null">work_type = #{workType},</if>
<if test="employeeId != null">employee_id = #{employeeId}</if>
</trim>
,gmt_modified = now()
where id = #{id}
@ -144,11 +151,10 @@
<update id="updateCoverThirdMsgSendRecordById" parameterType="ThirdMsgSendRecord" >
update
third_msg_send_record
set
third_msg_send_record
set
is_delete = #{isDelete},
create_time = #{createTime},
update_time = #{updateTime},
gmt_create = #{gmtCreate},
msg_type = #{msgType},
head_bgcolor = #{headBgcolor},
head_text = #{headText},
@ -170,15 +176,30 @@
status = #{status},
app_id = #{appId},
task_id = #{taskId},
remark = #{remark}
remark = #{remark},
work_id = #{workId},
work_type = #{workType},
employee_id = #{employeeId}
,gmt_modified = now()
where id = #{id}
</update>
<update id="deleteThirdMsgSendRecordById" parameterType="java.lang.Long">
update third_msg_send_record set is_delete = 1 where id=#{id} limit 1
update third_msg_send_record set is_delete = 1 where id=#{id} limit 1
</update>
<select id="selectThirdMsgSendRecordByWorkIdAndStaffIdAndTypeAndStatus" resultType="ThirdMsgSendRecord" >
select * from third_msg_send_record where work_id=#{workId} and staff_id = #{staffId}
and work_type = #{workType} and status=#{status} and is_delete = 0 limit 1
</select>
<select id="selectThirdMsgSendRecordsByRecordIds" resultType="ThirdMsgSendRecord" >
select * from third_msg_send_record where status=#{status} and is_delete = 0 and work_type = #{type} and work_id in (
<foreach collection="list" item="item" separator=",">
#{item}
</foreach>
)
</select>
</mapper>

View File

@ -126,7 +126,7 @@ public class MysqlMain {
List<TablesBean> list = new ArrayList<TablesBean>();
list.add(new TablesBean("lz_result_detail"));
list.add(new TablesBean("third_msg_send_record"));
List<TablesBean> list2 = new ArrayList<TablesBean>();
Map<String, String> map = MysqlUtil2ShowCreateTable.getComments();