源码申请
This commit is contained in:
commit
5f988d3099
|
|
@ -0,0 +1,46 @@
|
|||
package com.engine.kq.bean;
|
||||
|
||||
/**
|
||||
* 排班制考勤组----排班设置权限(数据存储在建模表中)
|
||||
*/
|
||||
public class KQChildrenBean {
|
||||
private String id;
|
||||
|
||||
private String birthday;
|
||||
|
||||
private String title;
|
||||
|
||||
private String resourceid;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getBirthday() {
|
||||
return birthday;
|
||||
}
|
||||
|
||||
public void setBirthday(String birthday) {
|
||||
this.birthday = birthday;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getResourceid() {
|
||||
return resourceid;
|
||||
}
|
||||
|
||||
public void setResourceid(String resourceid) {
|
||||
this.resourceid = resourceid;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,81 @@
|
|||
package com.engine.kq.biz;
|
||||
|
||||
import weaver.cache.CacheBase;
|
||||
import weaver.cache.CacheColumn;
|
||||
import weaver.cache.CacheColumnType;
|
||||
import weaver.cache.PKColumn;
|
||||
|
||||
/**
|
||||
* 假期规则缓存类
|
||||
*/
|
||||
public class KQChildrenComInfo extends CacheBase {
|
||||
|
||||
/**
|
||||
* 数据来源
|
||||
*/
|
||||
protected static String TABLE_NAME = "hrmfamilyinfo";
|
||||
/**
|
||||
* sql中的where信息,不要以where开始
|
||||
*/
|
||||
protected static String TABLE_WHERE = " WhetherChildren=1 ";
|
||||
/**
|
||||
* sql中的order by信息,不要以order by开始
|
||||
*/
|
||||
protected static String TABLE_ORDER = " id ";
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@PKColumn(type = CacheColumnType.NUMBER)
|
||||
protected static String PK_NAME = "id";
|
||||
|
||||
/**
|
||||
* 出生日期
|
||||
*/
|
||||
@CacheColumn(name = "birthday")
|
||||
protected static int birthday;
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
@CacheColumn(name = "member")
|
||||
protected static int member;
|
||||
/**
|
||||
* 家长id
|
||||
*/
|
||||
@CacheColumn(name = "resourceid")
|
||||
protected static int resourceid;
|
||||
|
||||
|
||||
public String getId(){
|
||||
return (String)getRowValue(PK_INDEX);
|
||||
}
|
||||
|
||||
public String getChildrenName() {
|
||||
return (String)getRowValue(member);
|
||||
}
|
||||
|
||||
public String getChildrenName(String key){
|
||||
return (String) getValue(member,key);
|
||||
}
|
||||
|
||||
public String getBirthday() {
|
||||
return (String)getRowValue(birthday);
|
||||
}
|
||||
|
||||
public String getBirthday(String key){
|
||||
return (String) getValue(birthday,key);
|
||||
}
|
||||
|
||||
public String getResourceid() {
|
||||
return (String)getRowValue(resourceid);
|
||||
}
|
||||
|
||||
public String getResourceid(String key){
|
||||
return (String) getValue(resourceid,key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeCache() {
|
||||
super.removeCache();
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,319 @@
|
|||
package com.engine.kq.biz;
|
||||
|
||||
import com.engine.kq.wfset.util.KQAttFlowCheckUtil;
|
||||
import weaver.cache.CacheBase;
|
||||
import weaver.cache.CacheColumn;
|
||||
import weaver.cache.CacheColumnType;
|
||||
import weaver.cache.PKColumn;
|
||||
import weaver.general.Util;
|
||||
import weaver.systeminfo.SystemEnv;
|
||||
|
||||
/**
|
||||
* 假期规则缓存类
|
||||
*/
|
||||
public class KQLeaveRulesComInfo extends CacheBase {
|
||||
|
||||
/**
|
||||
* 数据来源
|
||||
*/
|
||||
protected static String TABLE_NAME = "kq_leaveRules";
|
||||
/**
|
||||
* sql中的where信息,不要以where开始
|
||||
*/
|
||||
protected static String TABLE_WHERE = " (isDelete is null or isDelete !=1) ";
|
||||
/**
|
||||
* sql中的order by信息,不要以order by开始
|
||||
*/
|
||||
protected static String TABLE_ORDER = " showOrder,id ";
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@PKColumn(type = CacheColumnType.NUMBER)
|
||||
protected static String PK_NAME = "id";
|
||||
|
||||
/**
|
||||
* 假期规则名称
|
||||
*/
|
||||
@CacheColumn(name = "leaveName")
|
||||
protected static int leaveName;
|
||||
|
||||
@CacheColumn(name = "SchevacationON")
|
||||
protected static int SchevacationON;
|
||||
|
||||
@CacheColumn(name = "Schevacation")
|
||||
protected static int Schevacation;
|
||||
|
||||
/**
|
||||
* 是否禁用:0-未禁用、1-已禁用
|
||||
*/
|
||||
@CacheColumn(name = "isEnable")
|
||||
protected static int isEnable;
|
||||
|
||||
/**
|
||||
* 应用范围:0-总部、1-分部
|
||||
*/
|
||||
@CacheColumn(name = "scopeType")
|
||||
protected static int scopeType;
|
||||
|
||||
/**
|
||||
* 分部ID(当应用范围为分部时选择的分部ID)
|
||||
*/
|
||||
@CacheColumn(name = "scopeValue")
|
||||
protected static int scopeValue;
|
||||
|
||||
/**
|
||||
* 最小请假单位
|
||||
* 1-按天请假
|
||||
* 2-按半天请假
|
||||
* 3-按小时请假
|
||||
* 4-按整天请假
|
||||
* 其他:无效数据
|
||||
*/
|
||||
@CacheColumn(name = "minimumUnit")
|
||||
protected static int minimumUnit;
|
||||
|
||||
/**
|
||||
* 余额单位变更时的换算比例
|
||||
* XX小时=1天
|
||||
*/
|
||||
@CacheColumn(name = "proportion")
|
||||
protected static int proportion;
|
||||
|
||||
/**
|
||||
* 日折算时长(1天=XX小时)
|
||||
*/
|
||||
@CacheColumn(name = "hoursToDay")
|
||||
protected static int hoursToDay;
|
||||
|
||||
/**
|
||||
* 按自然日计算请假时长,0-不排除,1-排除节假日,2-排除休息日,3-排除节假日和休息日
|
||||
*/
|
||||
@CacheColumn(name = "filterHolidays")
|
||||
protected static int filterHolidays;
|
||||
|
||||
/**
|
||||
* 计算请假时长方式:
|
||||
* 1-按工作日计算请假时长
|
||||
* 2-按自然日计算请假时长
|
||||
*/
|
||||
@CacheColumn(name = "computingMode")
|
||||
protected static int computingMode;
|
||||
|
||||
/**
|
||||
* 启用假期余额:
|
||||
* 0-不启用
|
||||
* 1-启用
|
||||
*/
|
||||
@CacheColumn(name = "balanceEnable")
|
||||
protected static int balanceEnable;
|
||||
|
||||
/**
|
||||
* 假期类型标识
|
||||
*/
|
||||
@CacheColumn(name = "leaveCode")
|
||||
protected static int leaveCode;
|
||||
|
||||
/**
|
||||
* 半天单位 时间选择方式:1-下拉框选择 、2-具体时间
|
||||
*/
|
||||
@CacheColumn(name = "timeselection")
|
||||
protected static int timeselection;
|
||||
|
||||
/**
|
||||
* 折算方式 1是四舍五入 2是向上取整 3是向下取整
|
||||
*/
|
||||
@CacheColumn(name = "conversion")
|
||||
protected static int conversion;
|
||||
|
||||
/**
|
||||
* 流程重复时段 1是重复 0是不重复,默认不重复
|
||||
*/
|
||||
@CacheColumn(name = "repeat_time")
|
||||
protected static int repeatTime;
|
||||
|
||||
public String getId(){
|
||||
return (String)getRowValue(PK_INDEX);
|
||||
}
|
||||
|
||||
public String getLeaveName() {
|
||||
return (String)getRowValue(leaveName);
|
||||
}
|
||||
|
||||
public String getLeaveName(String key){
|
||||
return (String) getValue(leaveName,key);
|
||||
}
|
||||
|
||||
public String getSchevacationON() {
|
||||
return (String)getRowValue(SchevacationON);
|
||||
}
|
||||
|
||||
public String getSchevacationON(String key){
|
||||
return (String) getValue(SchevacationON,key);
|
||||
}
|
||||
|
||||
public String getSchevacation() {
|
||||
return (String)getRowValue(Schevacation);
|
||||
}
|
||||
|
||||
public String getSchevacation(String key){
|
||||
return (String) getValue(Schevacation,key);
|
||||
}
|
||||
|
||||
public String getIsEnable() {
|
||||
return (String)getRowValue(isEnable);
|
||||
}
|
||||
|
||||
public String getIsEnable(String key){
|
||||
return (String) getValue(isEnable,key);
|
||||
}
|
||||
|
||||
public String getScopeType() {
|
||||
return (String)getRowValue(scopeType);
|
||||
}
|
||||
|
||||
public String getScopeType(String key){
|
||||
return (String) getValue(scopeType,key);
|
||||
}
|
||||
|
||||
public String getScopeValue() {
|
||||
return (String)getRowValue(scopeValue);
|
||||
}
|
||||
|
||||
public String getScopeValue(String key){
|
||||
return (String) getValue(scopeValue,key);
|
||||
}
|
||||
|
||||
public String getMinimumUnit() {
|
||||
return (String)getRowValue(minimumUnit);
|
||||
}
|
||||
|
||||
public String getMinimumUnit(String key){
|
||||
return (String)getValue(minimumUnit,key);
|
||||
}
|
||||
|
||||
public String getProportion() {
|
||||
return (String)getRowValue(proportion);
|
||||
}
|
||||
|
||||
public String getProportion(String key){
|
||||
return (String)getValue(proportion,key);
|
||||
}
|
||||
|
||||
public String getHoursToDay() {
|
||||
return (String)getRowValue(hoursToDay);
|
||||
}
|
||||
|
||||
public String getHoursToDay(String key){
|
||||
return (String)getValue(hoursToDay,key);
|
||||
}
|
||||
public String getFilterHolidays() {
|
||||
return (String)getRowValue(filterHolidays);
|
||||
}
|
||||
|
||||
public String getFilterHolidays(String key){
|
||||
return (String)getValue(filterHolidays,key);
|
||||
}
|
||||
|
||||
public String getComputingMode() {
|
||||
return (String)getRowValue(computingMode);
|
||||
}
|
||||
|
||||
public String getComputingMode(String key){
|
||||
return (String)getValue(computingMode,key);
|
||||
}
|
||||
|
||||
public String getBalanceEnable() {
|
||||
return (String)getRowValue(balanceEnable);
|
||||
}
|
||||
|
||||
public String getBalanceEnable(String key){
|
||||
return (String)getValue(balanceEnable,key);
|
||||
}
|
||||
|
||||
public String getLeaveCode() {
|
||||
return (String)getRowValue(leaveCode);
|
||||
}
|
||||
|
||||
public String getLeaveCode(String key){
|
||||
return (String)getValue(leaveCode,key);
|
||||
}
|
||||
|
||||
public String getTimeSelection() {
|
||||
String value = (String) getRowValue(timeselection);
|
||||
if (value == null || value.equals("")) {
|
||||
value = "1";
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getTimeSelection(String key) {
|
||||
String value = (String) getValue(timeselection, key);
|
||||
if (value == null || value.equals("")) {
|
||||
value = "1";
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getConversion() {
|
||||
return (String)getRowValue(conversion);
|
||||
}
|
||||
|
||||
public String getConversion(String key){
|
||||
return (String)getValue(conversion,key);
|
||||
}
|
||||
|
||||
public String getRepeatTime() {
|
||||
return (String)getRowValue(repeatTime);
|
||||
}
|
||||
|
||||
public String getRepeatTime(String key){
|
||||
return (String)getValue(repeatTime,key);
|
||||
}
|
||||
|
||||
public String getUnitName(int language){
|
||||
String unitName = "";//单位名称,天/小时
|
||||
int minimumUnit = Util.getIntValue(getMinimumUnit(),1);
|
||||
if (minimumUnit == 1 || minimumUnit == 2 || minimumUnit == 4) {
|
||||
unitName = SystemEnv.getHtmlLabelName(389325, language);//(天)
|
||||
} else {
|
||||
unitName = SystemEnv.getHtmlLabelName(389326, language);//(小时)
|
||||
}
|
||||
return unitName;
|
||||
}
|
||||
|
||||
public String getUnitName(String key,int language){
|
||||
String unitName = "";//单位名称,天/小时
|
||||
int minimumUnit = Util.getIntValue(getMinimumUnit(key),1);
|
||||
if (minimumUnit == 1 || minimumUnit == 2 || minimumUnit == 4) {
|
||||
unitName = SystemEnv.getHtmlLabelName(389325, language);//(天)
|
||||
} else {
|
||||
unitName = SystemEnv.getHtmlLabelName(389326, language);//(小时)
|
||||
}
|
||||
|
||||
// KQTransMethod method = new KQTransMethod();
|
||||
// unitName = "("+method.getMinimumUnitName4Browser(""+minimumUnit, ""+language)+")";
|
||||
return unitName;
|
||||
}
|
||||
|
||||
public String getUnitNameNew(String key,int language){
|
||||
String unitName = "";//单位名称,天/小时
|
||||
int minimumUnit = Util.getIntValue(getMinimumUnit(key),1);
|
||||
if (minimumUnit == 1 || minimumUnit == 2 || minimumUnit == 4) {
|
||||
unitName = SystemEnv.getHtmlLabelName(389325, language);//(天)
|
||||
} else {
|
||||
unitName = SystemEnv.getHtmlLabelName(389326, language);//(小时)
|
||||
}
|
||||
return unitName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void removeCache() {
|
||||
super.removeCache();
|
||||
KQAttFlowCheckUtil kqAttFlowCheckUtil = new KQAttFlowCheckUtil();
|
||||
kqAttFlowCheckUtil.initLeaveUnit();
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,234 @@
|
|||
package com.engine.kq.entity;
|
||||
|
||||
/**
|
||||
* 假期余额
|
||||
*/
|
||||
public class KQBalanceOfLeaveEntity {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
int id;
|
||||
/**
|
||||
* 假期规则ID
|
||||
*/
|
||||
int leaveRulesId;
|
||||
/**
|
||||
* 人员ID
|
||||
*/
|
||||
int resourceId;
|
||||
/**
|
||||
* 所属年份
|
||||
* 数据格式:yyyy
|
||||
*/
|
||||
String belongYear;
|
||||
/**
|
||||
* 假期余额基数
|
||||
* 混合模式下为法定年假的基数
|
||||
*/
|
||||
double baseAmount = 0.00;
|
||||
/**
|
||||
* 已用的假期余额
|
||||
* 混合模式下为已用的法定年假的数量
|
||||
*/
|
||||
double usedAmount = 0.00;
|
||||
/**
|
||||
* 额外的假期余额
|
||||
* 混合模式下为额外的法定年假的数量
|
||||
*/
|
||||
double extraAmount = 0.00;
|
||||
/**
|
||||
* 仅用于混合模式下的福利年假的基数
|
||||
*/
|
||||
double baseAmount2 = 0.00;
|
||||
/**
|
||||
* 仅用于混合模式下的已用的福利年假的数量
|
||||
*/
|
||||
double usedAmount2 = 0.00;
|
||||
/**
|
||||
* 仅用于混合模式下的额外的福利年假的数量
|
||||
*/
|
||||
double extraAmount2 = 0.00;
|
||||
/**
|
||||
* 是有有效:0-有效、1-无效
|
||||
*/
|
||||
int status;
|
||||
/**
|
||||
* 失效日期
|
||||
*/
|
||||
String expirationDate;
|
||||
/**
|
||||
* 生效日期
|
||||
*/
|
||||
String effectiveDate;
|
||||
/**
|
||||
* 最小请假单位
|
||||
*/
|
||||
int minimumUnit;
|
||||
|
||||
public KQBalanceOfLeaveEntity() {
|
||||
}
|
||||
|
||||
public KQBalanceOfLeaveEntity(int id, int leaveRulesId, int resourceId, String belongYear, double baseAmount, double usedAmount, double extraAmount, double baseAmount2, double usedAmount2, double extraAmount2, int status, String expirationDate) {
|
||||
this.id = id;
|
||||
this.leaveRulesId = leaveRulesId;
|
||||
this.resourceId = resourceId;
|
||||
this.belongYear = belongYear;
|
||||
this.baseAmount = baseAmount;
|
||||
this.usedAmount = usedAmount;
|
||||
this.extraAmount = extraAmount;
|
||||
this.baseAmount2 = baseAmount2;
|
||||
this.usedAmount2 = usedAmount2;
|
||||
this.extraAmount2 = extraAmount2;
|
||||
this.status = status;
|
||||
this.expirationDate = expirationDate;
|
||||
}
|
||||
public KQBalanceOfLeaveEntity(int id, int leaveRulesId, int resourceId, String belongYear, double baseAmount, double usedAmount, double extraAmount, double baseAmount2, double usedAmount2, double extraAmount2, int status, String expirationDate ,String effectiveDate) {
|
||||
this.id = id;
|
||||
this.leaveRulesId = leaveRulesId;
|
||||
this.resourceId = resourceId;
|
||||
this.belongYear = belongYear;
|
||||
this.baseAmount = baseAmount;
|
||||
this.usedAmount = usedAmount;
|
||||
this.extraAmount = extraAmount;
|
||||
this.baseAmount2 = baseAmount2;
|
||||
this.usedAmount2 = usedAmount2;
|
||||
this.extraAmount2 = extraAmount2;
|
||||
this.status = status;
|
||||
this.expirationDate = expirationDate;
|
||||
this.effectiveDate = effectiveDate;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getLeaveRulesId() {
|
||||
return leaveRulesId;
|
||||
}
|
||||
|
||||
public void setLeaveRulesId(int leaveRulesId) {
|
||||
this.leaveRulesId = leaveRulesId;
|
||||
}
|
||||
|
||||
public int getResourceId() {
|
||||
return resourceId;
|
||||
}
|
||||
|
||||
public void setResourceId(int resourceId) {
|
||||
this.resourceId = resourceId;
|
||||
}
|
||||
|
||||
public String getBelongYear() {
|
||||
return belongYear;
|
||||
}
|
||||
|
||||
public void setBelongYear(String belongYear) {
|
||||
this.belongYear = belongYear;
|
||||
}
|
||||
|
||||
public double getBaseAmount() {
|
||||
return baseAmount;
|
||||
}
|
||||
|
||||
public void setBaseAmount(double baseAmount) {
|
||||
this.baseAmount = baseAmount;
|
||||
}
|
||||
|
||||
public double getUsedAmount() {
|
||||
return usedAmount;
|
||||
}
|
||||
|
||||
public void setUsedAmount(double usedAmount) {
|
||||
this.usedAmount = usedAmount;
|
||||
}
|
||||
|
||||
public double getExtraAmount() {
|
||||
return extraAmount;
|
||||
}
|
||||
|
||||
public void setExtraAmount(double extraAmount) {
|
||||
this.extraAmount = extraAmount;
|
||||
}
|
||||
|
||||
public double getBaseAmount2() {
|
||||
return baseAmount2;
|
||||
}
|
||||
|
||||
public void setBaseAmount2(double baseAmount2) {
|
||||
this.baseAmount2 = baseAmount2;
|
||||
}
|
||||
|
||||
public double getUsedAmount2() {
|
||||
return usedAmount2;
|
||||
}
|
||||
|
||||
public void setUsedAmount2(double usedAmount2) {
|
||||
this.usedAmount2 = usedAmount2;
|
||||
}
|
||||
|
||||
public double getExtraAmount2() {
|
||||
return extraAmount2;
|
||||
}
|
||||
|
||||
public void setExtraAmount2(double extraAmount2) {
|
||||
this.extraAmount2 = extraAmount2;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getExpirationDate() {
|
||||
return expirationDate;
|
||||
}
|
||||
|
||||
public void setExpirationDate(String expirationDate) {
|
||||
this.expirationDate = expirationDate;
|
||||
}
|
||||
|
||||
public String getEffectiveDate() {
|
||||
return effectiveDate;
|
||||
}
|
||||
|
||||
public void setEffectiveDate(String effectiveDate) {
|
||||
this.effectiveDate = effectiveDate;
|
||||
}
|
||||
|
||||
public int getMinimumUnit() {
|
||||
return minimumUnit;
|
||||
}
|
||||
|
||||
public void setMinimumUnit(int minimumUnit) {
|
||||
this.minimumUnit = minimumUnit;
|
||||
}
|
||||
|
||||
public boolean equals(KQBalanceOfLeaveEntity entity) {
|
||||
if (this.baseAmount != entity.getBaseAmount()
|
||||
|| this.extraAmount != entity.getExtraAmount()
|
||||
|| this.usedAmount != entity.getUsedAmount()
|
||||
|| this.baseAmount2 != entity.getBaseAmount2()
|
||||
|| this.extraAmount2 != entity.getExtraAmount2()
|
||||
|| this.usedAmount2 != entity.getUsedAmount2()) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean equalsByBaseAmount(KQBalanceOfLeaveEntity entity) {
|
||||
if (this.baseAmount != entity.getBaseAmount()
|
||||
|| this.baseAmount2 != entity.getBaseAmount2()) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package com.engine.kq.jucailin.util;
|
||||
|
||||
import java.sql.Date;
|
||||
import java.sql.Timestamp;
|
||||
|
||||
public class KQDateUtil {
|
||||
|
||||
public static Date getUpdateDate(){
|
||||
Long now = System.currentTimeMillis();
|
||||
Date date = new Date(now);
|
||||
return date;
|
||||
}
|
||||
|
||||
public static Timestamp getUpdateTimeStamp(){
|
||||
Long now = System.currentTimeMillis();
|
||||
Timestamp timestamp = new Timestamp(now);
|
||||
return timestamp;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
package weaver.interfaces.zhuyou.action;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.general.BaseBean;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Title ecology-9
|
||||
* @Company 泛微软件
|
||||
* @CreateDate 2025/4/28
|
||||
* @Description action处理调用方法
|
||||
* @Author Lee
|
||||
*/
|
||||
public class ActionHandle {
|
||||
|
||||
public static void autoSchedule(String userId, String companyId, String effectiveDate, String kqGroupId, String kqType) {
|
||||
BaseBean bb = new BaseBean();
|
||||
try {
|
||||
RecordSet rs = new RecordSet();
|
||||
//查询考勤组成员表,无数据则新增
|
||||
String sql = "select id from kq_groupmember where type=1 and typevalue=? and groupid=?";
|
||||
rs.executeQuery(sql, userId, kqGroupId);
|
||||
if (rs.getCounts() > 0) {
|
||||
//do nothing
|
||||
} else {
|
||||
sql = "insert into kq_groupmember (type, typevalue, groupid, validatefrom, validateto) values (?,?,?,?,?)";
|
||||
rs.executeUpdate(sql, 1, userId, kqGroupId, effectiveDate, "2999-12-31");
|
||||
}
|
||||
//每日班次查询
|
||||
ArrayList<List> lists = new ArrayList<>();
|
||||
sql = "select rq,zb from uf_gznl where rzgs=? and bb=? and rq>=? order by rq asc";
|
||||
rs.executeQuery(sql, companyId, kqType, effectiveDate);
|
||||
while (rs.next()) {
|
||||
String rq = rs.getString("rq");
|
||||
String zb = rs.getString("zb");
|
||||
ArrayList<String> list = new ArrayList<>();
|
||||
list.add(rq);
|
||||
list.add(zb);
|
||||
list.add(userId);
|
||||
list.add(kqGroupId);
|
||||
lists.add(list);
|
||||
}
|
||||
if (lists.size() > 0) {
|
||||
sql = "delete from kq_shiftschedule where resourceid=? and kqdate>=?";
|
||||
rs.executeUpdate(sql, userId, effectiveDate);
|
||||
String insertSql = "insert into kq_shiftschedule (kqdate,serialid,resourceid,groupid)values(?,?,?,?)";
|
||||
rs.executeBatchSql(insertSql, lists);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
bb.writeLog("autoSchedule-e-" + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
package weaver.interfaces.zhuyou.action;
|
||||
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.general.BaseBean;
|
||||
import weaver.general.ThreadPoolUtil;
|
||||
import weaver.interfaces.workflow.action.Action;
|
||||
import weaver.soa.workflow.request.RequestInfo;
|
||||
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Title ecology-9
|
||||
* @Company 泛微软件
|
||||
* @CreateDate 2025/04/11
|
||||
* @Description 入职
|
||||
* @Author Lee
|
||||
*/
|
||||
public class EntryRewriteAction extends BaseBean implements Action {
|
||||
|
||||
@Override
|
||||
public String execute(RequestInfo requestInfo) {
|
||||
String requestId = requestInfo.getRequestid();
|
||||
String tableName = requestInfo.getRequestManager().getBillTableName();
|
||||
try {
|
||||
RecordSet rs = new RecordSet();
|
||||
RecordSet rs2 = new RecordSet();
|
||||
String sql = "select a.id,a.bhdm,a.sfzh,a.kqz,a.rzgs,a.rzrq,a.bb,h.id as uid from " + tableName + " a " +
|
||||
" left join hrmresource h on h.CERTIFICATENUM=a.sfzh and h.status in (0,1,2,3) " +
|
||||
" where a.requestid=?";
|
||||
rs.executeQuery(sql, requestId);
|
||||
String newWorkCode = "";
|
||||
if (rs.next()) {
|
||||
String uid = rs.getString("uid");
|
||||
String bhdm = rs.getString("bhdm");
|
||||
String kqGroupId = rs.getString("kqz");
|
||||
//班别
|
||||
String bb = rs.getString("bb");
|
||||
String companyId = rs.getString("rzgs");
|
||||
String entryDate = rs.getString("rzrq");
|
||||
sql = "select max(workcode) as workcode from hrmresource where workcode like '" + bhdm + "%' and ISNUMERIC(workcode ) = 1";
|
||||
rs2.execute(sql);
|
||||
if (rs2.next()) {
|
||||
String workCode = rs2.getString("workcode");
|
||||
newWorkCode = String.valueOf(Integer.parseInt(workCode) + 1);
|
||||
} else {
|
||||
newWorkCode = bhdm + "00001";
|
||||
}
|
||||
writeLog("EntryRewriteAction-workcode-" + newWorkCode);
|
||||
sql = "update " + tableName + " set workcode=?,hrmresourceid=? where requestId=?";
|
||||
boolean flage = rs.executeUpdate(sql, newWorkCode, uid, requestId);
|
||||
|
||||
//自动排班
|
||||
if (flage) {
|
||||
ExecutorService executorService = ThreadPoolUtil.getThreadPool(null, null);
|
||||
executorService.submit(() -> {
|
||||
ActionHandle.autoSchedule(uid, companyId, entryDate, kqGroupId,bb);
|
||||
});
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
writeLog("weaver.interfaces.zhuyou.action.EntryRewriteAction-e-" + e.getMessage());
|
||||
}
|
||||
return Action.SUCCESS;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue