同步考勤字段值
This commit is contained in:
parent
26dd841aa8
commit
416ccd57a6
|
|
@ -26,7 +26,7 @@ public class AttendQuoteDataBO {
|
|||
/**
|
||||
* 根据考勤模块来构建考勤数据
|
||||
*/
|
||||
public static void buildAttendDataFromRemote( List<Map<String, Object>> list, List<AttendQuoteFieldPO> attendQuoteFields, List<Map<String, Object>> attendQuoteSyncData) {
|
||||
public static void buildAttendDataFromRemote( List<Map<String, String>> list, List<AttendQuoteFieldPO> attendQuoteFields, List<Map<String, Object>> attendQuoteSyncData) {
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.salary.remote.attend.entity;
|
||||
|
||||
import com.engine.salary.util.valid.DataCheck;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
|
@ -12,9 +13,17 @@ import java.util.Map;
|
|||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class Attend4Salary {
|
||||
|
||||
@DataCheck(require = true,message = "开始日期为空!")
|
||||
private Date beginDate;
|
||||
|
||||
@DataCheck(require = true,message = "结束日期为空!")
|
||||
private Date endDate;
|
||||
|
||||
private String unit;
|
||||
|
||||
@DataCheck(require = true,message = "考勤人员为空!")
|
||||
private List<Long> onlyEmpIds;
|
||||
|
||||
private Map<String, Object> extendParam;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ public interface RemoteAttend4SalaryService {
|
|||
List<Map<String, String>> getColumns();
|
||||
|
||||
|
||||
List<Map<String, Object>> getDatas(Attend4Salary attend4Salary);
|
||||
List<Map<String,String>> getDatas(Attend4Salary attend4Salary);
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2,22 +2,20 @@ package com.engine.salary.remote.attend.service.impl;
|
|||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.mapper.attend.AttendDataMapper;
|
||||
import com.engine.salary.remote.attend.cmd.GetKQReportCmd;
|
||||
import com.engine.salary.remote.attend.entity.Attend4Salary;
|
||||
import com.engine.salary.remote.attend.service.RemoteAttend4SalaryService;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.engine.salary.util.SalaryDateUtil;
|
||||
import com.engine.salary.util.valid.ValidUtil;
|
||||
import com.google.common.collect.Maps;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class RemoteAttend4SalaryServiceImpl extends Service implements RemoteAttend4SalaryService {
|
||||
|
||||
private AttendDataMapper getAttendDataMapper() {
|
||||
return MapperProxyFactory.getProxy(AttendDataMapper.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, String>> getColumns() {
|
||||
|
|
@ -25,10 +23,7 @@ public class RemoteAttend4SalaryServiceImpl extends Service implements RemoteAtt
|
|||
paramsMap.put("pageIndex", 1);
|
||||
paramsMap.put("pageSize", 10);
|
||||
paramsMap.put("typeselect", "6");
|
||||
// paramsMap.put("fromDate","2021-01-01");
|
||||
// paramsMap.put("toDate","2023-01-01");
|
||||
paramsMap.put("viewScope", "3");
|
||||
// paramsMap.put("resourceId","22");
|
||||
paramsMap.put("isNoAccount", "1");
|
||||
paramsMap.put("attendanceSerial", "");
|
||||
paramsMap.put("isFromMyAttendance", "1");
|
||||
|
|
@ -72,22 +67,18 @@ public class RemoteAttend4SalaryServiceImpl extends Service implements RemoteAtt
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getDatas(Attend4Salary attend4Salary) {
|
||||
|
||||
// List<Long> onlyEmpIds = attend4Salary.getOnlyEmpIds();
|
||||
|
||||
// List<Map<String, Object>> attendData = getAttendDataMapper().getAttendData();
|
||||
//
|
||||
// return attendData;
|
||||
public List<Map<String,String>> getDatas(Attend4Salary attend4Salary) {
|
||||
ValidUtil.doValidator(attend4Salary);
|
||||
|
||||
Map<String, Object> paramsMap = new HashMap<String, Object>();
|
||||
paramsMap.put("pageIndex", 1);
|
||||
paramsMap.put("pageSize", 10);
|
||||
paramsMap.put("pageSize", 500);
|
||||
paramsMap.put("typeselect", "6");
|
||||
paramsMap.put("fromDate", "2021-01-01");
|
||||
paramsMap.put("toDate", "2023-01-01");
|
||||
paramsMap.put("fromDate", SalaryDateUtil.getFormatLocalDate(attend4Salary.getBeginDate()));
|
||||
paramsMap.put("toDate", SalaryDateUtil.getFormatLocalDate(attend4Salary.getEndDate()));
|
||||
paramsMap.put("viewScope", "3");
|
||||
paramsMap.put("resourceId", "22");
|
||||
List<String> resourceIds = attend4Salary.getOnlyEmpIds().stream().map(String::valueOf).collect(Collectors.toList());
|
||||
paramsMap.put("resourceId", String.join(",", resourceIds));
|
||||
paramsMap.put("isNoAccount", "1");
|
||||
paramsMap.put("attendanceSerial", "");
|
||||
paramsMap.put("isFromMyAttendance", "1");
|
||||
|
|
@ -96,10 +87,9 @@ public class RemoteAttend4SalaryServiceImpl extends Service implements RemoteAtt
|
|||
temp.put("reportType", "month");
|
||||
|
||||
|
||||
Object datas = commandExecutor.execute(new GetKQReportCmd(temp, user)).get("datas");
|
||||
System.out.println(datas);
|
||||
List<Map<String,String>> list = (List<Map<String,String>>)commandExecutor.execute(new GetKQReportCmd(temp, user)).get("datas");
|
||||
|
||||
return null;
|
||||
return list;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -413,7 +413,7 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa
|
|||
attend4Salary.setBeginDate(attendCycleRange.getFromDate());
|
||||
attend4Salary.setEndDate(attendCycleRange.getEndDate());
|
||||
attend4Salary.setOnlyEmpIds(part);
|
||||
List<Map<String, Object>> attendResult = getRemoteAttend4SalaryService(user).getDatas(attend4Salary);
|
||||
List<Map<String,String>> attendResult = getRemoteAttend4SalaryService(user).getDatas(attend4Salary);
|
||||
log.info("考勤数据:{}", JSONUtils.toJSONString(attendResult));
|
||||
AttendQuoteDataBO.buildAttendDataFromRemote(attendResult, attendQuoteFields, attendQuoteSyncData);
|
||||
// attend4Salary.setUnit("day");
|
||||
|
|
|
|||
Loading…
Reference in New Issue