个人页面接口,加班时间计算bug,清理离职数据功能,打卡匹配bug修复,规律排班bug修复,假期发放起算日期数据异常bug修复。请假、加班、出差补打卡流程归档自动分析出勤功能,
parent
f931a4c2ce
commit
350fed1406
@ -0,0 +1,75 @@
|
|||||||
|
package com.engine.jucailinkq.attendance.component.page.cmd;
|
||||||
|
|
||||||
|
import com.cloudstore.eccom.constant.WeaBoolAttr;
|
||||||
|
import com.cloudstore.eccom.pc.table.WeaTable;
|
||||||
|
import com.cloudstore.eccom.pc.table.WeaTableColumn;
|
||||||
|
import com.cloudstore.eccom.pc.table.WeaTableType;
|
||||||
|
import com.cloudstore.eccom.result.WeaResultMsg;
|
||||||
|
import com.engine.common.biz.AbstractCommonCommand;
|
||||||
|
import com.engine.common.entity.BizLogContext;
|
||||||
|
import com.engine.core.interceptor.CommandContext;
|
||||||
|
import com.engine.jucailinkq.common.util.DateUtil;
|
||||||
|
import weaver.general.PageIdConst;
|
||||||
|
import weaver.general.Util;
|
||||||
|
import weaver.hrm.User;
|
||||||
|
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class GetWorkInfoListCmd extends AbstractCommonCommand<Map<String,Object>> {
|
||||||
|
|
||||||
|
public GetWorkInfoListCmd(Map<String,Object> params, User user){
|
||||||
|
this.params=params;
|
||||||
|
this.user=user;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public BizLogContext getLogContext() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> execute(CommandContext commandContext) {
|
||||||
|
String generateDate = Util.null2String(params.get("generateDate"));
|
||||||
|
String userId = Util.null2String(params.get("userId"));
|
||||||
|
if ("".equals(userId)){
|
||||||
|
userId = String.valueOf(user.getUID());
|
||||||
|
}
|
||||||
|
int diffdays = DateUtil.getDays(generateDate, Calendar.DAY_OF_MONTH);
|
||||||
|
String startDate = generateDate + "-01";
|
||||||
|
String endDate = generateDate + "-" + diffdays;
|
||||||
|
|
||||||
|
WeaTable table = new WeaTable();
|
||||||
|
String pageId = "4073cfcdc177469aa5cc25e7f90f36ef";
|
||||||
|
table.setPageID(pageId);
|
||||||
|
table.setPageUID(String.format("%s_%s",pageId,user.getUID()));
|
||||||
|
String pageSize = PageIdConst.getPageSize(pageId, user.getUID());
|
||||||
|
table.setPagesize(pageSize);
|
||||||
|
String fields = "t.id,t.rq,t.cqzt,t.cqsc,t.rqlx,t.sfxx ";
|
||||||
|
table.setBackfields(fields);
|
||||||
|
|
||||||
|
String fromSql = " from uf_jcl_kq_cqjg t ";
|
||||||
|
table.setSqlform(fromSql);
|
||||||
|
|
||||||
|
String sqlWhere = " where ygid="+userId +" and rq>='"+startDate +"' and rq<='"+endDate+"'";
|
||||||
|
|
||||||
|
table.setSqlwhere(sqlWhere);
|
||||||
|
|
||||||
|
|
||||||
|
table.setSqlprimarykey("id");
|
||||||
|
table.getColumns().add(new WeaTableColumn("id").setDisplay(WeaBoolAttr.FALSE));
|
||||||
|
table.getColumns().add(new WeaTableColumn("20%", "日期", "rq"));
|
||||||
|
table.getColumns().add(new WeaTableColumn("20%", "出勤状态", "cqzt","cqzt","com.engine.jucailinkq.attendance.component.page.transtmethod.Methods.attendaceState"));
|
||||||
|
table.getColumns().add(new WeaTableColumn("20%", "出勤时长", "cqsc"));
|
||||||
|
table.getColumns().add(new WeaTableColumn("20%", "日期类型", "rqlx","rqlx","com.engine.jucailinkq.attendance.component.page.transtmethod.Methods.getRqlx"));
|
||||||
|
table.getColumns().add(new WeaTableColumn("20%", "是否休息", "sfxx","sfxx","com.engine.jucailinkq.attendance.component.page.transtmethod.Methods.checkBox"));
|
||||||
|
|
||||||
|
|
||||||
|
Map<String, Object> resultMap = new HashMap<>(4);
|
||||||
|
WeaResultMsg result = new WeaResultMsg(false);
|
||||||
|
result.putAll(table.makeDataResult());
|
||||||
|
result.success();
|
||||||
|
resultMap.putAll(result.getResultMap());
|
||||||
|
return resultMap;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
package com.engine.jucailinkq.attendance.component.page.transtmethod;
|
||||||
|
|
||||||
|
import com.engine.jucailinkq.attendance.enums.DateTypeEnum;
|
||||||
|
|
||||||
|
public class Methods {
|
||||||
|
public static String attendaceState(String cqzt){
|
||||||
|
String result="";
|
||||||
|
if (cqzt.equals("0")){
|
||||||
|
result="正常";
|
||||||
|
}else if (cqzt.equals("1")){
|
||||||
|
result="异常";
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String checkBox(String check){
|
||||||
|
String result="";
|
||||||
|
if (check.equals("0")){
|
||||||
|
result="否";
|
||||||
|
}else if (check.equals("1")){
|
||||||
|
result="是";
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
public static String getRqlx(String rqlx){
|
||||||
|
String result= "";
|
||||||
|
if (DateTypeEnum.getEnum(rqlx) != null){
|
||||||
|
result = DateTypeEnum.getEnum(rqlx).getValue();
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,69 @@
|
|||||||
|
package com.engine.jucailinkq.attendance.workflow.action.common;
|
||||||
|
|
||||||
|
import com.engine.common.util.ServiceUtil;
|
||||||
|
import com.engine.jucailinkq.attendance.attendanceanalysis.wrapper.AttendaceActionWrapper;
|
||||||
|
import com.engine.jucailinkq.attendance.workflow.enums.WorkFlowTypeEnum;
|
||||||
|
import com.engine.jucailinkq.common.util.CommonUtil;
|
||||||
|
import com.engine.jucailinkq.common.util.DateUtil;
|
||||||
|
import com.engine.jucailinkq.common.util.DbTools;
|
||||||
|
import com.google.common.collect.Maps;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import weaver.interfaces.workflow.action.Action;
|
||||||
|
import weaver.soa.workflow.request.RequestInfo;
|
||||||
|
|
||||||
|
import java.time.ZoneOffset;
|
||||||
|
import java.util.Comparator;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程归档后分析出勤结果
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
public class ExcuteAttendanceAnysisAction implements Action {
|
||||||
|
|
||||||
|
private String userKey;
|
||||||
|
|
||||||
|
private AttendaceActionWrapper action = ServiceUtil.getService(AttendaceActionWrapper.class);
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String execute(RequestInfo requestInfo) {
|
||||||
|
log.info("userKey : [{}]",userKey);
|
||||||
|
String workflowId = requestInfo.getWorkflowid();
|
||||||
|
String sql = "select lclx from uf_jcl_kq_kqlcsz where ljid = ?";
|
||||||
|
List<Map<String,Object>> workflowSet = DbTools.getSqlToList(sql,workflowId);
|
||||||
|
List<Map<String, String>> detailTableData = null;
|
||||||
|
if (workflowSet.size() >0){
|
||||||
|
WorkFlowTypeEnum worflowType = WorkFlowTypeEnum.getEnum(workflowSet.get(0).get("lclx").toString());
|
||||||
|
detailTableData = CommonUtil.getDetailTableInfo(requestInfo,0, worflowType,requestInfo.getWorkflowid());
|
||||||
|
if (worflowType == WorkFlowTypeEnum.ASKFORLEAVE || worflowType == WorkFlowTypeEnum.BATCH_ASKFORLEAVE){
|
||||||
|
userKey = "qjr";
|
||||||
|
}else if (worflowType == WorkFlowTypeEnum.OVERTIME_PLAN){
|
||||||
|
userKey = "jbry";
|
||||||
|
}else if (worflowType == WorkFlowTypeEnum.EVECTION){
|
||||||
|
userKey = "ccr";
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
detailTableData = CommonUtil.getDetailTableInfo(requestInfo,0);
|
||||||
|
}
|
||||||
|
Map<String,List<Map<String,String>>> detailGroupUser = detailTableData.stream().collect(Collectors.groupingBy(e->e.get(userKey)));
|
||||||
|
|
||||||
|
for (Map.Entry<String,List<Map<String,String>>> entry :detailGroupUser.entrySet()){
|
||||||
|
String userId = entry.getKey();
|
||||||
|
List<Map<String,String>> dataList = entry.getValue().stream().sorted(Comparator.comparing(e-> DateUtil.getTime(e.get("ksrq")).toInstant(ZoneOffset.of("+8")).toEpochMilli())).collect(Collectors.toList());
|
||||||
|
if (dataList.size() > 0){
|
||||||
|
String startDate = dataList.get(0).get("ksrq");
|
||||||
|
String endDate = dataList.get(dataList.size()-1).get("jsrq");
|
||||||
|
Map<String,Object> paramMap = Maps.newHashMap();
|
||||||
|
paramMap.put("startDate",startDate);
|
||||||
|
paramMap.put("endDate",endDate);
|
||||||
|
paramMap.put("userIds",userId);
|
||||||
|
action.alysisActionWrapper(paramMap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue