Commit dfedd171 authored by 王启林's avatar 王启林
parents 51765fdb f13b28fa
......@@ -68,6 +68,7 @@
<profiles.hik.appSecret>2m9RcPJOKq5j2QPQM4v5</profiles.hik.appSecret>
<profiles.dingtalk.domain>https://oapi.dingtalk.com</profiles.dingtalk.domain>
<profiles.dingtalk.oaUrl>api.dingtalk.com</profiles.dingtalk.oaUrl>
<profiles.dingtalk.agentId>2652674890</profiles.dingtalk.agentId>
<profiles.dingtalk.appKey>dingpqzradgfr4efdi2j</profiles.dingtalk.appKey>
<profiles.dingtalk.appSecret>bF2WALmo5_Wuj3hg5gXeWqezrYnZChUJ88HjzNWpkA9ivdOxfBDGOGYcfVRfB3vd</profiles.dingtalk.appSecret>
......@@ -98,6 +99,7 @@
<profiles.hik.appSecret>2m9RcPJOKq5j2QPQM4v5</profiles.hik.appSecret>
<profiles.dingtalk.domain>http://172.15.28.113:8918</profiles.dingtalk.domain>
<profiles.dingtalk.oaUrl>172.15.28.113:8919</profiles.dingtalk.oaUrl>
<profiles.dingtalk.agentId>2652674890</profiles.dingtalk.agentId>
<profiles.dingtalk.appKey>dingpqzradgfr4efdi2j</profiles.dingtalk.appKey>
<profiles.dingtalk.appSecret>bF2WALmo5_Wuj3hg5gXeWqezrYnZChUJ88HjzNWpkA9ivdOxfBDGOGYcfVRfB3vd</profiles.dingtalk.appSecret>
......
......@@ -158,11 +158,12 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
homeStatInfo.setTotalDeptNum(totalDeptNum);
//todo
homeStatInfo.setAttendRadio(new BigDecimal(91.00));
homeStatInfo.setAttendRadio(new BigDecimal(98.00));
homeStatInfo.setLevealPersonNum(6);
homeStatInfo.setLatePersonNum(2);
homeStatInfo.setLeftEarlyPersonNum(1);
homeStatInfo.setMissCardPersonNum(0);
homeStatInfo.setMissCardPersonNum(23);
homeStatInfo.setAttendPersonNum(426);
data.put("homeStat", homeStatInfo);
data.put("token", token);
......
......@@ -19,8 +19,6 @@ public abstract class BaseReq implements Serializable {
*/
private Integer size;
/**
* 工号
*/
......
package com.mortals.xhx.busiz;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
@Data
public class TestReq {
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTimeStart;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTimeEnd;
}
......@@ -139,21 +139,7 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
attendanceStatEntity.setHomeLeave(balanceEntity.getHomeLeave());
attendanceStatEntity.setPersonalLeave(balanceEntity.getPersonalLeaveDays());
attendanceStatService.save(attendanceStatEntity);
//统计各级部门员工数量 todo 优化统计
if (!ObjectUtils.isEmpty(deptEntity.getAncestors())) {
String[] split = deptEntity.getAncestors().split(",", 2);
if (split.length > 1) {
String ancestor = split[1];
String[] ancestors = ancestor.split(",");
for (String newAncestor : ancestors) {
DeptEntity deptEntity2 = deptService.get(Long.valueOf(newAncestor));
if (Objects.nonNull(deptEntity2)) {
deptEntity2.setPersonNum(deptEntity2.getPersonNum() + 1);
deptService.update(deptEntity2);
}
}
}
}
} else {
//更新
if (!ObjectUtils.isEmpty(deptEntity)) {
......@@ -170,21 +156,7 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
staffEntity.setUpdateUserId(1L);
staffEntity.setUpdateTime(new Date());
staffService.update(staffEntity);
//统计各级部门员工数量
if (!ObjectUtils.isEmpty(deptEntity.getAncestors())) {
String[] split = deptEntity.getAncestors().split(",", 2);
if(split.length>1){
String ancestor = split[1];
String[] ancestors = ancestor.split(",");
for (String newAncestor : ancestors) {
DeptEntity deptEntity2 = deptService.get(Long.valueOf(newAncestor));
if (Objects.nonNull(deptEntity2)) {
deptEntity2.setPersonNum(deptEntity2.getPersonNum() + 1);
deptService.update(deptEntity2);
}
}
}
}
}
}
}
......
package com.mortals.xhx.module.attendance.service;
import com.mortals.framework.model.Context;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.attendance.dao.AttendanceRecordHikDao;
import com.mortals.xhx.module.attendance.model.AttendanceRecordHikEntity;
/**
......@@ -13,6 +14,8 @@ import com.mortals.xhx.module.attendance.model.AttendanceRecordHikEntity;
*/
public interface AttendanceRecordHikService extends ICRUDService<AttendanceRecordHikEntity,Long>{
AttendanceRecordHikDao getDao();
/**
* 将原始数据导入打卡记录表
* @param entity
......
package com.mortals.xhx.module.dept.service;
import com.mortals.framework.model.Context;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.dept.dao.DeptDao;
import com.mortals.xhx.module.dept.model.DeptEntity;
import com.mortals.xhx.module.dept.model.DeptTreeSelect;
......@@ -15,6 +16,8 @@ import java.util.List;
*/
public interface DeptService extends ICRUDService<DeptEntity,Long>{
DeptDao getDao();
/**
* 是否存在部门信息节点
*
......
......@@ -52,6 +52,12 @@ public abstract class AbstractDingTalkService implements IDingPersonService {
@Value("${dingtalk.AppSecret:''}")
protected String appSecret;
/**
* appKey
*/
@Value("${dingtalk.oaUrl:}")
protected String oaUrl;
@Autowired
private ICacheService cacheService;
......
......@@ -120,9 +120,11 @@ public class DingPersonServiceImpl extends AbstractDingTalkService implements ID
*/
public com.aliyun.dingtalkworkflow_1_0.Client createClient() throws Exception {
com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config();
config.protocol = "https";
//config.protocol = "https";
config.protocol = "http";
config.regionId = "central";
// config.endpoint = domain.replace("http://", "");
// config.endpoint = domain.replace("http://", "");
config.endpoint = oaUrl;
return new com.aliyun.dingtalkworkflow_1_0.Client(config);
}
......@@ -132,11 +134,11 @@ public class DingPersonServiceImpl extends AbstractDingTalkService implements ID
com.aliyun.dingtalkworkflow_1_0.Client client = createClient();
com.aliyun.dingtalkworkflow_1_0.models.GetProcessInstanceHeaders getProcessInstanceHeaders = new com.aliyun.dingtalkworkflow_1_0.models.GetProcessInstanceHeaders();
getProcessInstanceHeaders.xAcsDingtalkAccessToken = getToken();
/* HashMap<String, String> map = new HashMap<>();
HashMap<String, String> map = new HashMap<>();
getProcessInstanceHeaders.setCommonHeaders(map);
getProcessInstanceHeaders.getCommonHeaders().put("host", "172.15.28.113");
getProcessInstanceHeaders.getCommonHeaders().put("port", "8918");
getProcessInstanceHeaders.getCommonHeaders().put("protocol", "http");*/
getProcessInstanceHeaders.getCommonHeaders().put("host", "172.15.28.113:8919");
// getProcessInstanceHeaders.getCommonHeaders().put("port", "8919");
// getProcessInstanceHeaders.getCommonHeaders().put("protocol", "http");
com.aliyun.dingtalkworkflow_1_0.models.GetProcessInstanceRequest getProcessInstanceRequest = new com.aliyun.dingtalkworkflow_1_0.models.GetProcessInstanceRequest()
.setProcessInstanceId(processInstanceId);
......
......@@ -8,7 +8,7 @@ import java.util.Map;
public abstract class AbstractHikService {
@Value("${hik.host:''}")
@Value("${hik.host:}")
protected String host;
@Value("${hik.appKey:''}")
......
......@@ -42,7 +42,7 @@ public class JobController extends BaseCRUDJsonBodyMappingController<JobService,
@Override
protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "type", JobTypeEnum.getEnumMap());
this.addDict(model, "group",service.queryGroupName(new JobQuery()).stream().collect(Collectors.toMap(x->x.getId().toString(), y->y.getGroupName(),(o, n)->n)));
this.addDict(model, "groupId",service.queryGroupName(new JobQuery()).stream().collect(Collectors.toMap(x->x.getId().toString(), y->y.getGroupName(),(o, n)->n)));
super.init(model, context);
}
......
......@@ -74,4 +74,5 @@ dingtalk:
AppSecret: @profiles.dingtalk.appSecret@
AesKey: @profiles.dingtalk.aesKey@
token: @profiles.dingtalk.token@
oaUrl: @profiles.dingtalk.oaUrl@
......@@ -20,7 +20,7 @@
<plugin interceptor="com.mortals.framework.thirty.mybatis.LogInterceptor">
<property name="enableExecutorTime" value="true" />
<property name="showSql" value="true" />
<property name="showSql" value="false" />
</plugin>
</plugins>
</configuration>
\ No newline at end of file
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