生产代码

dev
zhangming 1 year ago
parent 5015d873d6
commit e445596114

@ -185,18 +185,18 @@ public class ExportDailyExcelCmd extends AbstractCommonCommand<Map<String, Objec
}else { }else {
forgotBeginWorkCheck_field = " isnull(b.forgotBeginWorkCheck,0) "; forgotBeginWorkCheck_field = " isnull(b.forgotBeginWorkCheck,0) ";
} }
String backFields = " zm.cccb as mealAllowance," +
String backFields = " (select zm.cccb from uf_cbxxjlb zm where zm.xm = a.id and zm.rq = b.kqdate) as mealAllowance," + " zm.zdcb as statAllowance," +
" (select zm.zdcb from uf_cbxxjlb zm where zm.xm = a.id and zm.rq = b.kqdate) as statAllowance," + " zm.jmybcb as nightAllowance," +
" (select zm.jmybcb from uf_cbxxjlb zm where zm.xm = a.id and zm.rq = b.kqdate) as nightAllowance," + " zm.hrzdcb as otherStatAllowance," +
" (select zm.hrzdcb from uf_cbxxjlb zm where zm.xm = a.id and zm.rq = b.kqdate) as otherStatAllowance," + " zm.ybbz as nightShiftSubsidy, "+
" (select zm.ybbz from uf_cbxxjlb zm where zm.xm = a.id and zm.rq = b.kqdate) as nightShiftSubsidy," +
" a.id,a.lastname,a.subcompanyid1 as subcompanyid,a.departmentid, a.workcode,b.jobtitle,a.dsporder," + " a.id,a.lastname,a.subcompanyid1 as subcompanyid,a.departmentid, a.workcode,b.jobtitle,a.dsporder," +
" b.kqdate, b.workdays,b.workMins,b.serialid, b.attendancedays,FLOOR( b.attendanceMins / 30 ) * 30 AS attendanceMins ,b.beLate," + " b.kqdate, b.workdays,b.workMins,b.serialid, b.attendancedays,FLOOR( b.attendanceMins / 30 ) * 30 AS attendanceMins ,b.beLate," +
" b.beLateMins,b.graveBeLate,b.graveBeLateMins,b.leaveEearly,b.leaveEarlyMins,b.graveLeaveEarly," + " b.beLateMins,b.graveBeLate,b.graveBeLateMins,b.leaveEearly,b.leaveEarlyMins,b.graveLeaveEarly," +
" b.graveLeaveEarlyMins,b.absenteeism,b.signdays,b.signmins, "+ " b.graveLeaveEarlyMins,b.absenteeism,b.signdays,b.signmins, "+
" b.absenteeismMins ,(b.forgotCheck+"+forgotBeginWorkCheck_field+") forgotCheck,zeropoint "; " b.absenteeismMins ,(b.forgotCheck+"+forgotBeginWorkCheck_field+") forgotCheck,zeropoint ";
String sqlFrom = " from hrmresource a, kq_format_total b where a.id= b.resourceid and b.kqdate >='"+fromDate+"' and b.kqdate <='"+toDate+"'"; String sqlFrom = " from hrmresource a, kq_format_total b,uf_cbxxjlb zm " +
"where a.id= b.resourceid and b.kqdate >='"+fromDate+"' and b.kqdate <='"+toDate+"' and zm.xm=a.id and zm.rq = b.kqdate ";
String sqlWhere = rightSql; String sqlWhere = rightSql;
if(subCompanyId.length()>0){ if(subCompanyId.length()>0){
sqlWhere +=" and a.subcompanyid1 in("+subCompanyId+") "; sqlWhere +=" and a.subcompanyid1 in("+subCompanyId+") ";
@ -435,7 +435,7 @@ public class ExportDailyExcelCmd extends AbstractCommonCommand<Map<String, Objec
double holidayOvertime_nonleave = Util.getDoubleValue(Util.null2String(flowData.get(id+"|"+kqdate+"|holidayOvertime_nonleave"))); double holidayOvertime_nonleave = Util.getDoubleValue(Util.null2String(flowData.get(id+"|"+kqdate+"|holidayOvertime_nonleave")));
holidayOvertime_nonleave = holidayOvertime_nonleave<0?0:holidayOvertime_nonleave; holidayOvertime_nonleave = holidayOvertime_nonleave<0?0:holidayOvertime_nonleave;
fieldValue = KQDurationCalculatorUtil.getDurationRound(String.valueOf(workingDayOvertime_4leave+restDayOvertime_4leave+holidayOvertime_4leave+ fieldValue = KQDurationCalculatorUtil.getDurationRound(String.valueOf(workingDayOvertime_4leave+restDayOvertime_4leave+holidayOvertime_4leave+
workingDayOvertime_nonleave+restDayOvertime_nonleave+holidayOvertime_nonleave)); workingDayOvertime_nonleave+restDayOvertime_nonleave+holidayOvertime_nonleave));
data.add(getFieldValueByUnitType(fieldValue,kqReportFieldComInfo.getUnittype(KQReportFieldComInfo.field2Id.get("overtimeTotal")))); data.add(getFieldValueByUnitType(fieldValue,kqReportFieldComInfo.getUnittype(KQReportFieldComInfo.field2Id.get("overtimeTotal"))));
continue; continue;
}else if(fieldName.equals("businessLeave") || fieldName.equals("officialBusiness")){ }else if(fieldName.equals("businessLeave") || fieldName.equals("officialBusiness")){

@ -11,14 +11,18 @@ import weaver.interfaces.workflow.action.Action;
import weaver.soa.workflow.request.Property; import weaver.soa.workflow.request.Property;
import weaver.soa.workflow.request.RequestInfo; import weaver.soa.workflow.request.RequestInfo;
import java.util.*; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class OutSignSyncAction implements Action { public class OutSignSyncAction implements Action {
BaseBean bb = new BaseBean(); BaseBean bb = new BaseBean();
@Override @Override
public String execute(RequestInfo requestInfo) { public String execute(RequestInfo requestInfo) {
bb.writeLog("OutSignSyncAction-start");
String startDate = ""; String startDate = "";
String endDate = ""; String endDate = "";
String resourceid = ""; String resourceid = "";
@ -61,7 +65,7 @@ public class OutSignSyncAction implements Action {
"from mobile_sign a " + "from mobile_sign a " +
"left join uf_outsigntype c " + "left join uf_outsigntype c " +
"on c.outsignid = a.id " + "on c.outsignid = a.id " +
"where operate_date > '" + startDate + "' and operate_date < '" + endDate + "' and operate in (?) "; "where operate_date > '" + startDate + "' and operate_date < '" + endDate + "' and operater in (?) ";
rs.executeQuery(acqOutSignSql, resourceid); rs.executeQuery(acqOutSignSql, resourceid);
while (rs.next()) { while (rs.next()) {
String signinfo = Util.null2String(rs.getString("signinfo")); String signinfo = Util.null2String(rs.getString("signinfo"));
@ -69,7 +73,7 @@ public class OutSignSyncAction implements Action {
} }
for (String inf : infos) { for (String inf : infos) {
if (inf != null ) { if (inf != null) {
Map<String, Object> in = mapStringToMap(inf); Map<String, Object> in = mapStringToMap(inf);
String userId = Util.null2String(in.get("userId")); String userId = Util.null2String(in.get("userId"));
String userType = Util.null2String(in.get("userType")); String userType = Util.null2String(in.get("userType"));
@ -87,25 +91,25 @@ public class OutSignSyncAction implements Action {
String deviceInfo = Util.null2String(in.get("deviceInfo")); String deviceInfo = Util.null2String(in.get("deviceInfo"));
String belongdateIsNull = Util.null2String(in.get("belongdateIsNull")); String belongdateIsNull = Util.null2String(in.get("belongdateIsNull"));
String punchSql = "insert into HrmScheduleSign(userId,userType,signType,signDate,signTime,clientAddress,isInCom,timeZone,belongdate,signfrom,longitude,latitude,addr,deviceInfo,isdev) "+ String punchSql = "insert into HrmScheduleSign(userId,userType,signType,signDate,signTime,clientAddress,isInCom,timeZone,belongdate,signfrom,longitude,latitude,addr,deviceInfo,isdev) " +
" values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; " values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
boolean isok = rs.executeUpdate(punchSql,resourceid,userType,signType,signDate,signTime,clientAddress,isInCom, boolean isok = rs.executeUpdate(punchSql, resourceid, userType, signType, signDate, signTime, clientAddress, isInCom,
timeZone,belongdate,signfrom,longitude,latitude,address,deviceInfo,"1"); timeZone, belongdate, signfrom, longitude, latitude, address, deviceInfo, "1");
bb.writeLog("isok: " + isok); bb.writeLog("isok: " + isok);
//同步更新考勤数据到考勤报表 //同步更新考勤数据到考勤报表
if("true".equals(belongdateIsNull)){ if ("true".equals(belongdateIsNull)) {
//外勤签到没有归属日期,遇到跨天班次打卡可能归属前一天,需要格式化前一天考勤 //外勤签到没有归属日期,遇到跨天班次打卡可能归属前一天,需要格式化前一天考勤
bb.writeLog("PunchOutButtonCmd:userId:"+userId+":belongdate:"+ DateUtil.getYesterday()); bb.writeLog("PunchOutButtonCmd:userId:" + userId + ":belongdate:" + DateUtil.getYesterday());
new KQFormatBiz().formatDate(""+userId,DateUtil.getYesterday()); new KQFormatBiz().formatDate("" + userId, DateUtil.getYesterday());
} }
bb.writeLog("PunchOutButtonCmd:userId:"+userId+":belongdate:"+(belongdate.length() == 0 ? DateUtil.getCurrentDate() : belongdate)); bb.writeLog("PunchOutButtonCmd:userId:" + userId + ":belongdate:" + (belongdate.length() == 0 ? DateUtil.getCurrentDate() : belongdate));
if(belongdate.length()==0){ if (belongdate.length() == 0) {
//外勤签到没有归属日期,遇到跨天班次打卡可能归属前一天,需要格式化前一天考勤 //外勤签到没有归属日期,遇到跨天班次打卡可能归属前一天,需要格式化前一天考勤
new KQFormatBiz().formatDate(""+userId,DateUtil.getYesterday()); new KQFormatBiz().formatDate("" + userId, DateUtil.getYesterday());
} }
new KQFormatBiz().formatDate(""+userId,(belongdate.length() == 0 ? DateUtil.getCurrentDate() : belongdate)); new KQFormatBiz().formatDate("" + userId, (belongdate.length() == 0 ? DateUtil.getCurrentDate() : belongdate));
//外勤签到转的考勤 处理加班规则 //外勤签到转的考勤 处理加班规则
SplitActionUtil.pushOverTimeTasksAll(belongdate,belongdate,""+userId); SplitActionUtil.pushOverTimeTasksAll(belongdate, belongdate, "" + userId);
} }
} }
@ -118,10 +122,10 @@ public class OutSignSyncAction implements Action {
return Action.SUCCESS; return Action.SUCCESS;
} }
public static Map<String,Object> mapStringToMap(String str){ public static Map<String, Object> mapStringToMap(String str) {
str = str.substring(1, str.length()-1); str = str.substring(1, str.length() - 1);
String[] strs = str.split(","); String[] strs = str.split(",");
Map<String,Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
for (String string : strs) { for (String string : strs) {
String key = string.split("=")[0]; String key = string.split("=")[0];
String value = string.split("=")[1]; String value = string.split("=")[1];

Loading…
Cancel
Save