Commit a19d1bd5 authored by 王启林's avatar 王启林
parents 9c8b210b d62a02f4
...@@ -226,7 +226,9 @@ export default { ...@@ -226,7 +226,9 @@ export default {
type: this.activeName, type: this.activeName,
page: this.query.page, page: this.query.page,
orderColList: this.typeArr, orderColList: this.typeArr,
name: `%${this.searchValue}%`, andConditionList: [
{ content: `%${this.searchValue}%`, name: `%${this.searchValue}%` },
],
}).then((res) => { }).then((res) => {
if (res.code == 1) { if (res.code == 1) {
this.tableData = res.data; this.tableData = res.data;
......
...@@ -103,15 +103,16 @@ export default { ...@@ -103,15 +103,16 @@ export default {
}, },
}, },
{ label: "考勤绩效", prop: "attendScore", formatter: this.formatter }, { label: "考勤绩效指标分数", prop: "attendScore", formatter: this.formatter },
{ label: "评价绩效", prop: "assessScore", formatter: this.formatter }, { label: "评价绩效指标分数", prop: "reviewScore", formatter: this.formatter },
{ label: "投诉绩效指标分数", prop: "reviewScore", formatter: this.formatter },
{ label: "办件绩效", prop: "workScore", formatter: this.formatter }, { label: "办件绩效分数", prop: "workScore", formatter: this.formatter },
{ label: "效能绩效", prop: "effectScore", formatter: this.formatter }, { label: "效能绩效分数", prop: "effectScore", formatter: this.formatter },
{ label: "其它绩效", prop: "otherScore", formatter: this.formatter }, { label: "其它绩效分数", prop: "otherScore", formatter: this.formatter },
{ {
label: "累计异常分数", label: "累计异常分数",
......
...@@ -16,7 +16,9 @@ import com.mortals.xhx.base.system.user.model.UserEntity; ...@@ -16,7 +16,9 @@ import com.mortals.xhx.base.system.user.model.UserEntity;
import com.mortals.xhx.base.system.user.model.UserQuery; import com.mortals.xhx.base.system.user.model.UserQuery;
import com.mortals.xhx.base.system.user.service.UserService; import com.mortals.xhx.base.system.user.service.UserService;
import com.mortals.xhx.module.dept.model.DeptEntity; import com.mortals.xhx.module.dept.model.DeptEntity;
import com.mortals.xhx.module.dept.model.DeptPerformStatEntity;
import com.mortals.xhx.module.dept.model.DeptQuery; import com.mortals.xhx.module.dept.model.DeptQuery;
import com.mortals.xhx.module.dept.service.DeptPerformStatService;
import com.mortals.xhx.module.dept.service.DeptService; import com.mortals.xhx.module.dept.service.DeptService;
import com.mortals.xhx.module.hik.face.model.req.img.ImgReq; import com.mortals.xhx.module.hik.face.model.req.img.ImgReq;
import com.mortals.xhx.module.hik.face.service.IHikFaceService; import com.mortals.xhx.module.hik.face.service.IHikFaceService;
...@@ -26,10 +28,8 @@ import com.mortals.xhx.module.perform.model.PerformPerposeStaffStatEntity; ...@@ -26,10 +28,8 @@ import com.mortals.xhx.module.perform.model.PerformPerposeStaffStatEntity;
import com.mortals.xhx.module.perform.service.PerformPerposeDeptStatService; import com.mortals.xhx.module.perform.service.PerformPerposeDeptStatService;
import com.mortals.xhx.module.perform.service.PerformPerposeStaffService; import com.mortals.xhx.module.perform.service.PerformPerposeStaffService;
import com.mortals.xhx.module.perform.service.PerformPerposeStaffStatService; import com.mortals.xhx.module.perform.service.PerformPerposeStaffStatService;
import com.mortals.xhx.module.staff.model.StaffEntity; import com.mortals.xhx.module.staff.model.*;
import com.mortals.xhx.module.staff.model.StaffPerformSummaryEntity; import com.mortals.xhx.module.staff.service.StaffPerformStatService;
import com.mortals.xhx.module.staff.model.StaffPerformSummaryQuery;
import com.mortals.xhx.module.staff.model.StaffQuery;
import com.mortals.xhx.module.staff.service.StaffPerformSummaryService; import com.mortals.xhx.module.staff.service.StaffPerformSummaryService;
import com.mortals.xhx.module.staff.service.StaffService; import com.mortals.xhx.module.staff.service.StaffService;
import com.mortals.xhx.module.workman.model.WorkmanEntity; import com.mortals.xhx.module.workman.model.WorkmanEntity;
...@@ -80,7 +80,10 @@ public class MockDataController { ...@@ -80,7 +80,10 @@ public class MockDataController {
private PerformPerposeDeptStatService perposeDeptStatService; private PerformPerposeDeptStatService perposeDeptStatService;
@Autowired @Autowired
private StaffPerformSummaryService summaryService; private StaffPerformSummaryService summaryService;
@Autowired
private StaffPerformStatService staffPerformStatService;
@Autowired
private DeptPerformStatService deptPerformStatService;
/** /**
* 生成模拟数据 * 生成模拟数据
...@@ -196,15 +199,15 @@ public class MockDataController { ...@@ -196,15 +199,15 @@ public class MockDataController {
statEntity.setWorkNum(item.getWorkNum()); statEntity.setWorkNum(item.getWorkNum());
statEntity.setDeptId(item.getDeptId()); statEntity.setDeptId(item.getDeptId());
statEntity.setDeptName(item.getDeptName()); statEntity.setDeptName(item.getDeptName());
BigDecimal attendScore = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("1")).setScale(2, BigDecimal.ROUND_CEILING); BigDecimal attendScore = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal(100)).setScale(1, BigDecimal.ROUND_CEILING);
BigDecimal reviewScore = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("1")).setScale(2, BigDecimal.ROUND_CEILING); BigDecimal reviewScore = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal(100)).setScale(1, BigDecimal.ROUND_CEILING);
BigDecimal complainScore = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("1")).setScale(2, BigDecimal.ROUND_CEILING); BigDecimal complainScore = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal(100)).setScale(1, BigDecimal.ROUND_CEILING);
BigDecimal goworkScore = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("1")).setScale(2, BigDecimal.ROUND_CEILING); BigDecimal goworkScore = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal(100)).setScale(1, BigDecimal.ROUND_CEILING);
BigDecimal effectScore = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("1")).setScale(2, BigDecimal.ROUND_CEILING); BigDecimal effectScore = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal(100)).setScale(1, BigDecimal.ROUND_CEILING);
BigDecimal otherScore = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("1")).setScale(2, BigDecimal.ROUND_CEILING); BigDecimal otherScore = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal(100)).setScale(1, BigDecimal.ROUND_CEILING);
BigDecimal errorScore = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("1")).setScale(2, BigDecimal.ROUND_CEILING); BigDecimal errorScore = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal(100)).setScale(1, BigDecimal.ROUND_CEILING);
BigDecimal totalScore =attendScore.add(reviewScore).add(complainScore).add(goworkScore).add(effectScore).add(otherScore).add(errorScore); BigDecimal totalScore = attendScore.add(reviewScore).add(complainScore).add(goworkScore).add(effectScore).add(otherScore).add(errorScore);
statEntity.setAttendScore(attendScore); statEntity.setAttendScore(attendScore);
statEntity.setReviewScore(reviewScore); statEntity.setReviewScore(reviewScore);
...@@ -228,6 +231,159 @@ public class MockDataController { ...@@ -228,6 +231,159 @@ public class MockDataController {
} }
/**
* 生成模拟数据
* mortals_xhx_staff_perform_stat
*
* @return
*/
@GetMapping("randomStaffPerformStatData")
@UnAuth
public Rest<Void> randomStaffPerformStatData() {
List<StaffEntity> cacheList = staffService.getCacheList();
//最近两月模拟数据
DateTime beforeStartDate = DateUtil.offsetDay(new Date(), -60);
for (int i = 1; i <= 60; i++) {
DateTime curDate = DateUtil.offsetDay(beforeStartDate, i);
List<StaffPerformStatEntity> collect = cacheList.stream().map(item -> {
StaffPerformStatEntity statEntity = new StaffPerformStatEntity();
statEntity.initAttrValue();
statEntity.setStaffId(item.getId());
statEntity.setStaffName(item.getName());
BigDecimal attendScoreAdd = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("5")).setScale(1, BigDecimal.ROUND_CEILING);
BigDecimal reviewScoreAdd = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("5")).setScale(1, BigDecimal.ROUND_CEILING);
BigDecimal complainScoreAdd = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("5")).setScale(1, BigDecimal.ROUND_CEILING);
BigDecimal goworkScoreAdd = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("5")).setScale(1, BigDecimal.ROUND_CEILING);
BigDecimal effectScoreAdd = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("5")).setScale(1, BigDecimal.ROUND_CEILING);
BigDecimal otherScoreAdd = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("5")).setScale(1, BigDecimal.ROUND_CEILING);
BigDecimal attendScoreSub = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("5")).setScale(1, BigDecimal.ROUND_CEILING);
BigDecimal reviewScoreSub = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("5")).setScale(1, BigDecimal.ROUND_CEILING);
BigDecimal complainScoreSub = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("5")).setScale(1, BigDecimal.ROUND_CEILING);
BigDecimal goworkScoreSub = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("5")).setScale(1, BigDecimal.ROUND_CEILING);
BigDecimal effectScoreSub = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("5")).setScale(1, BigDecimal.ROUND_CEILING);
BigDecimal otherScoreSub = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("5")).setScale(1, BigDecimal.ROUND_CEILING);
statEntity.setAttendScoreAdd(attendScoreAdd);
statEntity.setAttendScoreSub(attendScoreSub);
statEntity.setReviewScoreAdd(reviewScoreAdd);
statEntity.setReviewScoreSub(reviewScoreSub);
statEntity.setComplainScoreAdd(complainScoreAdd);
statEntity.setComplainScoreSub(complainScoreSub);
statEntity.setGoworkScoreAdd(goworkScoreAdd);
statEntity.setGoworkScoreSub(goworkScoreSub);
statEntity.setEffectScoreAdd(effectScoreAdd);
statEntity.setEffectScoreSub(effectScoreSub);
statEntity.setOtherScoreAdd(otherScoreAdd);
statEntity.setOtherScoreSub(otherScoreSub);
BigDecimal totalScoreAdd = attendScoreAdd.add(reviewScoreAdd).add(complainScoreAdd)
.add(goworkScoreAdd).add(effectScoreAdd).add(otherScoreAdd);
BigDecimal totalScoreSub = attendScoreSub.add(reviewScoreSub).add(complainScoreSub)
.add(goworkScoreSub).add(effectScoreSub).add(otherScoreSub);
statEntity.setTotalAddScore(totalScoreAdd);
statEntity.setTotalSubScore(totalScoreSub);
BigDecimal subtract = statEntity.getTotalAddScore().subtract(statEntity.getTotalSubScore());
statEntity.setTotalScore(subtract.compareTo(BigDecimal.ZERO) > 0 ? subtract : BigDecimal.ZERO);
statEntity.setYear(DateUtil.year(curDate));
statEntity.setMonth(DateUtil.month(curDate) + 1);
statEntity.setDay(DateUtil.dayOfMonth(curDate));
return statEntity;
}).collect(Collectors.toList());
staffPerformStatService.save(collect);
}
return Rest.ok();
}
/**
* 生成模拟数据
* mortals_xhx_dept_perform_stat
*
* @return
*/
@GetMapping("randomDeptPerformStatData")
@UnAuth
public Rest<Void> randomDeptPerformStatData() {
List<DeptEntity> deptEntityList = deptService.find(new DeptQuery());
//最近两月模拟数据
DateTime beforeStartDate = DateUtil.offsetDay(new Date(), -60);
for (int i = 1; i <= 60; i++) {
DateTime curDate = DateUtil.offsetDay(beforeStartDate, i);
List<DeptPerformStatEntity> collect = deptEntityList.stream().map(item -> {
DeptPerformStatEntity statEntity = new DeptPerformStatEntity();
statEntity.initAttrValue();
statEntity.setDeptId(item.getId());
statEntity.setDeptName(item.getDeptName());
int personNum = staffService.count(new StaffQuery().deptId(item.getId()), null);
BigDecimal attendScoreAdd = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("5")).multiply(new BigDecimal(personNum)).setScale(1, BigDecimal.ROUND_CEILING);
BigDecimal reviewScoreAdd = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("5")).multiply(new BigDecimal(personNum)).setScale(1, BigDecimal.ROUND_CEILING);
BigDecimal complainScoreAdd = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("5")).multiply(new BigDecimal(personNum)).setScale(1, BigDecimal.ROUND_CEILING);
BigDecimal goworkScoreAdd = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("5")).multiply(new BigDecimal(personNum)).setScale(1, BigDecimal.ROUND_CEILING);
BigDecimal effectScoreAdd = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("5")).multiply(new BigDecimal(personNum)).setScale(1, BigDecimal.ROUND_CEILING);
BigDecimal otherScoreAdd = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("5")).multiply(new BigDecimal(personNum)).setScale(1, BigDecimal.ROUND_CEILING);
BigDecimal attendScoreSub = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("5")).multiply(new BigDecimal(personNum)).setScale(1, BigDecimal.ROUND_CEILING);
BigDecimal reviewScoreSub = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("5")).multiply(new BigDecimal(personNum)).setScale(1, BigDecimal.ROUND_CEILING);
BigDecimal complainScoreSub = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("5")).multiply(new BigDecimal(personNum)).setScale(1, BigDecimal.ROUND_CEILING);
BigDecimal goworkScoreSub = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("5")).multiply(new BigDecimal(personNum)).setScale(1, BigDecimal.ROUND_CEILING);
BigDecimal effectScoreSub = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("5")).multiply(new BigDecimal(personNum)).setScale(1, BigDecimal.ROUND_CEILING);
BigDecimal otherScoreSub = RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("5")).multiply(new BigDecimal(personNum)).setScale(1, BigDecimal.ROUND_CEILING);
statEntity.setAttendScoreAdd(attendScoreAdd);
statEntity.setAttendScoreSub(attendScoreSub);
statEntity.setReviewScoreAdd(reviewScoreAdd);
statEntity.setReviewScoreSub(reviewScoreSub);
statEntity.setComplainScoreAdd(complainScoreAdd);
statEntity.setComplainScoreSub(complainScoreSub);
statEntity.setGoworkScoreAdd(goworkScoreAdd);
statEntity.setGoworkScoreSub(goworkScoreSub);
statEntity.setEffectScoreAdd(effectScoreAdd);
statEntity.setEffectScoreSub(effectScoreSub);
statEntity.setOtherScoreAdd(otherScoreAdd);
statEntity.setOtherScoreSub(otherScoreSub);
BigDecimal totalScoreAdd = attendScoreAdd.add(reviewScoreAdd).add(complainScoreAdd)
.add(goworkScoreAdd).add(effectScoreAdd).add(otherScoreAdd);
BigDecimal totalScoreSub = attendScoreSub.add(reviewScoreSub).add(complainScoreSub)
.add(goworkScoreSub).add(effectScoreSub).add(otherScoreSub);
statEntity.setTotalAddScore(totalScoreAdd);
statEntity.setTotalSubScore(totalScoreSub);
BigDecimal subtract = statEntity.getTotalAddScore().subtract(statEntity.getTotalSubScore());
statEntity.setTotalScore(subtract.compareTo(BigDecimal.ZERO) > 0 ? subtract : BigDecimal.ZERO);
if (personNum > 0) {
BigDecimal aver = statEntity.getTotalScore().divide(new BigDecimal(personNum), 2, BigDecimal.ROUND_CEILING);
statEntity.setAverageScore(aver);
} else {
statEntity.setAverageScore(BigDecimal.ZERO);
}
statEntity.setYear(DateUtil.year(curDate));
statEntity.setMonth(DateUtil.month(curDate) + 1);
statEntity.setDay(DateUtil.dayOfMonth(curDate));
return statEntity;
}).collect(Collectors.toList());
deptPerformStatService.save(collect);
}
return Rest.ok();
}
public static void main(String[] args) { public static void main(String[] args) {
System.out.println(RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("1")).setScale(2, BigDecimal.ROUND_CEILING)); System.out.println(RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("1")).setScale(2, BigDecimal.ROUND_CEILING));
} }
......
package com.mortals.xhx.daemon.task; package com.mortals.xhx.daemon.task;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.PageUtil; import cn.hutool.core.util.PageUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
...@@ -66,7 +67,10 @@ public class SyncDoorsEventTaskImpl implements ITaskExcuteService { ...@@ -66,7 +67,10 @@ public class SyncDoorsEventTaskImpl implements ITaskExcuteService {
userEntity.setCreateTime(new Date()); userEntity.setCreateTime(new Date());
context.setUser(userEntity); context.setUser(userEntity);
AttendanceRecordHikQuery recordHikEntity = new AttendanceRecordHikQuery(); AttendanceRecordHikQuery recordHikEntity = new AttendanceRecordHikQuery();
recordHikEntity.setAttendanceDateStart(DateUtils.getCurrStrDate());
// Date todayStart = DateUtil.offsetHour(new Date(), -5).toJdkDate();
// recordHikEntity.setAttendanceDateStart(DateUtils.getCurrStrDate());
recordHikEntity.setAttendanceDateStart(DateUtil.offsetHour(new Date(), -5).toString());
recordHikEntity.setAttendanceDateEnd(DateUtils.getCurrStrDate()); recordHikEntity.setAttendanceDateEnd(DateUtils.getCurrStrDate());
try { try {
recordHikService.addAttendanceRecord(recordHikEntity, context); recordHikService.addAttendanceRecord(recordHikEntity, context);
...@@ -87,7 +91,8 @@ public class SyncDoorsEventTaskImpl implements ITaskExcuteService { ...@@ -87,7 +91,8 @@ public class SyncDoorsEventTaskImpl implements ITaskExcuteService {
eventTypes.add(196891); eventTypes.add(196891);
doorEventReq.setEventTypes(eventTypes); doorEventReq.setEventTypes(eventTypes);
// 获取当天的开始时间 // 获取当天的开始时间
Date todayStart = DateUtil.beginOfDay(new Date()); Date todayStart = DateUtil.offsetHour(new Date(), -5).toJdkDate();
// Date todayStart = DateUtil.beginOfDay(new Date());
// 获取当天的结束时间 // 获取当天的结束时间
Date todayEnd = DateUtil.endOfDay(new Date()); Date todayEnd = DateUtil.endOfDay(new Date());
doorEventReq.setStartTime(todayStart); doorEventReq.setStartTime(todayStart);
......
...@@ -140,7 +140,10 @@ public class SyncUserTaskImpl implements ITaskExcuteService { ...@@ -140,7 +140,10 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
attendanceStatEntity.setPersonalLeave(balanceEntity.getPersonalLeaveDays()); attendanceStatEntity.setPersonalLeave(balanceEntity.getPersonalLeaveDays());
attendanceStatService.save(attendanceStatEntity); attendanceStatService.save(attendanceStatEntity);
//统计各级部门员工数量 todo 优化统计 //统计各级部门员工数量 todo 优化统计
String ancestor = deptEntity.getAncestors().split(",", 2)[1]; if (!ObjectUtils.isEmpty(deptEntity.getAncestors())) {
String[] split = deptEntity.getAncestors().split(",", 2);
if (split.length > 1) {
String ancestor = split[1];
String[] ancestors = ancestor.split(","); String[] ancestors = ancestor.split(",");
for (String newAncestor : ancestors) { for (String newAncestor : ancestors) {
DeptEntity deptEntity2 = deptService.get(Long.valueOf(newAncestor)); DeptEntity deptEntity2 = deptService.get(Long.valueOf(newAncestor));
...@@ -149,6 +152,8 @@ public class SyncUserTaskImpl implements ITaskExcuteService { ...@@ -149,6 +152,8 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
deptService.update(deptEntity2); deptService.update(deptEntity2);
} }
} }
}
}
} else { } else {
//更新 //更新
if (!ObjectUtils.isEmpty(deptEntity)) { if (!ObjectUtils.isEmpty(deptEntity)) {
...@@ -166,7 +171,10 @@ public class SyncUserTaskImpl implements ITaskExcuteService { ...@@ -166,7 +171,10 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
staffEntity.setUpdateTime(new Date()); staffEntity.setUpdateTime(new Date());
staffService.update(staffEntity); staffService.update(staffEntity);
//统计各级部门员工数量 //统计各级部门员工数量
String ancestor = deptEntity.getAncestors().split(",", 2)[1]; if (!ObjectUtils.isEmpty(deptEntity.getAncestors())) {
String[] split = deptEntity.getAncestors().split(",", 2);
if(split.length>1){
String ancestor = split[1];
String[] ancestors = ancestor.split(","); String[] ancestors = ancestor.split(",");
for (String newAncestor : ancestors) { for (String newAncestor : ancestors) {
DeptEntity deptEntity2 = deptService.get(Long.valueOf(newAncestor)); DeptEntity deptEntity2 = deptService.get(Long.valueOf(newAncestor));
...@@ -179,6 +187,8 @@ public class SyncUserTaskImpl implements ITaskExcuteService { ...@@ -179,6 +187,8 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
} }
} }
} }
}
}
private void syncDepts() { private void syncDepts() {
//部门同步 //部门同步
...@@ -220,6 +230,7 @@ public class SyncUserTaskImpl implements ITaskExcuteService { ...@@ -220,6 +230,7 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
} }
} }
} }
@Override @Override
public void stopTask(ITask task) throws AppException { public void stopTask(ITask task) throws AppException {
......
...@@ -22,6 +22,8 @@ import org.apache.poi.ss.formula.functions.T; ...@@ -22,6 +22,8 @@ import org.apache.poi.ss.formula.functions.T;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import java.util.HashMap;
@Service("dingPersonService") @Service("dingPersonService")
@Slf4j @Slf4j
...@@ -120,7 +122,7 @@ public class DingPersonServiceImpl extends AbstractDingTalkService implements ID ...@@ -120,7 +122,7 @@ public class DingPersonServiceImpl extends AbstractDingTalkService implements ID
com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config(); com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config();
config.protocol = "https"; config.protocol = "https";
config.regionId = "central"; config.regionId = "central";
config.endpoint = domain.replace("http://",""); // config.endpoint = domain.replace("http://", "");
return new com.aliyun.dingtalkworkflow_1_0.Client(config); return new com.aliyun.dingtalkworkflow_1_0.Client(config);
} }
...@@ -130,20 +132,19 @@ public class DingPersonServiceImpl extends AbstractDingTalkService implements ID ...@@ -130,20 +132,19 @@ public class DingPersonServiceImpl extends AbstractDingTalkService implements ID
com.aliyun.dingtalkworkflow_1_0.Client client = createClient(); com.aliyun.dingtalkworkflow_1_0.Client client = createClient();
com.aliyun.dingtalkworkflow_1_0.models.GetProcessInstanceHeaders getProcessInstanceHeaders = new com.aliyun.dingtalkworkflow_1_0.models.GetProcessInstanceHeaders(); com.aliyun.dingtalkworkflow_1_0.models.GetProcessInstanceHeaders getProcessInstanceHeaders = new com.aliyun.dingtalkworkflow_1_0.models.GetProcessInstanceHeaders();
getProcessInstanceHeaders.xAcsDingtalkAccessToken = getToken(); getProcessInstanceHeaders.xAcsDingtalkAccessToken = getToken();
/* HashMap<String, String> map = new HashMap<>();
getProcessInstanceHeaders.getCommonHeaders().put("host","172.15.28.113"); getProcessInstanceHeaders.setCommonHeaders(map);
getProcessInstanceHeaders.getCommonHeaders().put("port","8918"); getProcessInstanceHeaders.getCommonHeaders().put("host", "172.15.28.113");
getProcessInstanceHeaders.getCommonHeaders().put("protocol","http"); getProcessInstanceHeaders.getCommonHeaders().put("port", "8918");
getProcessInstanceHeaders.getCommonHeaders().put("protocol", "http");*/
com.aliyun.dingtalkworkflow_1_0.models.GetProcessInstanceRequest getProcessInstanceRequest = new com.aliyun.dingtalkworkflow_1_0.models.GetProcessInstanceRequest() com.aliyun.dingtalkworkflow_1_0.models.GetProcessInstanceRequest getProcessInstanceRequest = new com.aliyun.dingtalkworkflow_1_0.models.GetProcessInstanceRequest()
.setProcessInstanceId(processInstanceId); .setProcessInstanceId(processInstanceId);
log.info("processInstanceId:{}", processInstanceId);
GetProcessInstanceResponse rsp = client.getProcessInstanceWithOptions(getProcessInstanceRequest, getProcessInstanceHeaders, new com.aliyun.teautil.models.RuntimeOptions()); GetProcessInstanceResponse rsp = client.getProcessInstanceWithOptions(getProcessInstanceRequest, getProcessInstanceHeaders, new com.aliyun.teautil.models.RuntimeOptions());
return Rest.ok("成功", rsp.getBody().getResult()); return Rest.ok("成功", rsp.getBody().getResult());
} catch (Exception e) { } catch (Exception e) {
log.info("根据用户查询审批详情失败", e); log.error("根据用户查询审批详情失败", e);
return Rest.fail(e.getMessage()); return Rest.fail(e.getMessage());
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment