Merge remote-tracking branch 'origin/main'
commit
785ee44a92
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
@ -0,0 +1,265 @@
|
||||
package com.engine.attendance.attendanceanalysis.web;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cloudstore.dev.api.util.EMManager;
|
||||
import com.engine.common.util.ApiReturnTools;
|
||||
import com.engine.common.util.ParamUtil;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.compress.utils.Lists;
|
||||
import weaver.common.DateUtil;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.dateformat.DateTransformer;
|
||||
import weaver.dateformat.TimeZoneVar;
|
||||
import weaver.general.BaseBean;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
import weaver.hrm.User;
|
||||
import weaver.hrm.resource.ResourceComInfo;
|
||||
import weaver.systeminfo.SystemEnv;
|
||||
|
||||
@Slf4j
|
||||
@Path("/hrm/kq/jucailin/button")
|
||||
public class AttendanceJucailinButtonAction {
|
||||
|
||||
private DateTimeFormatter fullFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
/**
|
||||
* 将所有的企业日历取消默认值标记
|
||||
*/
|
||||
@POST
|
||||
@Path("/getButtonBaseInfo")
|
||||
@Produces(MediaType.TEXT_PLAIN)
|
||||
public String getButtonBaseInfo(@Context HttpServletRequest request, @Context HttpServletResponse response){
|
||||
Map<String, Object> retmap = new HashMap<String, Object>();
|
||||
User user = HrmUserVarify.getUser (request , response) ;
|
||||
try {
|
||||
ResourceComInfo resourceComInfo = new ResourceComInfo();
|
||||
String lastname = user.getLastname();
|
||||
String messagerurl = resourceComInfo.getMessagerUrls("" + user.getUID());
|
||||
String shortname = "";
|
||||
|
||||
boolean USERICONLASTNAME = Util.null2String(new BaseBean().getPropValue("Others", "USERICONLASTNAME")).equals("1");
|
||||
if (USERICONLASTNAME && (messagerurl.indexOf("icon_w_wev8.jpg") > -1 || messagerurl.indexOf("icon_m_wev8.jpg") > -1 || messagerurl.indexOf("dummyContact.png") > -1)) {
|
||||
shortname = User.getLastname(Util.null2String(Util.formatMultiLang(lastname, "" + user.getLanguage())));
|
||||
}
|
||||
String curDate = DateUtil.getCurrentDate();
|
||||
|
||||
retmap.put("userid", user.getUID());
|
||||
retmap.put("lastname", lastname);
|
||||
retmap.put("shortname", shortname);
|
||||
retmap.put("messagerurl", messagerurl);
|
||||
|
||||
retmap.put("date", curDate);
|
||||
retmap.put("timemillis", System.currentTimeMillis());
|
||||
|
||||
retmap.put("status", "1");
|
||||
} catch (Exception e) {
|
||||
log.error("execute fail,catch error: [{}]",e);
|
||||
retmap.put("status", "-1");
|
||||
return ApiReturnTools.error("500",SystemEnv.getHtmlLabelName(382661, user.getLanguage()));
|
||||
}
|
||||
return JSONObject.toJSONString(retmap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取签到签退按钮
|
||||
* 以及考勤流程数据
|
||||
* 以及上次签到时间
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/getButtons")
|
||||
@Produces(MediaType.TEXT_PLAIN)
|
||||
public String getButtons(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
Map<String, Object> retmap = new HashMap<String, Object>();
|
||||
User user = HrmUserVarify.getUser (request , response) ;
|
||||
try{
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
String curDate = DateUtil.getCurrentDate();
|
||||
//真正的考勤时间线
|
||||
ResourceComInfo resourceComInfo = new ResourceComInfo();
|
||||
|
||||
String lastname = user.getLastname();
|
||||
String messagerurl = resourceComInfo.getMessagerUrls(""+user.getUID());
|
||||
String shortname = "";
|
||||
|
||||
boolean USERICONLASTNAME = Util.null2String(new BaseBean().getPropValue("Others" , "USERICONLASTNAME")).equals("1");
|
||||
if(USERICONLASTNAME&&(messagerurl.indexOf("icon_w_wev8.jpg")>-1||messagerurl.indexOf("icon_m_wev8.jpg")>-1||messagerurl.indexOf("dummyContact.png")>-1)){
|
||||
shortname = User.getLastname(Util.null2String(Util.formatMultiLang(lastname, ""+user.getLanguage())));
|
||||
}
|
||||
String resourceId = String.valueOf(user.getUID());
|
||||
|
||||
List<Object> signListLine = getSignListLine(resourceId,curDate);
|
||||
|
||||
retmap.put("lastname", lastname);
|
||||
retmap.put("shortname", shortname);
|
||||
retmap.put("messagerurl", messagerurl);
|
||||
retmap.put("date", curDate);
|
||||
retmap.put("timeline", signListLine);
|
||||
retmap.put("status", "1");
|
||||
retmap.put("now", now.format(fullFormatter));
|
||||
|
||||
}catch (Exception e) {
|
||||
retmap.put("status", "-1");
|
||||
retmap.put("message", SystemEnv.getHtmlLabelName(382661,user.getLanguage()));
|
||||
}
|
||||
return JSONObject.toJSONString(retmap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 针对非工作时间的签到签退
|
||||
*/
|
||||
private List<Object> getSignListLine(String resourceId, String curDate) {
|
||||
List<Object> signListLine = Lists.newArrayList();
|
||||
RecordSet recordSet = new RecordSet();
|
||||
String sql = "select * from hrmschedulesign where userid = "+resourceId+" and signDate='"+curDate+"' order by signTime desc ";
|
||||
recordSet.executeQuery(sql);
|
||||
while (recordSet.next()){
|
||||
String signDate = recordSet.getString("signDate");
|
||||
String signTime = recordSet.getString("signTime");
|
||||
String signDateTime = signDate+" "+signTime;
|
||||
String addr = Util.null2String(recordSet.getString("addr"));
|
||||
Map<String,Object> cardTimelineMap = new HashMap<>();
|
||||
cardTimelineMap.put("date", curDate);
|
||||
cardTimelineMap.put("signTime", signDateTime);
|
||||
cardTimelineMap.put("position", addr);
|
||||
signListLine.add(cardTimelineMap);
|
||||
}
|
||||
return signListLine;
|
||||
}
|
||||
|
||||
/**
|
||||
* 签到签退
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/punchButton")
|
||||
@Produces(MediaType.TEXT_PLAIN)
|
||||
public String punchButton(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
Map<String, Object> retmap = new HashMap<String, Object>();
|
||||
User user = HrmUserVarify.getUser (request , response) ;
|
||||
try{
|
||||
Map<String, Object> params = ParamUtil.request2Map(request);
|
||||
RecordSet rs = new RecordSet();
|
||||
String deviceInfo = Util.null2String(params.get("deviceInfo"));
|
||||
JSONObject jsonObject = null;
|
||||
if(deviceInfo.length() > 0){
|
||||
jsonObject = JSON.parseObject(deviceInfo);
|
||||
JSONObject jsonObject1 = new JSONObject();
|
||||
Set<Entry<String, Object>> jsonSet = jsonObject.entrySet();
|
||||
for(Entry<String, Object> js : jsonSet){
|
||||
String key = js.getKey();
|
||||
String value = Util.null2String(js.getValue());
|
||||
jsonObject1.put(key, value);
|
||||
}
|
||||
if(!jsonObject1.isEmpty()){
|
||||
deviceInfo = jsonObject1.toJSONString();
|
||||
}
|
||||
}
|
||||
|
||||
//手机打卡部分
|
||||
String longitude = Util.null2String(params.get("longitude"));
|
||||
String latitude = Util.null2String(params.get("latitude"));
|
||||
String signData = Util.null2String(params.get("signData"));
|
||||
|
||||
//wifi用的
|
||||
String mac = Util.null2String(params.get("mac"));
|
||||
String sid = Util.null2String(params.get("sid"));
|
||||
String addr = Util.null2String(params.get("position"));
|
||||
String showaddress =addr;
|
||||
String ismobile = Util.null2String(params.get("ismobile"));
|
||||
//区分是来自于钉钉还是EM7
|
||||
String browser = Util.null2String(params.get("browser"));
|
||||
|
||||
DateTimeFormatter fullFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("HH:mm:ss");
|
||||
LocalTime localTime = LocalTime.now();
|
||||
String signTime =localTime.format(dateTimeFormatter);
|
||||
String signDate = LocalDate.now().format(dateFormatter);
|
||||
|
||||
String timeZone = Util.null2String(TimeZoneVar.getTimeZone(),"");
|
||||
//处理多时区
|
||||
String timeZoneConversion = Util.null2String(new weaver.general.BaseBean().getPropValue("weaver_timezone_conversion","timeZoneConversion")).trim();
|
||||
if("1".equals(timeZoneConversion)) {
|
||||
DateTransformer dateTransformer=new DateTransformer();
|
||||
String[] zone_localTime = dateTransformer.getLocaleDateAndTime(signDate,signTime);
|
||||
if(zone_localTime != null && zone_localTime.length == 2){
|
||||
signDate = zone_localTime[0];
|
||||
signTime = zone_localTime[1];
|
||||
}
|
||||
}
|
||||
|
||||
int userId = user.getUID();
|
||||
String userType = user.getLogintype();
|
||||
String clientAddress = Util.getIpAddr(request);
|
||||
String isInCom = "1";
|
||||
|
||||
String datetime_timezone = signDate+" "+signTime;
|
||||
LocalDateTime nowDateTime = LocalDateTime.parse(datetime_timezone,fullFormatter);
|
||||
|
||||
//记录下是来自于E9的pc端签到
|
||||
String signfrom = "e9pc";
|
||||
if("1".equalsIgnoreCase(ismobile)){
|
||||
signfrom = "e9mobile";
|
||||
if("DingTalk".equalsIgnoreCase(browser)){
|
||||
signfrom = "DingTalk";
|
||||
}else if("Wechat".equalsIgnoreCase(browser)){
|
||||
signfrom = "Wechat";
|
||||
String weChat_deviceid = Util.null2String(request.getSession().getAttribute(
|
||||
EMManager.DeviceId));
|
||||
if(weChat_deviceid.length() > 0){
|
||||
//微信打卡的设备号需要单独处理
|
||||
if(jsonObject != null){
|
||||
jsonObject.put("deviceId", weChat_deviceid);
|
||||
}else{
|
||||
jsonObject = new JSONObject();
|
||||
jsonObject.put("deviceId", weChat_deviceid);
|
||||
}
|
||||
if(!jsonObject.isEmpty()){
|
||||
deviceInfo = jsonObject.toJSONString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
deviceInfo = deviceInfo.replaceAll("\\?", "");
|
||||
String signType = "1";
|
||||
String belongdate = signDate;
|
||||
String punchSql = "insert into HrmScheduleSign(userId,userType,signType,signDate,signTime,clientAddress,isInCom,timeZone,belongdate,signfrom,longitude,latitude,addr,deviceInfo,showaddress) "+
|
||||
" values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
|
||||
boolean isOk = rs.executeUpdate(punchSql,userId,userType,signType,signDate,signTime,clientAddress,isInCom,
|
||||
timeZone,belongdate,signfrom,longitude,latitude,addr,deviceInfo,showaddress);
|
||||
log.info(user.getLastname()+":PunchButtonCmd:punchSql:"+punchSql+":isOk:"+isOk);
|
||||
|
||||
retmap.put("status", "1");
|
||||
retmap.put("signdate", signDate);
|
||||
retmap.put("signtime", signTime);
|
||||
}catch (Exception e){
|
||||
retmap.put("status", "-1");
|
||||
retmap.put("message", SystemEnv.getHtmlLabelName(382661,user.getLanguage()));
|
||||
}
|
||||
return JSONObject.toJSONString(retmap);
|
||||
}
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
package com.engine.attendance.vacation.cmd;
|
||||
|
||||
import com.engine.common.biz.AbstractCommonCommand;
|
||||
import com.engine.common.entity.BizLogContext;
|
||||
import com.engine.common.util.DateUtil;
|
||||
import com.engine.common.util.DbTools;
|
||||
import com.engine.core.interceptor.CommandContext;
|
||||
import weaver.general.Util;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class HandleOverdueVocationCmd extends AbstractCommonCommand<Map<String,Object>> {
|
||||
public HandleOverdueVocationCmd(Map<String,Object> params){
|
||||
this.params=params;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BizLogContext getLogContext() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> execute(CommandContext commandContext) {
|
||||
String releaseDate = Util.null2String(params.get("releaseDate"));
|
||||
if ("".equals(releaseDate)){
|
||||
releaseDate = DateUtil.getCurrentDate();
|
||||
}
|
||||
|
||||
String sql = "select jb,jywxcl,yqsc,edkyqcs,yqhedzgxz from uf_jcl_kq_jqed where jywxcl in (0,1)";
|
||||
List<Map<String,Object>> holidayRuleList = DbTools.getSqlToList(sql);
|
||||
Set<String> jbsets = holidayRuleList.stream().map(e->e.get("jb").toString()).collect(Collectors.toSet());
|
||||
sql = "select id,jqid,sxrq,jzrq,yqsxrq from uf_jcl_kq_jqye where yqsxrq<? and jqid in ("+String.join(",",jbsets)+")";
|
||||
List<Map<String,Object>> holidayBalanceList = DbTools.getSqlToList(sql,releaseDate);
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
@ -0,0 +1,84 @@
|
||||
package com.engine.attendance.workflow.cmd;
|
||||
|
||||
import com.engine.attendance.enums.CheckBoxEnum;
|
||||
import com.engine.common.biz.AbstractCommonCommand;
|
||||
import com.engine.common.entity.BizLogContext;
|
||||
import com.engine.common.util.CommonUtil;
|
||||
import com.engine.common.util.DateUtil;
|
||||
import com.engine.common.util.DbTools;
|
||||
import com.engine.common.util.Utils;
|
||||
import com.engine.core.interceptor.CommandContext;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.User;
|
||||
import weaver.hrm.company.SubCompanyComInfo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Slf4j
|
||||
public class GetRestDayIntervalCmd extends AbstractCommonCommand<Map<String, Object>> {
|
||||
|
||||
public GetRestDayIntervalCmd(Map<String, Object> params, User user) {
|
||||
this.user = user;
|
||||
this.params = params;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BizLogContext getLogContext() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> execute(CommandContext commandContext) {
|
||||
Map<String, Object> resultMap = Maps.newHashMap();
|
||||
|
||||
String userId = Util.null2String(params.get("userId"));
|
||||
String startDate = Util.null2String(params.get("startDate"));
|
||||
String endDate = Util.null2String(params.get("endDate"));
|
||||
String modeId = Utils.getFormmodeIdMap().get("uf_jcl_kq_rlmc");
|
||||
Set<String> calendarSetIdsSets = CommonUtil.getDataIds(userId,modeId, DateUtil.getCurrentDate(),DateUtil.getCurrentDate());
|
||||
if (calendarSetIdsSets.size() > 0){
|
||||
String sql = "select rqlx,rq from uf_jcl_kq_rlxx where rlmc=? and rq>=? and rq<=?";
|
||||
List<Map<String,Object>> dataList = DbTools.getSqlToList(sql,calendarSetIdsSets.toArray()[0],startDate,endDate);
|
||||
if (dataList.size() == 0){
|
||||
dataList = getDefaultDateType(userId,startDate,endDate);
|
||||
}
|
||||
resultMap.put("data",dataList);
|
||||
}else {
|
||||
resultMap.put("data",getDefaultDateType(userId,startDate,endDate));
|
||||
}
|
||||
|
||||
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
public List<Map<String,Object>> getDefaultDateType(String userId,String startDate,String endDate){
|
||||
List<Map<String,Object>> resultList = Lists.newArrayList();
|
||||
String sql = "select subcompanyid1 from hrmresource where id =?";
|
||||
Map<String,Object> departMentMap = DbTools.getSqlToMap(sql,userId);
|
||||
String subcompanyid1 = departMentMap.get("subcompanyid1").toString();
|
||||
String parentSubcompanyids = "";
|
||||
try {
|
||||
parentSubcompanyids = new SubCompanyComInfo().getAllParentSubcompanyId(subcompanyid1,parentSubcompanyids);
|
||||
}catch (Exception e){
|
||||
log.error("getDefaultDateType error:[{}]",e);
|
||||
}
|
||||
parentSubcompanyids = subcompanyid1+parentSubcompanyids;
|
||||
sql = "select b.szjg,a.rqlx,a.rq from uf_jcl_kq_rlxx a left join uf_jcl_kq_rlmc b on a.rlmc=b.id where b.mrrl=1 and b.szjg in ("+parentSubcompanyids+") and a.rq>=? and a.rq<=?";
|
||||
List<Map<String,Object>> dataList = DbTools.getSqlToList(sql,startDate,endDate);
|
||||
Map<String,List<Map<String,Object>>> dataGroupByOrganzation = dataList.stream().collect(Collectors.groupingBy(e->e.get("szjg").toString()));
|
||||
for (int i=0;i<parentSubcompanyids.split(",").length;i++){
|
||||
String subId = parentSubcompanyids.split(",")[i];
|
||||
resultList = dataGroupByOrganzation.get(subId);
|
||||
if (resultList != null && resultList.size()>0){
|
||||
break;
|
||||
}
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,37 @@
|
||||
package workflow;
|
||||
|
||||
import com.engine.attendance.vacation.service.VocationService;
|
||||
import com.engine.attendance.vacation.service.impl.VocationServiceImpl;
|
||||
import com.engine.attendance.workflow.service.AskForLeaveService;
|
||||
import com.engine.attendance.workflow.service.impl.AskForLeaveServiceImpl;
|
||||
import com.engine.common.util.CommonUtil;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.common.util.Utils;
|
||||
import com.engine.cube.service.ModeImpExpService;
|
||||
import com.engine.cube.service.impl.ModeImpExpServiceImpl;
|
||||
import com.google.common.collect.Maps;
|
||||
import org.junit.Test;
|
||||
import weaver.hrm.User;
|
||||
import weaver.hrm.company.SubCompanyComInfo;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class Test1 extends beforlog {
|
||||
private ModeImpExpService getService(User user) {
|
||||
return (ModeImpExpService) ServiceUtil.getService(ModeImpExpServiceImpl.class, user);
|
||||
}
|
||||
AskForLeaveService askForLeaveService = ServiceUtil.getService(AskForLeaveServiceImpl.class);
|
||||
@Test
|
||||
public void test1() {
|
||||
Map<String,Object> param = Maps.newHashMap();
|
||||
param.put("itemId","139");
|
||||
param.put("userId","34");
|
||||
param.put("startDate","2024-05-01");
|
||||
param.put("endDate","2024-05-28");
|
||||
Map<String,Object> result = askForLeaveService.getRestDayInterval(param);
|
||||
System.out.println(result);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package vocation;
|
||||
package workflow;
|
||||
|
||||
import org.easymock.EasyMock;
|
||||
import org.junit.After;
|
@ -1,70 +0,0 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
|
||||
<jsp:useBean id="strUtil" class="weaver.common.StringUtil" scope="page" />
|
||||
<jsp:useBean id="dateUtil" class="weaver.common.DateUtil" scope="page" />
|
||||
<jsp:useBean id="RecordSet" class="weaver.conn.RecordSet" scope="page" />
|
||||
<jsp:useBean id="attProcSetManager" class="com.engine.kq.wfset.attendance.manager.HrmAttProcSetManager" scope="page" />
|
||||
<%
|
||||
|
||||
%>
|
||||
|
||||
<script >
|
||||
|
||||
jQuery(document).ready(function(){
|
||||
try{
|
||||
|
||||
|
||||
WfForm.bindDetailFieldChangeEvent(WfForm.convertFieldNameToId("bdkrq", "detail_1"),function(id,rowIndex,value){
|
||||
console.log("WfForm.bindDetailFieldChangeEvent--",id,rowIndex,value);
|
||||
let bdkry = WfForm.getFieldValue(WfForm.convertFieldNameToId('bdkry'));
|
||||
$.ajax({
|
||||
url:'/api/operate/common/queryCommon',
|
||||
data:{
|
||||
action:'query_common',
|
||||
mark:'query_attendance_result',
|
||||
condition:'ygid:'+bdkry+',rq:'+value
|
||||
},
|
||||
type:'GET',
|
||||
dataType:'json',
|
||||
success:function(res){
|
||||
console.log(res)
|
||||
if(res.data.data.length > 0){
|
||||
let data = res.data.data[0]
|
||||
//班次信息
|
||||
WfForm.changeFieldValue(WfForm.convertFieldNameToId("bcbdxx", "detail_1")+"_"+rowIndex, {value:data.bcbdxx});
|
||||
//出勤结果
|
||||
WfForm.changeFieldValue(WfForm.convertFieldNameToId("cqjg", "detail_1")+"_"+rowIndex, {value:data.cqzt});
|
||||
|
||||
let dkxx='';
|
||||
for(let i=1;i<9;i++){
|
||||
let j = "j"+i;
|
||||
let c = "c"+i;
|
||||
let jvalue="";
|
||||
let cvalue="";
|
||||
for (let key in data){
|
||||
if(key == j){
|
||||
jvalue = data[key];
|
||||
}else if (key == c){
|
||||
cvalue = data[key];
|
||||
}
|
||||
}
|
||||
if (jvalue != "" || cvalue != ""){
|
||||
dkxx = dkxx +jvalue+"-"+cvalue+",";
|
||||
}
|
||||
}
|
||||
if (dkxx.length >0){
|
||||
dkxx.substring(0,dkxx.length-1);
|
||||
}
|
||||
//打卡信息
|
||||
WfForm.changeFieldValue(WfForm.convertFieldNameToId("dkxx", "detail_1")+"_"+rowIndex, {value:dkxx});
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
}catch (e) {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
</script>
|
Loading…
Reference in New Issue