Commit 0cf502e8 by 邓实川

Merge branch 'develop' of http://120.24.24.239:8082/8timerv2/8timerapiv200.git into dsc

parents 2c462840 344b7d3d
package cn.timer.api.aspect;
import java.lang.reflect.Method;
import java.util.Date;
import java.util.Map;
import java.util.TimerTask;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.Signature;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.AfterThrowing;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.HandlerMapping;
import com.alibaba.fastjson.JSON;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import cn.timer.api.aspect.lang.annotation.Log;
import cn.timer.api.aspect.lang.enums.BusinessStatus;
import cn.timer.api.bean.qyzx.QyzxEmpLogin;
import cn.timer.api.bean.qyzx.QyzxOperLog;
import cn.timer.api.config.enums.HttpMethod;
import cn.timer.api.manager.AsyncManager;
import cn.timer.api.manager.factory.AsyncFactory;
import cn.timer.api.utils.ServletUtils;
import cn.timer.api.utils.UserIp;
/**
* 操作日志记录处理
*
* @author Tang
*/
@Aspect
@Component
public class LogAspect
{
private static final Logger log = LoggerFactory.getLogger(LogAspect.class);
@Resource
private HttpSession session;
// 配置织入点
@Pointcut("@annotation(cn.timer.api.aspect.lang.annotation.Log)")
public void logPointCut()
{
}
/**
* 处理完请求后执行
*
* @param joinPoint 切点
*/
@AfterReturning(pointcut = "logPointCut()", returning = "jsonResult")
public void doAfterReturning(JoinPoint joinPoint, Object jsonResult)
{
handleLog(joinPoint, null, jsonResult);
}
/**
* 拦截异常操作
*
* @param joinPoint 切点
* @param e 异常
*/
@AfterThrowing(value = "logPointCut()", throwing = "e")
public void doAfterThrowing(JoinPoint joinPoint, Exception e)
{
handleLog(joinPoint, e, null);
}
protected void handleLog(final JoinPoint joinPoint, final Exception e, Object jsonResult)
{
try
{
// 获得注解
Log controllerLog = getAnnotationLog(joinPoint);
if (controllerLog == null)
{
return;
}
// 获取当前的用户
// LoginUser loginUser = SpringUtils.getBean(TokenService.class).getLoginUser(ServletUtils.getRequest());
QyzxEmpLogin eld = (QyzxEmpLogin)session.getAttribute("ui");
System.out.println(eld);
// *========数据库日志=========*//
QyzxOperLog operLog = new QyzxOperLog();
operLog.setOrgCode(eld.getOrgId());
operLog.setEmpNum(eld.getId());
// 请求的地址
String ip = UserIp.getIpAddr(ServletUtils.getRequest());
operLog.setOperIp(ip);
// 返回参数
String jsonResultStr = JSON.toJSONString(jsonResult);
operLog.setJsonResult(jsonResultStr.length() <= 10000 ? jsonResultStr : "");
operLog.setOperUrl(ServletUtils.getRequest().getRequestURI());
if (eld != null)
{
operLog.setOperName(eld.getUsername());
}
if (e != null)
{
operLog.setStatus(BusinessStatus.FAIL.ordinal());
operLog.setErrorMsg(StrUtil.sub(e.getMessage(), 0, 2000));
}else{
operLog.setStatus(BusinessStatus.SUCCESS.ordinal());
}
// 设置方法名称
String className = joinPoint.getTarget().getClass().getName();
String methodName = joinPoint.getSignature().getName();
operLog.setMethod(className + "." + methodName + "()");
// 设置请求方式
operLog.setRequestMethod(ServletUtils.getRequest().getMethod());
operLog.setOperTime(new Date());
// 处理设置注解上的参数
getControllerMethodDescription(joinPoint, controllerLog, operLog);
// 保存数据库
AsyncManager.me().execute(AsyncFactory.recordOper(operLog));
}
catch (Exception exp)
{
// 记录本地异常日志
log.error("==前置通知异常==");
log.error("异常信息:{}", exp.getMessage());
exp.printStackTrace();
}
}
/**
* 获取注解中对方法的描述信息 用于Controller层注解
*
* @param log 日志
* @param operLog 操作日志
* @throws Exception
*/
public void getControllerMethodDescription(JoinPoint joinPoint, Log log, QyzxOperLog operLog) throws Exception
{
// 设置action动作
operLog.setBusinessType(log.businessType().ordinal());
// 设置标题
operLog.setTitle(log.title());
// 设置操作人类别
operLog.setOperatorType(log.operatorType().ordinal());
// 是否需要保存request,参数和值
if (log.isSaveRequestData())
{
// 获取参数的信息,传入到数据库中。
setRequestValue(joinPoint, operLog);
}
}
/**
* 获取请求的参数,放到log中
*
* @param operLog 操作日志
* @throws Exception 异常
*/
private void setRequestValue(JoinPoint joinPoint, QyzxOperLog operLog) throws Exception
{
String requestMethod = operLog.getRequestMethod();
if (HttpMethod.PUT.name().equals(requestMethod) || HttpMethod.POST.name().equals(requestMethod))
{
// JSONObject jsonObj = JSONUtil.parseObj(joinPoint.getArgs());
String params = argsArrayToString(joinPoint.getArgs());
operLog.setOperParam(StrUtil.sub(params, 0, 10000));
}
else
{
Map<?, ?> paramsMap = (Map<?, ?>) ServletUtils.getRequest().getAttribute(HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE);
operLog.setOperParam(StrUtil.sub(paramsMap.toString(), 0, 10000));
}
}
/**
* 是否存在注解,如果存在就获取
*/
private Log getAnnotationLog(JoinPoint joinPoint) throws Exception
{
Signature signature = joinPoint.getSignature();
MethodSignature methodSignature = (MethodSignature) signature;
Method method = methodSignature.getMethod();
if (method != null)
{
return method.getAnnotation(Log.class);
}
return null;
}
/**
* 参数拼装
*/
private String argsArrayToString(Object[] paramsArray)
{
String params = "";
if (paramsArray != null && paramsArray.length > 0)
{
for (int i = 0; i < paramsArray.length; i++)
{
if (!isFilterObject(paramsArray[i]))
{
Object jsonObj = JSON.toJSON(paramsArray[i]);
params += jsonObj.toString() + " ";
}
}
}
return params.trim();
}
/**
* 判断是否需要过滤的对象。
*
* @param o 对象信息。
* @return 如果是需要过滤的对象,则返回true;否则返回false。
*/
public boolean isFilterObject(final Object o)
{
return o instanceof MultipartFile || o instanceof HttpServletRequest || o instanceof HttpServletResponse;
}
}
package cn.timer.api.aspect.lang.annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import cn.timer.api.aspect.lang.enums.BusinessType;
import cn.timer.api.aspect.lang.enums.OperatorType;
/**
* 自定义操作日志记录注解
*
* @author ruoyi
*
*/
@Target({ ElementType.PARAMETER, ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface Log
{
/**
* 模块
*/
public String title() default "";
/**
* 功能
*/
public BusinessType businessType() default BusinessType.OTHER;
/**
* 操作人类别
*/
public OperatorType operatorType() default OperatorType.MANAGE;
/**
* 是否保存请求的参数
*/
public boolean isSaveRequestData() default true;
}
package cn.timer.api.aspect.lang.enums;
/**
* 操作状态
*
* @author ruoyi
*
*/
public enum BusinessStatus
{
/**
* 成功
*/
SUCCESS,
/**
* 失败
*/
FAIL,
}
package cn.timer.api.aspect.lang.enums;
/**
* 业务操作类型
*
* @author Tang
*/
public enum BusinessType
{
/**
* 其它
*/
OTHER,
/**
* 新增
*/
INSERT,
/**
* 修改
*/
UPDATE,
/**
* 删除
*/
DELETE,
/**
* 授权
*/
GRANT,
/**
* 导出
*/
EXPORT,
/**
* 导入
*/
IMPORT,
/**
* 强退
*/
FORCE,
/**
* 生成代码
*/
GENCODE,
/**
* 清空数据
*/
CLEAN,
}
package cn.timer.api.aspect.lang.enums;
/**
* 操作人类别
*
* @author ruoyi
*/
public enum OperatorType
{
/**
* 其它
*/
OTHER,
/**
* 后台用户
*/
MANAGE,
/**
* 手机端用户
*/
MOBILE
}
......@@ -49,5 +49,7 @@ public class AttendanceAssistant implements Serializable{
String attgroupid;
int overtimeRulesId;//加班id
int fieldpersonnel;//外勤
}
......@@ -43,6 +43,7 @@ public class AttendanceGroup implements Serializable{
private String dkfs;// 打卡方式
private Integer isWq;//外勤
private Integer overtimeRulesId;
private Integer kqjid;
......
......@@ -60,8 +60,11 @@ public class KqglAssoLeaveBalance extends Model<KqglAssoLeaveBalance> {
@ApiModelProperty(value = "修改序号 修改序号", example = "101")
private Integer modifyNumber;
@ApiModelProperty(value="企业组织代码 企业组织代码",example="101")
private Integer orgCode;
@ApiModelProperty(value = "企业组织代码 企业组织代码", example = "101")
private Integer orgCode;
@ApiModelProperty(value = "是否为系统自动 0:否;1:是", example = "101")
private Integer isAutomatic;
}
\ No newline at end of file
......@@ -47,7 +47,7 @@ public class KqglAssoLeaveRules extends Model<KqglAssoLeaveRules> {
private Integer leaveType;
@ApiModelProperty(value = "适用范围 ", example = "0:全公司 >0:考勤组id")
private String apply;
private Integer apply;
@ApiModelProperty(value = "创建时间 创建时间", example = "101")
private Long createTime;
......@@ -63,5 +63,7 @@ public class KqglAssoLeaveRules extends Model<KqglAssoLeaveRules> {
@ApiModelProperty(value = "假期余额 0:关(该项余额为“不限余额”);1:开(该项余额为“0”)", example = "101")
private Integer leaveBalance;
}
\ No newline at end of file
package cn.timer.api.bean.kqmk;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author lal 2020-05-15
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "kqgl_asso_month_punch_summary")
@ApiModel("打卡月汇总")
public class KqglAssoMonthPunchSummary extends Model<KqglAssoMonthPunchSummary> {
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "id id", example = "101")
private Integer id;
@ApiModelProperty(value = "姓名 ", example = "姓名")
private String name;
@ApiModelProperty(value = "工号 工号", example = "101")
private Integer num;
@ApiModelProperty(value = "部门 ", example = "部门")
private String dept;
@ApiModelProperty(value = "职位 ", example = "职位")
private String post;
@ApiModelProperty(value = "考勤组id 考勤组id", example = "101")
private Integer attGroup;
@ApiModelProperty(value = "班次id 班次id", example = "101")
private Integer shift;
@ApiModelProperty(value = "应出勤天数 ", example = "应出勤天数")
private Double daysOnDuty;
@ApiModelProperty(value = "实际出勤天数 ", example = "实际出勤天数")
private Double actualAttDays;
@ApiModelProperty(value = "休息天数 ", example = "休息天数")
private Double daysOff;
@ApiModelProperty(value = "工作时长(分钟) ", example = "工作时长(分钟)")
private Double workingHours;
@ApiModelProperty(value = "迟到次数 ", example = "迟到次数")
private Double lateTimes;
@ApiModelProperty(value = "迟到时长(分钟) ", example = "迟到时长(分钟)")
private Double lateHours;
@ApiModelProperty(value = "严重迟到次数 ", example = "严重迟到次数")
private Double seriousLateTimes;
@ApiModelProperty(value = "严重迟到时长(分钟) ", example = "严重迟到时长(分钟)")
private Double seriousLateHours;
@ApiModelProperty(value = "旷工迟到次数 ", example = "旷工迟到次数")
private Double absenLateTimes;
@ApiModelProperty(value = "早退次数 ", example = "早退次数")
private Double earlyLeaveTimes;
@ApiModelProperty(value = "早退时长(分钟) ", example = "早退时长(分钟)")
private Double lengthEarlyLeave;
@ApiModelProperty(value = "上班缺卡次数 ", example = "上班缺卡次数")
private Double numberWorkCardShortage;
@ApiModelProperty(value = "下班缺卡次数 ", example = "下班缺卡次数")
private Double numberDutyCardShortage;
@ApiModelProperty(value = "旷工天数 ", example = "旷工天数")
private Double absenteeismDays;
@ApiModelProperty(value = "出差时长 ", example = "出差时长")
private Double lengthBusinessTrip;
@ApiModelProperty(value = "外出时长 ", example = "外出时长")
private Double timeOut;
@ApiModelProperty(value = "加班总时长 ", example = "加班总时长")
private Double totalOvertimeHours;
@ApiModelProperty(value = "工作日(转调休) ", example = "工作日(转调休)")
private Double workingTurnCompenLeave;
@ApiModelProperty(value = "休息日(转调休) ", example = "休息日(转调休)")
private Double restTurnCompenLeave;
@ApiModelProperty(value = "节假日(转调休) ", example = "节假日(转调休)")
private Double holidayTurnCompenLeave;
@ApiModelProperty(value = "工作日(转加班费) ", example = "工作日(转加班费)")
private Double workingTransferOvertime;
@ApiModelProperty(value = "休息日(转加班费) ", example = "休息日(转加班费)")
private Double restTransferOvertime;
@ApiModelProperty(value = "节假日(转加班费) ", example = "节假日(转加班费)")
private Double holidayTransferOvertime;
@ApiModelProperty(value = "day1 ", example = "day1")
private String day1;
@ApiModelProperty(value = "day2 ", example = "day2")
private String day2;
@ApiModelProperty(value = "day3 ", example = "day3")
private String day3;
@ApiModelProperty(value = "day4 ", example = "day4")
private String day4;
@ApiModelProperty(value = "day5 ", example = "day5")
private String day5;
@ApiModelProperty(value = "day6 ", example = "day6")
private String day6;
@ApiModelProperty(value = "day7 ", example = "day7")
private String day7;
@ApiModelProperty(value = "day8 ", example = "day8")
private String day8;
@ApiModelProperty(value = "day9 ", example = "day9")
private String day9;
@ApiModelProperty(value = "day10 ", example = "day10")
private String day10;
@ApiModelProperty(value = "day11 ", example = "day11")
private String day11;
@ApiModelProperty(value = "day12 ", example = "day12")
private String day12;
@ApiModelProperty(value = "day13 ", example = "day13")
private String day13;
@ApiModelProperty(value = "day14 ", example = "day14")
private String day14;
@ApiModelProperty(value = "day15 ", example = "day15")
private String day15;
@ApiModelProperty(value = "day16 ", example = "day16")
private String day16;
@ApiModelProperty(value = "day17 ", example = "day17")
private String day17;
@ApiModelProperty(value = "day18 ", example = "day18")
private String day18;
@ApiModelProperty(value = "day19 ", example = "day19")
private String day19;
@ApiModelProperty(value = "day20 ", example = "day20")
private String day20;
@ApiModelProperty(value = "day21 ", example = "day21")
private String day21;
@ApiModelProperty(value = "day22 ", example = "day22")
private String day22;
@ApiModelProperty(value = "day23 ", example = "day23")
private String day23;
@ApiModelProperty(value = "day24 ", example = "day24")
private String day24;
@ApiModelProperty(value = "day25 ", example = "day25")
private String day25;
@ApiModelProperty(value = "day26 ", example = "day26")
private String day26;
@ApiModelProperty(value = "day27 ", example = "day27")
private String day27;
@ApiModelProperty(value = "day28 ", example = "day28")
private String day28;
@ApiModelProperty(value = "day29 ", example = "day29")
private String day29;
@ApiModelProperty(value = "day30 ", example = "day30")
private String day30;
@ApiModelProperty(value = "day31 ", example = "day31")
private String day31;
@ApiModelProperty(value = "年 年", example = "101")
private Integer belongYear;
@ApiModelProperty(value = "月 月", example = "101")
private Integer belongMonth;
@ApiModelProperty(value = "企业组织代码 企业组织代码", example = "101")
private Integer orgCode;
@ApiModelProperty(value = "最后修改时间 最后修改时间", example = "101")
private Integer lastModified;
}
\ No newline at end of file
package cn.timer.api.bean.kqmk;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author LAL 2020-05-13
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "kqgl_asso_overtime_range")
@ApiModel("加班规则-应用范围")
public class KqglAssoOvertimeRange extends Model<KqglAssoOvertimeRange> {
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "编号 编号", example = "101")
private Integer id;
@ApiModelProperty(value = "加班规则id 加班规则id", example = "101")
private Integer overtimeRulesId;
@ApiModelProperty(value = "应用的考勤组id 应用的考勤组id", example = "101")
private Integer attgroupId;
}
\ No newline at end of file
......@@ -40,8 +40,8 @@ public class KqglAssoOvertimeRules extends Model<KqglAssoOvertimeRules> {
@ApiModelProperty(value = "规则名称 ", example = "以审批时间计算加班")
private String name;
@ApiModelProperty(value = "应用范围", example = "1")
private String appliedScope;
@ApiModelProperty(value = "应用范围", example = "(0:全公司 >0:考勤组id)")
private Integer appliedScope;
@ApiModelProperty(value = "工作日是否允许加班 0:否;1:是", example = "1")
private Integer isWorkovertime;
......
......@@ -47,7 +47,7 @@ public class KqglAssoTeshu extends Model<KqglAssoTeshu> {
private Integer bcid;
@ApiModelProperty(value = "录入时间 录入时间", example = "101")
private Integer lusjTime;
private Long lusjTime;
@ApiModelProperty(value = "录入人员 录入人员", example = "101")
private Integer luryid;
......
package cn.timer.api.bean.kqmk;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author LAL 2020-05-12
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "kqgl_asso_yhkqz")
@ApiModel("用户和考勤组关系表")
public class KqglAssoYhkqz extends Model<KqglAssoYhkqz> {
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "id id", example = "101")
private Integer id;
@ApiModelProperty(value = "考勤组id 考勤组id", example = "101")
private Integer kqzid;
@ApiModelProperty(value = "用户id 用户id", example = "101")
private Integer userid;
@ApiModelProperty(value = "企业id 企业id", example = "101")
private Integer qyid;
}
\ No newline at end of file
......@@ -93,5 +93,8 @@ public class KqglMainKqz extends Model<KqglMainKqz> {
@ApiModelProperty(value = "外勤 外勤", example = "101")
private Integer isWq;
@ApiModelProperty(value="加班规则 加班规则",example="101")
private Integer overtimeRulesId;
}
\ No newline at end of file
package cn.timer.api.bean.qyzx;
import java.util.Date;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 操作日志记录表 oper_log
*
* @author Tang
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder(toBuilder=true)
@Table(name="qyzx_oper_log")
@ApiModel("操作日志")
public class QyzxOperLog extends Model<QyzxOperLog>{
/**
*
*/
private static final long serialVersionUID = 1L;
/** 日志主键 */
@Id
@GeneratedValue
@TableId (type = IdType.AUTO)
@ApiModelProperty(value="编号",example="101")
private Integer operId;
@ApiModelProperty(value="企业id",example="101")
private Integer orgCode;
@ApiModelProperty(value="员工id",example="101")
private Integer empNum;
@ApiModelProperty(value="标题 ",example="操作模块")
private String title;
@ApiModelProperty(value="业务类型(0其它 1新增 2修改 3删除)",example="101")
private Integer businessType;
@ApiModelProperty(value="请求方法",example="请求方法")
private String method;
@ApiModelProperty(value="请求方式",example="请求方式")
private String requestMethod;
@ApiModelProperty(value="操作类别(0其它 1后台用户 2手机端用户)",example="101")
private Integer operatorType;
@ApiModelProperty(value="操作人员",example="操作人员")
private String operName;
@ApiModelProperty(value="部门名称",example="部门名称")
private String deptName;
@ApiModelProperty(value="请求url",example="请求url")
private String operUrl;
@ApiModelProperty(value="操作地址",example="操作地址")
private String operIp;
@ApiModelProperty(value="操作地点",example="操作地点")
private String operLocation;
@ApiModelProperty(value="请求参数",example="请求参数")
private String operParam;
@ApiModelProperty(value="返回参数",example="返回参数")
private String jsonResult;
@ApiModelProperty(value="操作状态(0正常 1异常)",example="101")
private Integer status;
@ApiModelProperty(value="错误消息",example="错误消息")
private String errorMsg;
@ApiModelProperty(value="操作时间",example="操作时间")
private Date operTime;
}
......@@ -58,7 +58,7 @@ public class SpmkExecutor extends Model<SpmkExecutor> {
@ApiModelProperty(value = "意见 ", example = "意见")
private String opinion;
@ApiModelProperty(value = "状态 0未执行 1执行中 2同意 3拒接", example = "101")
@ApiModelProperty(value = "状态 0未执行 1执行中 2同意 3拒接 4转派", example = "101")
private Integer sts;
@TableField(fill = FieldFill.INSERT)
......
......@@ -19,7 +19,7 @@ public class InitializeSetting implements ApplicationRunner {
@Override
public void run(ApplicationArguments args) throws Exception {
StaticVariable.mac_command = "http://192.168.3.143:8088/cmd";//考勤机执行命令
StaticVariable.mac_command = "http://120.24.24.239:8095/cmd";//考勤机执行命令
}
}
package cn.timer.api.config.enuminterface;
import lombok.Getter;
public interface SpmkEnumInterface {
/**
* 员工类型
*/
@Getter
enum ExecutorSts implements SpmkEnumInterface {
NON_EXECUTION(0, "未执行"), IN_EXECUTION(1, "执行中"), AGREE(2, "同意"), REFUSE(3, "拒绝"), REDEPLOY(4, "转派");
private Integer type;
private String name;
ExecutorSts(Integer type, String name) {
this.type = type;
this.name = name;
}
}
}
/**
* @date 2020年3月23日
* @author 翁东州
* @方法中文名称:
*/
package cn.timer.api.config.enuminterface;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
......@@ -46,6 +39,24 @@ public interface YgEnumInterface {
return mow.type.toString();
}
}
/**
* 部门 岗位
*/
@Getter
enum OrgType implements YgEnumInterface {
DEPARTMENT(0, "部门"), POST(1, "岗位");
private Integer type;
private String name;
OrgType(Integer type, String name) {
this.type = type;
this.name = name;
}
}
/**
* 员工类型
......@@ -81,7 +92,7 @@ public interface YgEnumInterface {
*/
@Getter
enum jobStatus implements YgEnumInterface {
SHIYONG(0, "试用"), ZHENSHI(1, "正式"), LIZHIZHONG(2, "离职中"), YILIZHI(3, "已离职");
SHIYONG(1, "试用"), ZHENSHI(2, "正式"), LIZHIZHONG(3, "离职中"), YILIZHI(4, "已离职");
private Integer type;
......
package cn.timer.api.config.enums;
import java.util.HashMap;
import java.util.Map;
import org.springframework.lang.Nullable;
/**
* 请求方式
*
* @author ruoyi
*/
public enum HttpMethod
{
GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS, TRACE;
private static final Map<String, HttpMethod> mappings = new HashMap<>(16);
static
{
for (HttpMethod httpMethod : values())
{
mappings.put(httpMethod.name(), httpMethod);
}
}
@Nullable
public static HttpMethod resolve(@Nullable String method)
{
return (method != null ? mappings.get(method) : null);
}
public boolean matches(String method)
{
return (this == resolve(method));
}
}
package cn.timer.api.config.thread;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.ThreadPoolExecutor;
import org.apache.commons.lang3.concurrent.BasicThreadFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import cn.timer.api.utils.Threads;
/**
* 线程池配置
*
* @author Tang
**/
@Configuration
public class ThreadPoolConfig
{
// 核心线程池大小
private int corePoolSize = 50;
// 最大可创建的线程数
private int maxPoolSize = 200;
// 队列最大长度
private int queueCapacity = 1000;
// 线程池维护线程所允许的空闲时间
private int keepAliveSeconds = 300;
@Bean(name = "threadPoolTaskExecutor")
public ThreadPoolTaskExecutor threadPoolTaskExecutor()
{
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setMaxPoolSize(maxPoolSize);
executor.setCorePoolSize(corePoolSize);
executor.setQueueCapacity(queueCapacity);
executor.setKeepAliveSeconds(keepAliveSeconds);
// 线程池对拒绝任务(无线程可用)的处理策略
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
return executor;
}
/**
* 执行周期性或定时任务
*/
@Bean(name = "scheduledExecutorService")
protected ScheduledExecutorService scheduledExecutorService()
{
return new ScheduledThreadPoolExecutor(corePoolSize,
new BasicThreadFactory.Builder().namingPattern("schedule-pool-%d").daemon(true).build())
{
@Override
protected void afterExecute(Runnable r, Throwable t)
{
super.afterExecute(r, t);
Threads.printException(r, t);
}
};
}
}
......@@ -28,6 +28,8 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import cn.timer.api.aspect.lang.annotation.Log;
import cn.timer.api.aspect.lang.enums.BusinessType;
import cn.timer.api.bean.qyzx.QyzxEmpEntAsso;
import cn.timer.api.bean.qyzx.QyzxEmpLogin;
import cn.timer.api.bean.qyzx.QyzxEntInfoM;
......@@ -121,29 +123,6 @@ public class LoginController {
@Value("${config-8timer.Aliyun.expirationTime_pri}")
private String expirationTime_pri;
@GetMapping(value = "/test")
public Map<String, Object> test() {
Map<String, Object> map = new HashMap<String, Object>();
map.put("1", offset);
map.put("2", PROJECT_NAME);
map.put("3", REGION_ID);
map.put("4", ACCESSKEY_ID);
map.put("5", SECRET);
// map.put("6", host);
// map.put("7", PROJECT_ID);
// map.put("8", PROJECT_SECRET);
map.put("9", endpoint);
map.put("10", accessKeyId);
map.put("11", accessKeySecret);
map.put("12", bucketName);
map.put("13", bucketName_pri);
map.put("14", project_package);
map.put("15", expirationTime);
map.put("16", expirationTime_pri);
map.put("test1", max);
return map;
}
@Autowired
private HttpSession session;
......@@ -168,6 +147,7 @@ public class LoginController {
@PostMapping(value = "/sendcode")
@ApiOperation(value = "1.发送验证码", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 1)
@Log(title = "发送验证码", businessType = BusinessType.UPDATE)
public Result<String> sendCode(@RequestBody EntRegisterDto entRegisterDto) {
String phone = entRegisterDto.getPhone();
......@@ -307,6 +287,7 @@ public class LoginController {
@PostMapping(value = "/updatePwd")
@ApiOperation(value = "4.修改密码(新)", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 4)
@Log(title = "修改密码", businessType = BusinessType.UPDATE)
public Result<String> updatepwd(@RequestBody EntRegisterDto entRegisterDto) {
String oldPwd = entRegisterDto.getOldPwd();// 输入的原密码
String pw = entRegisterDto.getPw();// 输入的新密码
......@@ -344,8 +325,8 @@ public class LoginController {
* @return
*/
@PostMapping(value = "/updatepassword")
@ApiOperation(value = "4.修改密码", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 4)
@ApiOperation(value = "3.修改密码", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 3)
public Result<String> updatepassword(@RequestBody EntRegisterDto entRegisterDto) {
String phone = entRegisterDto.getPhone();
String pw = entRegisterDto.getPw();
......@@ -402,7 +383,8 @@ public class LoginController {
* @return
*/
@PostMapping(value = "/updatephone")
@ApiOperation(value = "修改手机号/用户名", httpMethod = "POST", notes = "接口发布说明")
@ApiOperation(value = "5.修改手机号/用户名", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 5)
public Result<String> updatephone(@CurrentUser UserBean userBean, @RequestBody EntRegisterDto entRegisterDto) {
/*
......@@ -447,7 +429,9 @@ public class LoginController {
* @return
*/
@PostMapping(value = "/register")
@ApiOperation(value = "注册企业", httpMethod = "POST", notes = "接口发布说明")
@ApiOperation(value = "6.注册企业", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 6)
@Log(title = "企业注册", businessType = BusinessType.INSERT)
public Result<String> register(@RequestBody EntRegisterDto entRegisterDto) {
// 事务回滚
/*
......@@ -508,7 +492,7 @@ public class LoginController {
}
boolean b4 = YgglMainEmp.builder().orgCode(qyzxEntInfoM.getId()).empNum(login.getId()).rzTime(new Date())
.name(username).build().insert();
.name(username).jobStatus(1).build().insert();
if (!b4) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return ResultUtil.error("注册企业失败3");
......@@ -540,7 +524,9 @@ public class LoginController {
* @return
*/
@PostMapping(value = "/code")
@ApiOperation(value = "验证码登录", httpMethod = "POST", notes = "接口发布说明")
@ApiOperation(value = "7.验证码登录", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 7)
@Log(title = "用户登录", businessType = BusinessType.OTHER)
public Result<QyzxEmpLogin> codelogin(@RequestBody EntRegisterDto entRegisterDto, HttpServletRequest request) {
String code = entRegisterDto.getCode();
......@@ -636,7 +622,9 @@ public class LoginController {
* @return
*/
@PostMapping(value = "/password")
@ApiOperation(value = "密码登录", httpMethod = "POST", notes = "接口发布说明")
@ApiOperation(value = "8.密码登录", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 8)
@Log(title = "用户登录", businessType = BusinessType.OTHER)
public Result<QyzxEmpLogin> passwordlogin(@RequestBody EntRegisterDto entRegisterDto, HttpServletRequest request) {
String phone = entRegisterDto.getPhone();
......@@ -647,7 +635,7 @@ public class LoginController {
if (qyzxEmpLogin1 != null) {
if (StrUtil.hasBlank(pw) || !qyzxEmpLogin1.getPw().equals(Md5.md5(pw)))
return ResultUtil.error("帐号密码错误");
return loginhan(qyzxEmpLogin1, request);
} else {
return ResultUtil.error("帐号不存在-错误");
......
......@@ -16,7 +16,6 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import cn.hutool.json.JSONObject;
......@@ -25,6 +24,7 @@ import cn.timer.api.bean.kqmk.KqglAssoDkjl;
import cn.timer.api.bean.kqmk.KqglAssoDkmx;
import cn.timer.api.bean.kqmk.KqglAssoKqj;
import cn.timer.api.bean.kqmk.KqglAssoKqzdkfs;
import cn.timer.api.bean.kqmk.KqglAssoMonthPunchSummary;
import cn.timer.api.bean.kqmk.KqglAssoTeshu;
import cn.timer.api.bean.kqmk.KqglAssoZhoupaiban;
import cn.timer.api.bean.kqmk.KqglMainKqz;
......@@ -32,7 +32,6 @@ import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.config.exception.CustomException;
import cn.timer.api.dao.kqmk.KqglAssoPbmxMapper;
import cn.timer.api.dao.kqmk.KqglMainKqzMapper;
import cn.timer.api.dao.yggl.YgglMainEmpMapper;
import cn.timer.api.dto.kqmk.AttLateLate;
import cn.timer.api.dto.kqmk.AttSchedule;
import cn.timer.api.dto.kqmk.AttendanceCardListDto;
......@@ -44,15 +43,13 @@ import cn.timer.api.utils.ResultUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@Api(tags = "3.0考勤打卡")
@Api(tags = "3.0[3]考勤打卡")
@RestController
@Transactional
@RequestMapping(value = "/kqdk", produces = { "application/json", "multipart/form-data" })
public class ClockInController {
@Autowired
private KqglMainKqzMapper kqglmainkqzmapper;
/**
* 考勤打卡
*
......@@ -65,24 +62,18 @@ public class ClockInController {
@ApiOperationSupport(order = 1)
public Result<Object> punchclock(@RequestParam String json) throws Exception {
JSONObject jsonArray = new JSONObject(json);
String asDevId = jsonArray.get("dev_id").toString();
String asUserId = jsonArray.get("user_id").toString();
String asVerifyMode = jsonArray.get("verify_mode").toString();
String asIOMode = "0";
String sStdIoTime = jsonArray.get("io_time").toString();
String asDevId = jsonArray.get("dev_id").toString();//考勤机编码
String asUserId = jsonArray.get("user_id").toString();//打卡用户id
String asVerifyMode = jsonArray.get("verify_mode").toString();//考勤机打卡方式(1:指纹;20:人脸;40:掌纹;60:密码(猜的^v^))
String sStdIoTime = jsonArray.get("io_time").toString();//打卡时间
KqglAssoKqj kqjdev = KqglAssoKqj.builder().build().selectOne(new QueryWrapper<KqglAssoKqj>().lambda().eq(KqglAssoKqj::getCode, asDevId));
if (kqjdev == null)
return ResultUtil.error("考勤机不存在!");
// YgglMainEmp user = new LambdaQueryChainWrapper<YgglMainEmp>(ygglmainempmapper).eq(YgglMainEmp::getEmpNum, asUserId).eq(YgglMainEmp::getOrgCode, kqjdev.getQyid()).one();
YgglMainEmp user = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum, asUserId).eq(YgglMainEmp::getOrgCode, kqjdev.getQyid()));
if(user != null) {
int qyid = user.getOrgCode();//坏小孩【企业id】
int userid = user.getEmpNum();//用户id
int qyid = user.getOrgCode();
int userid = user.getEmpNum();
KqglMainKqz attgro = kqglmainkqzmapper.getAttendanceGroupInformationByUserid(userid,qyid); //考勤组信息
//pbfs;// 排班方式 1:固定排班;2:自由排班;3:自由工时
if(attgro != null) {
......@@ -248,6 +239,12 @@ public class ClockInController {
KqglAssoDkmx.builder().id(dkmc.getId()).build().updateById();
}
}
//具体打卡时间入汇总表(打卡成功才会录入汇总表)
KqglAssoMonthPunchSummary summary = KqglAssoMonthPunchSummary.builder().build();
}else {
System.out.println("当前打卡时间不在范围内");
}
//原始打卡记录数据录入**************************************************************************************************************************************
......@@ -282,7 +279,7 @@ public class ClockInController {
long attime;
if(punchcardtime == 0 && !isRange){attime = new Date().getTime();}else{attime = punchcardtime;}// 考勤时间(应打卡时间)
String remarks = "";
if(("1").equals(asVerifyMode)) {remarks = "考勤机指纹打卡";}else if(("20").equals(asVerifyMode)) {remarks = "考勤机人脸打卡";}
if(("1").equals(asVerifyMode)) {remarks = "考勤机指纹打卡";}else if(("20").equals(asVerifyMode)) {remarks = "考勤机人脸打卡";}else if(("40").equals(asVerifyMode)) {remarks = "考勤机掌纹打卡";}else if(("60").equals(asVerifyMode)) {remarks = "考勤机密码打卡";}
//cardtype--1:GPS,2:WIFI,3:考勤机
KqglAssoDkjl pre = KqglAssoDkjl.builder().dktime(time_).results(results).userId(userid).type(type).status(status).sort(atttype)
.cardType(3).qyid(qyid).attdate(attdate_+" "+ClockInTool.dateToWeek2(putime)).attime(attime).dkmxid(dkmx).bcid(clockt.getShifid()).remarks(remarks).punchmode(Integer.valueOf(asVerifyMode))
......
......@@ -4,15 +4,128 @@ import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Set;
/**
* @author Yl123 2020-05-11
*
*/
public class ClockInTool {
static SimpleDateFormat famt = new SimpleDateFormat("yyyy-MM-dd");
/**
* 根据 年、月 获取对应的月份 的 天数
*/
public static int getDaysByYearMonth(int year, int month)
{
Calendar a = Calendar.getInstance();
a.set(Calendar.YEAR, year);
a.set(Calendar.MONTH, month - 1);
a.set(Calendar.DATE, 1);
a.roll(Calendar.DATE, -1);
int maxDate = a.get(Calendar.DATE);
return maxDate;
}
/**
* 获取月份起始日期
*
* @param date
* @return
* @throws ParseException
*/
public static String getMinMonthDate(String date) throws ParseException {
Calendar calendar = Calendar.getInstance();
calendar.setTime(famt.parse(date));
calendar.set(Calendar.DAY_OF_MONTH,
calendar.getActualMinimum(Calendar.DAY_OF_MONTH));
return famt.format(calendar.getTime());
}
/**
* 获取月份最后日期
*
* @param date
* @return
* @throws ParseException
*/
public static String getMaxMonthDate(String date) throws ParseException {
Calendar calendar = Calendar.getInstance();
calendar.setTime(famt.parse(date));
calendar.set(Calendar.DAY_OF_MONTH,
calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
return famt.format(calendar.getTime());
}
/**
* 对比两个字符串数组
* @param t1
* @param t2
* @return
*/
public static <T> List<T> compare(T[] t1, T[] t2) {
List<T> list1 = Arrays.asList(t1); //将t1数组转成list数组
List<T> list2 = new ArrayList<T>();//用来存放2个数组中不相同的元素
for (T t : t2) {
if (!list1.contains(t)) {
list2.add(t);
}
}
return list2;
}
public static String[] array_unique(String[] ss) {
Set<String> set=new HashSet<String>(Arrays.asList(ss));
return set.toArray(new String[set.size()]);
//或者return new HashSet<String>(Arrays.asList(ss)).toArray(new String[0]);
}
public static byte[] CreateBSCommBufferFromString(String sCmdParam,byte[] bytCmd) {
try{
if (sCmdParam.length() == 0){
return bytCmd;
}
byte[] bytText = sCmdParam.getBytes("UTF-8");
byte[] bytTextLen = int2byte(bytText.length + 1);
bytCmd=new byte[4 + bytText.length + 1];
System.arraycopy(bytTextLen,0,bytCmd,0,bytTextLen.length);
System.arraycopy(bytText,0,bytCmd,4,bytText.length);
bytCmd[4 + bytText.length] = 0;
return bytCmd;
}catch(Exception e){
e.printStackTrace();
bytCmd=new byte[0];
return bytCmd;
}
}
public static byte[] int2byte(int res) {
byte[] targets = new byte[4];
targets[0] = (byte) (res & 0xff);
targets[1] = (byte) ((res >> 8) & 0xff);
targets[2] = (byte) ((res >> 16) & 0xff);
targets[3] = (byte) (res >>> 24);
return targets;
}
public static byte[] ConcateByteArray(byte[] abytDest, byte[] abytSrc) {
int len_dest = abytDest.length + abytSrc.length;
if (abytSrc.length == 0)
return abytDest;
byte[] bytTmp = new byte[len_dest];
System.arraycopy(abytDest, 0, bytTmp, 0, abytDest.length);
System.arraycopy(abytSrc, 0, bytTmp, abytDest.length, abytSrc.length);
return bytTmp;
}
public static String dateToWeek2(String datetime) {
......
......@@ -9,6 +9,7 @@ import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
......@@ -32,8 +33,10 @@ import cn.timer.api.bean.qyzx.QyzxEntInfoM;
import cn.timer.api.bean.qyzx.QyzxFeebackAccessory;
import cn.timer.api.bean.qyzx.QyzxInvoiceUsual;
import cn.timer.api.bean.qyzx.QyzxLogBuy;
import cn.timer.api.bean.qyzx.QyzxOperLog;
import cn.timer.api.bean.qyzx.QyzxPayServe;
import cn.timer.api.bean.qyzx.QyzxSuggestionFeeback;
import cn.timer.api.bean.spmk.SpmkApproveSummary;
import cn.timer.api.bean.zzgl.ZzglAuth;
import cn.timer.api.bean.zzgl.ZzglBmgwM;
import cn.timer.api.config.annotation.CurrentUser;
......@@ -46,6 +49,7 @@ import cn.timer.api.dao.qyzx.QyzxEntInfoMMapper;
import cn.timer.api.dao.qyzx.QyzxFeebackAccessoryMapper;
import cn.timer.api.dao.qyzx.QyzxInvoiceUsualMapper;
import cn.timer.api.dao.qyzx.QyzxLogBuyMapper;
import cn.timer.api.dao.qyzx.QyzxOperLogMapper;
import cn.timer.api.dao.qyzx.QyzxPayServeMapper;
import cn.timer.api.dao.qyzx.QyzxSuggestionFeebackMapper;
import cn.timer.api.dao.zzgl.ZzglBmgwMMapper;
......@@ -55,6 +59,7 @@ import cn.timer.api.dto.qyzx.AttaFpglQueryDto;
import cn.timer.api.dto.qyzx.EntauthDto;
import cn.timer.api.dto.qyzx.FeebackDto;
import cn.timer.api.dto.qyzx.LogBuyDto;
import cn.timer.api.dto.qyzx.QyzxOperLogQuaryDto;
import cn.timer.api.utils.Result;
import cn.timer.api.utils.ResultUtil;
import cn.timer.api.utils.aliyun.OSSUtil;
......@@ -65,9 +70,6 @@ import lombok.extern.slf4j.Slf4j;
@Slf4j
@RestController
@Api(tags = "4.0企业中心")
// @RequestMapping(value = "/qyzx", produces = { "application/json",
// "multipart/form-data", "form-data" }, consumes = { "application/json",
// "multipart/form-data" })
@RequestMapping(value = "/qyzx", produces = { "application/json" })
public class QyzxController {
@Autowired
......@@ -325,11 +327,8 @@ public class QyzxController {
wp.select(ZzglAuth::getMenuId).eq(ZzglAuth::getOrgCode, ctrl.getId())
.and(i -> i.in(ZzglAuth::getBmgwId, list.toArray()));
List<ZzglAuth> zas = ZzglAuth.builder().build().selectList(wp);
if (zas.size() == 0)
return ResultUtil.error(null, "切换企业失败,在该公司没有权限");
zas.stream().forEach(o -> menus.add(o.getMenuId()));
} else {
return ResultUtil.error(null, "切换企业失败,在该公司没有权限");
if (zas != null && zas.size() != 0)
zas.stream().forEach(o -> menus.add(o.getMenuId()));
}
}
emp.setOrgId(orgCode);
......@@ -514,5 +513,44 @@ public class QyzxController {
IPage<AdminListDto> page1 = new Page<AdminListDto>(page, limit);
return ResultUtil.data(page1, qyzxEmpEntAssoMapper.adminlist(page1, userBean.getOrgCode()), "获取账号");
}
@Autowired
private QyzxOperLogMapper qyzxOperLogMapper;
/**
* 查询-操作日志
*
* @param
* @return
*/
@PostMapping(value = "/select_oper_log")
@ApiOperation(value = "查询-操作日志", httpMethod = "POST", notes = "查询-操作日志")
public Result<Object> selectOperLog(@CurrentUser UserBean userBean,@RequestBody QyzxOperLogQuaryDto qyzxOperLogQuaryDto) {
IPage<QyzxOperLog> page = new Page<QyzxOperLog>(
qyzxOperLogQuaryDto.getCurrentPage() == null ? 1 : qyzxOperLogQuaryDto.getCurrentPage(),
qyzxOperLogQuaryDto.getTotalPage() == null ? 10 : qyzxOperLogQuaryDto.getTotalPage());
qyzxOperLogQuaryDto.setOrgCode(userBean.getOrgCode());
IPage<QyzxOperLog> pages = qyzxOperLogMapper.selectPageByQuery(page, qyzxOperLogQuaryDto);
List<QyzxOperLog> listOl = pages.getRecords();
return ResultUtil.data(pages, listOl, "操作成功!");
}
/**
* 删除-操作日志
*
* @param
* @return
*/
@DeleteMapping(value = "/delete_oper_log")
@ApiOperation(value = "删除-操作日志", httpMethod = "DELETE", notes = "查询-操作日志")
public Result<Object> deleteOperLog(@CurrentUser UserBean userBean,@RequestBody Integer[] ids) {
ArrayList<Integer> list = CollUtil.toList(ids);
int delCount = qyzxOperLogMapper.deleteBatchIds(list);
return ResultUtil.data(delCount, "操作成功!");
}
}
package cn.timer.api.controller.qyzx.service;
import java.util.List;
import com.baomidou.mybatisplus.core.metadata.IPage;
import cn.timer.api.bean.qyzx.QyzxOperLog;
import cn.timer.api.dto.qyzx.QyzxOperLogQuaryDto;
/**
* 操作日志 服务层
*
* @author ruoyi
*/
public interface QyzxOperLogService
{
/**
* 新增操作日志
*
* @param operLog 操作日志对象
*/
public void insertOperlog(QyzxOperLog operLog);
/**
* 查询系统操作日志集合
*
* @param operLog 操作日志对象
* @return 操作日志集合
*/
public IPage<QyzxOperLog> selectPageByQuery(IPage<QyzxOperLog> page, QyzxOperLogQuaryDto operLog);
/**
* 批量删除系统操作日志
*
* @param operIds 需要删除的操作日志ID
* @return 结果
*/
public int deleteOperLogByIds(List<QyzxOperLog> idList);
/**
* 查询操作日志详细
*
* @param operId 操作ID
* @return 操作日志对象
*/
public QyzxOperLog selectOperLogById(Long operId);
/**
* 清空操作日志
*/
public void cleanOperLog();
}
package cn.timer.api.controller.qyzx.service;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import cn.timer.api.bean.qyzx.QyzxOperLog;
import cn.timer.api.dao.qyzx.QyzxOperLogMapper;
import cn.timer.api.dto.qyzx.QyzxOperLogQuaryDto;
/**
* 操作日志 服务层处理
*
* @author Tang
*/
@Service
public class QyzxOperLogServiceImpl implements QyzxOperLogService
{
@Autowired
private QyzxOperLogMapper operLogMapper;
/**
* 新增操作日志
*
* @param operLog 操作日志对象
*/
@Override
public void insertOperlog(QyzxOperLog operLog)
{
operLogMapper.insert(operLog);
}
/**
* 查询系统操作日志集合
*
* @param operLog 操作日志对象
* @return 操作日志集合
*/
@Override
public IPage<QyzxOperLog> selectPageByQuery(IPage<QyzxOperLog> page,QyzxOperLogQuaryDto operLog)
{
return operLogMapper.selectPageByQuery(page,operLog);
}
/**
* 批量删除系统操作日志
*
* @param operIds 需要删除的操作日志ID
* @return 结果
*/
public int deleteOperLogByIds(List<QyzxOperLog> idList)
{
return operLogMapper.deleteBatchIds(idList);
}
/**
* 查询操作日志详细
*
* @param operId 操作ID
* @return 操作日志对象
*/
@Override
public QyzxOperLog selectOperLogById(Long operId)
{
return operLogMapper.selectById(operId);
}
/**
* 清空操作日志
*/
@Override
public void cleanOperLog()
{
operLogMapper.delete(null);
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
package cn.timer.api.controller.zzgl;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.transaction.Transactional;
......@@ -22,13 +25,25 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import cn.hutool.core.bean.copier.ValueProvider;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.lang.tree.Tree;
import cn.hutool.core.lang.tree.TreeNode;
import cn.hutool.core.lang.tree.TreeNodeConfig;
import cn.hutool.core.lang.tree.TreeUtil;
import cn.hutool.core.util.StrUtil;
import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.bean.zzgl.ZzglAuth;
import cn.timer.api.bean.zzgl.ZzglBmgwM;
import cn.timer.api.config.annotation.CurrentUser;
import cn.timer.api.config.annotation.UserBean;
import cn.timer.api.config.enuminterface.YgEnumInterface;
import cn.timer.api.dao.yggl.YgglMainEmpMapper;
import cn.timer.api.dao.zzgl.ZzglBmgwMMapper;
import cn.timer.api.dao.zzgl.ZzglLogDgjlMapper;
......@@ -70,12 +85,59 @@ public class ZzglController {
return ResultUtil.data(zzglBmgwMs);
}
/**
* 架构树/架构图/导出
*
* @param
* @return
*/
@GetMapping(value = "/deptlist_plus")
@ApiOperation(value = "1.获取部门岗位-升级版", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 1)
public Result<List<Tree<String>>> selectlistdept2(@CurrentUser UserBean userBean) {
Integer orgCode = userBean.getOrgCode();
List<ZzglBmgwM> zzglBmgwMs = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper)
.eq(ZzglBmgwM::getOrgCode, orgCode).list();
// 构建node列表
List<TreeNode<String>> nodeList = CollUtil.newArrayList();
zzglBmgwMs.forEach(z -> {
nodeList.add(new TreeNode<>(Convert.toStr(z.getId()), Convert.toStr(z.getUpId()), z.getName(), 0));
});
//配置
TreeNodeConfig treeNodeConfig = new TreeNodeConfig();
// 自定义属性名 都要默认值的
treeNodeConfig.setIdKey("id");
treeNodeConfig.setParentIdKey("upId");
// 最大递归深度
// treeNodeConfig.setDeep(10);
//转换器
List<Tree<String>> treeNodes = TreeUtil.build(nodeList, "0", treeNodeConfig,
(treeNode, tree) -> {
tree.setId(treeNode.getId());
tree.setParentId(treeNode.getParentId());
tree.setWeight(treeNode.getWeight());
tree.setName(treeNode.getName());
// 扩展属性 ...
// tree.putExtra("extraField", 666);
// tree.putExtra("other", new Object());
});
return ResultUtil.data(treeNodes);
}
@GetMapping(value = "/depts")
@ApiOperation(value = "只获取部门", httpMethod = "GET", notes = "接口发布说明")
@ApiOperation(value = "2.获取部门", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 2)
public Result<List<ZzglBmgwM>> selectdepts(@CurrentUser UserBean userBean) {
Integer orgCode = userBean.getOrgCode();
List<ZzglBmgwM> zzglBmgwMs = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper)
.eq(ZzglBmgwM::getOrgCode, orgCode).eq(ZzglBmgwM::getType, 0).list();//0:部门;1:岗位
.eq(ZzglBmgwM::getOrgCode, orgCode)
.eq(ZzglBmgwM::getType, YgEnumInterface.OrgType.DEPARTMENT)
.list();
return ResultUtil.data(zzglBmgwMs);
}
......@@ -176,16 +238,24 @@ public class ZzglController {
@PostMapping(value = "/dept")
@ApiOperation(value = "添加/修改部门", httpMethod = "POST", notes = "接口发布说明")
public Result<ZzglBmgwM> adddept(@CurrentUser UserBean userBean, @RequestBody ZzglBmgwM zzglBmgwM) {
if (zzglBmgwM.getName().trim().length()==0)
Integer count = zzglBmgwMMapper.selectCount(new QueryWrapper<ZzglBmgwM>().lambda()
.eq(ZzglBmgwM::getOrgCode, userBean.getOrgCode()));
if (count <= 0) {
// 根部门upId 默认为0
zzglBmgwM.setUpId(0);
}
if (zzglBmgwM.getLeader() == null && StrUtil.length(StrUtil.trim(zzglBmgwM.getName())) == 0)
return ResultUtil.error("部门岗位名称不能为空");
Boolean a = zzglBmgwM.getId() == null;
if (a && zzglBmgwM.getType() == null)
Boolean notId = zzglBmgwM.getId() == null;
if (notId && zzglBmgwM.getType() == null)
zzglBmgwM.setType((Integer) 0);
zzglBmgwM.setOrgCode(userBean.getOrgCode());
zzglBmgwM.insertOrUpdate();
if (a)
return ResultUtil.data(zzglBmgwM);
return ResultUtil.success();
zzglBmgwM.setOrgCode(userBean.getOrgCode());
zzglBmgwM.insertOrUpdate();
return notId ? ResultUtil.data(zzglBmgwM) : ResultUtil.success();
}
......
package cn.timer.api.dao.kqmk;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.timer.api.bean.kqmk.KqglAssoBcsz;
import cn.timer.api.dto.kqmk.KqzAttendanceGroupSearchDto;
/**
......@@ -17,4 +19,6 @@ public interface KqglAssoBcszMapper extends BaseMapper<KqglAssoBcsz> {
int insert(KqglAssoBcsz kqglassobcsz);
int update(KqglAssoBcsz kqglassobcsz);
List<KqglAssoBcsz> selectRosterByKqzid(KqzAttendanceGroupSearchDto kqzattendancegroupsearchdto);
}
package cn.timer.api.dao.kqmk;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
import org.springframework.stereotype.Repository;
import cn.timer.api.bean.kqmk.KqglAssoKqzdkfs;
......@@ -12,5 +15,7 @@ import cn.timer.api.bean.kqmk.KqglAssoKqzdkfs;
*/
@Repository
public interface KqglAssoKqzdkfsMapper extends BaseMapper<KqglAssoKqzdkfs> {
int insertKqglAssokqzdKfsList(List<KqglAssoKqzdkfs> kqglassokqzdkfs);
}
package cn.timer.api.dao.kqmk;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import cn.timer.api.bean.kqmk.KqglAssoLeaveBalance;
import cn.timer.api.dto.kqmk.AttqueryCriteriaDto;
import cn.timer.api.dto.kqmk.EmployeeLeaveBalanceDto;
/**
* 员工假期余额
......@@ -12,5 +17,6 @@ import cn.timer.api.bean.kqmk.KqglAssoLeaveBalance;
*/
@Repository
public interface KqglAssoLeaveBalanceMapper extends BaseMapper<KqglAssoLeaveBalance> {
IPage<EmployeeLeaveBalanceDto> selectPageByQueryLeaveBalance(IPage<EmployeeLeaveBalanceDto> page,@Param("param") AttqueryCriteriaDto attquerycriteriadto);
}
package cn.timer.api.dao.kqmk;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
import cn.timer.api.bean.kqmk.KqglAssoMonthPunchSummary;
/**
* 打卡月汇总
*
* @author Tang 2020-05-15
*/
@Repository
public interface KqglAssoMonthPunchSummaryMapper extends BaseMapper<KqglAssoMonthPunchSummary> {
}
package cn.timer.api.dao.kqmk;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
import org.springframework.stereotype.Repository;
import cn.timer.api.bean.kqmk.KqglAssoOvertimeRange;
/**
* 加班规则-应用范围
*
* @author LAL 2020-05-13
*/
@Repository
public interface KqglAssoOvertimeRangeMapper extends BaseMapper<KqglAssoOvertimeRange> {
int insertovertimerangelist(List<KqglAssoOvertimeRange> kqglassoovertimerange);
}
package cn.timer.api.dao.kqmk;
import java.util.List;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.timer.api.bean.kqmk.KqglAssoPbmx;
import cn.timer.api.dto.kqmk.AttSchedulingDto;
import cn.timer.api.dto.kqmk.KqglAssoPbmxDto;
/**
......@@ -16,4 +19,8 @@ import cn.timer.api.dto.kqmk.KqglAssoPbmxDto;
public interface KqglAssoPbmxMapper extends BaseMapper<KqglAssoPbmx> {
KqglAssoPbmxDto getScheduleSpecificAttendance(Integer kqzid, Integer userid, String date);
int insertKqglAssoPbmxList(List<KqglAssoPbmxDto> kqglassopbmxdto);
List<KqglAssoPbmxDto> selectAttGroupScheduling(AttSchedulingDto attschedulingdto);
}
package cn.timer.api.dao.kqmk;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.timer.api.bean.kqmk.KqglAssoTeshu;
/**
......@@ -12,5 +15,7 @@ import cn.timer.api.bean.kqmk.KqglAssoTeshu;
*/
@Repository
public interface KqglAssoTeshuMapper extends BaseMapper<KqglAssoTeshu> {
int insertKqglAssoTeshuList(List<KqglAssoTeshu> kqglassoteshu);
}
package cn.timer.api.dao.kqmk;
import java.util.List;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.timer.api.bean.kqmk.KqglAssoYhkqz;
/**
* 用户和考勤组关系表
*
* @author LAL 2020-05-12
*/
@Repository
public interface KqglAssoYhkqzMapper extends BaseMapper<KqglAssoYhkqz> {
int insertKqglAssoKqzdkfsList(List<KqglAssoYhkqz> kqglassoyhkqz);
}
package cn.timer.api.dao.kqmk;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.timer.api.bean.kqmk.KqglAssoZhoupaiban;
/**
......@@ -12,5 +15,6 @@ import cn.timer.api.bean.kqmk.KqglAssoZhoupaiban;
*/
@Repository
public interface KqglAssoZhoupaibanMapper extends BaseMapper<KqglAssoZhoupaiban> {
int insertKqglAssoZhoupaibanList(List<KqglAssoZhoupaiban> kqglassozhoupaiban);
}
......@@ -2,11 +2,14 @@ package cn.timer.api.dao.kqmk;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import cn.timer.api.bean.kqmk.KqglMainKqz;
import cn.timer.api.dto.kqmk.AttqueryCriteriaDto;
import cn.timer.api.dto.kqmk.KqglMainKqzDto;
/**
......@@ -20,4 +23,7 @@ public interface KqglMainKqzMapper extends BaseMapper<KqglMainKqz> {
List<KqglMainKqzDto> selectAttGroupMachineByQyid(int qyid);
KqglMainKqz getAttendanceGroupInformationByUserid(int userid,int qyid);
IPage<KqglMainKqzDto> selectPageByQueryKqglMain(IPage<KqglMainKqzDto> page,@Param("param") AttqueryCriteriaDto attquerycriteriadto);
}
package cn.timer.api.dao.qyzx;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import cn.timer.api.bean.qyzx.QyzxOperLog;
import cn.timer.api.dto.qyzx.QyzxOperLogQuaryDto;
/**
* 操作日志 数据层
*
* @author ruoyi
*/
public interface QyzxOperLogMapper extends BaseMapper<QyzxOperLog> {
// /**
// * 新增操作日志
// *
// * @param operLog 操作日志对象
// */
// public void insertOperlog(QyzxOperLog operLog);
//
/**
* 查询系统操作日志集合
*
* @param operLog 操作日志对象
* @return 操作日志集合
*/
public IPage<QyzxOperLog> selectPageByQuery(IPage<QyzxOperLog> page,@Param("param") QyzxOperLogQuaryDto operLog);
//
// /**
// * 批量删除系统操作日志
// *
// * @param operIds 需要删除的操作日志ID
// * @return 结果
// */
// public int deleteOperLogByIds(Long[] operIds);
//
// /**
// * 查询操作日志详细
// *
// * @param operId 操作ID
// * @return 操作日志对象
// */
// public QyzxOperLog selectOperLogById(Long operId);
//
// /**
// * 清空操作日志
// */
// public void cleanOperLog();
}
package cn.timer.api.dto.kqmk;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class AttSchedulingDto implements Serializable{
private static final long serialVersionUID = 5519260557957197035L;
private Integer qyid;
private String date;
private Integer kqzid;
}
package cn.timer.api.dto.kqmk;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class AttendanceAssistantDto implements Serializable{
private static final long serialVersionUID = -3561517817976805144L;
String name;// 考勤组名称 *
String remarks;// 备注 *
String[] attmachines;// 考勤机
String[] attadds;// 办公地点考勤
String[] attwifis;// WiFi考勤
String[] attuserids;// 考勤成员
int atttype;// 考勤类型:1-固定排班、2-排班制、3-自由工时 *
int legalholidays;// 是否开启法定节假日:0-否、1-是 *
String[] attWeekdays;// 周工作日【固定排班】
String[] attWeekdaysShifts;// 周工作日班次【固定排班】
String[] attMustPunchData;// 必须打卡的日期【固定排班】
String[] attMustPunchShifid;// 必须打卡的班次id【固定排班】
String[] attNonPunchData;// 不用打卡的日期【固定排班】
String[] attShifts;// 排班制 选择的班次【排班制】
int attRemind;// 是否开启提醒:0-否、1-是【排班制】
String[] attRemindUserids;// 提醒人员【排班制】
int advanceDays;// 提前多少天数提醒【排班制】
int remCycleDays;// 提醒循环天数【排班制】
String reminderTime;// 提醒时间【排班制】
String[] promptingMode;// 提醒方式:PC端、APP客户端、短信、邮件【排班制】
KqglAssoPbmxDto[] schedules;// 排班日期【排班制】--班次id、日期
// SchedulesUserids[] schedulesUserids;// 排班【排班制】----用户id
int optscheduling;// 未排班时,员工可选择班次打卡
String newAttTime;// 每天几点开始新的考勤【自由工时】
String[] attFreeWorkdays;// 周工作日【自由工时】
String leastworkTime;// 至少需工作时间【自由工时】
String normalWorkTime;// 正常工作时长【自由工时】
String maxOvertimeTime;// 加班最大时长【自由工时】
String attgroupid;
int overtimeRulesId;//加班id
int fieldpersonnel;//外勤
}
......@@ -14,10 +14,10 @@ import lombok.NoArgsConstructor;
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class AttendanceGroupDto implements Serializable{
public class AttendanceGroupDto implements Serializable {
private static final long serialVersionUID = -5573272776427338217L;
private Integer id;
private String name;// 名称
private String kqbz;// 考勤备注
......@@ -45,9 +45,9 @@ public class AttendanceGroupDto implements Serializable{
private String pbfsnm;// 排班方式
private String dkfs;// 打卡方式
private Integer isWq;//外勤
private Integer isWq;// 外勤
private Integer kqjid;
private List<AttGroupBinPunchMode> kqzdkfslist = new ArrayList<AttGroupBinPunchMode>();
private List<AttGroupBinPunchMode> kqzdkfslist;
}
\ No newline at end of file
package cn.timer.api.dto.kqmk;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class BalanceSheetDataDto {
@ApiModelProperty(value = "假期规则id", example = "字段说明")
private Integer leaverulesid;
@ApiModelProperty(value = "余额天数 ", example = "字段说明")
private Integer balancedays;
}
package cn.timer.api.dto.kqmk;
import java.util.List;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class EmployeeLeaveBalanceDto {
@ApiModelProperty(value = "员工工号 ", example = "字段说明")
private Integer empnum;
@ApiModelProperty(value = "员工名称 ", example = "字段说明")
private String empname;
@ApiModelProperty(value = "部门 ", example = "字段说明")
private String department;
@ApiModelProperty(value = "入职日期 ", example = "字段说明")
private String rztime;
@ApiModelProperty(value = "表数据", example = "字段说明")
List<BalanceSheetDataDto> balanceTo;
}
......@@ -28,7 +28,7 @@ public class KqglAssoLeaveRulesDto {
private Integer leaveType;
@ApiModelProperty(value = "适用范围 ", example = "0:全公司 -1:考勤组id")
private String apply;
private Integer apply;
@ApiModelProperty(value = "创建时间 创建时间", example = "101")
private Long createTime;
......@@ -47,5 +47,8 @@ public class KqglAssoLeaveRulesDto {
@ApiModelProperty(value = "适用范围集合", example = "101")
private String[] range;
@ApiModelProperty(value = "适用范围名称", example = "101")
private String[] applyrange;
}
\ No newline at end of file
......@@ -20,8 +20,8 @@ public class KqglAssoOvertimeRulesDto {
@ApiModelProperty(value = "规则名称 ", example = "以审批时间计算加班")
private String name;
@ApiModelProperty(value = "应用范围", example = "1")
private String appliedScope;
@ApiModelProperty(value = "应用范围", example = "(0:全公司 >0:考勤组id)")
private Integer appliedScope;
@ApiModelProperty(value = "工作日是否允许加班 0:否;1:是", example = "1")
private Integer isWorkovertime;
......
......@@ -74,6 +74,9 @@ public class KqglMainKqzDto {
@ApiModelProperty(value = "外勤 外勤", example = "101")
private Integer isWq;
@ApiModelProperty(value="加班规则 加班规则",example="101")
private Integer overtimeRulesId;
@ApiModelProperty(value = "考勤组人员数", example = "100")
......
package cn.timer.api.dto.kqmk;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class KqzAttendanceGroupSearchDto implements Serializable {
private static final long serialVersionUID = 4927912739465404926L;
private String overall;
private Integer qyid;
}
package cn.timer.api.dto.kqmk;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SetConditionsDto {
private Integer id;
private Integer parameters;
}
package cn.timer.api.dto.qyzx;
import cn.timer.api.dto.spmk.MySummaryQueryDto;
import cn.timer.api.utils.Page;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class QyzxOperLogQuaryDto extends Page{
@ApiModelProperty(value = "标题/操作人员/编号", example = "1")
private String query;
@ApiModelProperty(value="企业id",example="101")
private Integer orgCode;
@ApiModelProperty(value="业务类型(0其它 1新增 2修改 3删除)",example="101")
private Integer businessType;
@ApiModelProperty(value="操作类别(0其它 1后台用户 2手机端用户)",example="101")
private Integer operatorType;
@ApiModelProperty(value="请求方式",example="请求方式")
private String requestMethod;
@ApiModelProperty(value = "开始时间 ", example = "2000-10-10 10:10:10")
private String startTime;
@ApiModelProperty(value = "结束时间 ", example = "2020-10-10 10:10:10")
private String endTime;
}
......@@ -8,6 +8,11 @@ package cn.timer.api.dto.yggl;
import java.io.Serializable;
import java.util.Date;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import cn.timer.api.config.exception.ValidationMsg;
import cn.timer.api.utils.Page;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
......@@ -28,30 +33,39 @@ public class AddygdaDto extends Page implements Serializable{
private static final long serialVersionUID = -1230023773946170942L;
@NotBlank(message = ValidationMsg.NOTBLANK)
@ApiModelProperty(value="员工姓名",example="华仔")
private String name;
@NotBlank(message = ValidationMsg.NOTBLANK)
@ApiModelProperty(value="手机号",example="101")
private String phone;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value="证件类型 0:身份证;1:港澳居民来往内地通行证;2:台湾居民来往大陆通行证;3:外国护照;4:其他",example="0")
private Integer zjType;
@NotBlank(message = ValidationMsg.NOTBLANK)
@ApiModelProperty(value="证件号码 ",example="证件号码")
private String zjNum;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value="工作性质 0全职、1实习生、2兼职、3劳务派遣、4劳务、5派遣、6外包、7退休返聘",example="0")
private Integer jobType;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value="入职日期 ",example="客户注册后的时间为入职时间")
private Date rzTime;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value="试用期 0:无试用期;1:1个月;2:2个月;3:3个月;4:4个月;5:5个月;6:6个月(有试用期显示选项)",example="0")
private Integer syq;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value="性别 0:男;1:女",example="0")
private Integer sex;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value="部门岗位id",example="0")
private Integer bmgwId;
......
......@@ -61,7 +61,7 @@ public class YgDrjqbDto {
@ApiModelProperty(value="员工状态 ",example="1")
private String jobStatus;
@ApiModelProperty(value="入职日期 ",example="2020-3-12")
@ApiModelProperty(value="入职日期 ",example="2020-3-12 10:10:10")
private String rzTime;
@ApiModelProperty(value="试用期 ",example="试用期")
......
package cn.timer.api.manager;
import java.util.TimerTask;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import cn.timer.api.utils.SpringUtils;
import cn.timer.api.utils.Threads;
/**
* 异步任务管理器
*
* @author Tang
*/
public class AsyncManager
{
/**
* 操作延迟10毫秒
*/
private final int OPERATE_DELAY_TIME = 10;
/**
* 异步操作任务调度线程池
*/
private ScheduledExecutorService executor = SpringUtils.getBean("scheduledExecutorService");
/**
* 单例模式
*/
private AsyncManager(){}
private static AsyncManager me;
static {
me = new AsyncManager();
}
public static AsyncManager me()
{
return me;
}
/**
* 执行任务
*
* @param task 任务
*/
public void execute(TimerTask task)
{
executor.schedule(task, OPERATE_DELAY_TIME, TimeUnit.MILLISECONDS);
}
/**
* 停止任务线程池
*/
public void shutdown()
{
Threads.shutdownAndAwaitTermination(executor);
}
}
package cn.timer.api.manager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import javax.annotation.PreDestroy;
/**
* 确保应用退出时能关闭后台线程
*
* @author Tang
*/
@Component
public class ShutdownManager
{
private static final Logger logger = LoggerFactory.getLogger("sys-user");
@PreDestroy
public void destroy()
{
shutdownAsyncManager();
}
/**
* 停止异步执行任务
*/
private void shutdownAsyncManager()
{
try
{
logger.info("====关闭后台任务任务线程池====");
AsyncManager.me().shutdown();
}
catch (Exception e)
{
logger.error(e.getMessage(), e);
}
}
}
package cn.timer.api.manager.factory;
import java.util.TimerTask;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import cn.hutool.extra.spring.SpringUtil;
import cn.timer.api.bean.qyzx.QyzxOperLog;
import cn.timer.api.controller.qyzx.service.QyzxOperLogService;
import cn.timer.api.utils.AddressUtils;
import cn.timer.api.utils.SpringUtils;
/**
* 异步工厂(产生任务用)
*
* @author Tang
*/
public class AsyncFactory
{
/**
* 记录登陆信息
*
* @param username 用户名
* @param status 状态
* @param message 消息
* @param args 列表
* @return 任务task
*/
// public static TimerTask recordLogininfor(final String username, final String status, final String message,final Object... args){}
/**
* 操作日志记录
*
* @param operLog 操作日志信息
* @return 任务task
*/
public static TimerTask recordOper(final QyzxOperLog operLog)
{
return new TimerTask()
{
@Override
public void run()
{
// 远程查询操作地点
operLog.setOperLocation(AddressUtils.getRealAddressByIP(operLog.getOperIp()));
SpringUtils.getBean(QyzxOperLogService.class).insertOperlog(operLog);
}
};
}
}
package cn.timer.api.utils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.alibaba.fastjson.JSONObject;
import cn.hutool.core.util.StrUtil;
/**
* 获取地址类
*
* @author Tang
*/
public class AddressUtils
{
private static final Logger log = LoggerFactory.getLogger(AddressUtils.class);
public static final String IP_URL = "http://ip.taobao.com/service/getIpInfo.php";
public static String getRealAddressByIP(String ip)
{
String address = "XX XX";
// 内网不查询
if (UserIp.internalIp(ip))
{
return "内网IP";
}
String rspStr = HttpUtils.sendPost(IP_URL, "ip=" + ip);
if (StrUtil.isEmpty(rspStr))
{
log.error("获取地理位置异常 {}", ip);
return address;
}
JSONObject obj = JSONObject.parseObject(rspStr);
JSONObject data = obj.getObject("data", JSONObject.class);
String region = data.getString("region");
String city = data.getString("city");
address = region + " " + city;
return address;
}
}
package cn.timer.api.utils;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.ConnectException;
import java.net.SocketTimeoutException;
import java.net.URL;
import java.net.URLConnection;
import java.security.cert.X509Certificate;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSession;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* 通用http发送方法
*
* @author ruoyi
*/
public class HttpUtils
{
private static final Logger log = LoggerFactory.getLogger(HttpUtils.class);
/**
* 向指定 URL 发送GET方法的请求
*
* @param url 发送请求的 URL
* @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
* @return 所代表远程资源的响应结果
*/
public static String sendGet(String url, String param)
{
StringBuilder result = new StringBuilder();
BufferedReader in = null;
try
{
String urlNameString = url + "?" + param;
log.info("sendGet - {}", urlNameString);
URL realUrl = new URL(urlNameString);
URLConnection connection = realUrl.openConnection();
connection.setRequestProperty("accept", "*/*");
connection.setRequestProperty("connection", "Keep-Alive");
connection.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
connection.connect();
in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
String line;
while ((line = in.readLine()) != null)
{
result.append(line);
}
log.info("recv - {}", result);
}
catch (ConnectException e)
{
log.error("调用HttpUtils.sendGet ConnectException, url=" + url + ",param=" + param, e);
}
catch (SocketTimeoutException e)
{
log.error("调用HttpUtils.sendGet SocketTimeoutException, url=" + url + ",param=" + param, e);
}
catch (IOException e)
{
log.error("调用HttpUtils.sendGet IOException, url=" + url + ",param=" + param, e);
}
catch (Exception e)
{
log.error("调用HttpsUtil.sendGet Exception, url=" + url + ",param=" + param, e);
}
finally
{
try
{
if (in != null)
{
in.close();
}
}
catch (Exception ex)
{
log.error("调用in.close Exception, url=" + url + ",param=" + param, ex);
}
}
return result.toString();
}
/**
* 向指定 URL 发送POST方法的请求
*
* @param url 发送请求的 URL
* @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
* @return 所代表远程资源的响应结果
*/
public static String sendPost(String url, String param)
{
PrintWriter out = null;
BufferedReader in = null;
StringBuilder result = new StringBuilder();
try
{
String urlNameString = url + "?" + param;
log.info("sendPost - {}", urlNameString);
URL realUrl = new URL(urlNameString);
URLConnection conn = realUrl.openConnection();
conn.setRequestProperty("accept", "*/*");
conn.setRequestProperty("connection", "Keep-Alive");
conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
conn.setRequestProperty("Accept-Charset", "utf-8");
conn.setRequestProperty("contentType", "utf-8");
conn.setDoOutput(true);
conn.setDoInput(true);
out = new PrintWriter(conn.getOutputStream());
out.print(param);
out.flush();
in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"));
String line;
while ((line = in.readLine()) != null)
{
result.append(line);
}
log.info("recv - {}", result);
}
catch (ConnectException e)
{
log.error("调用HttpUtils.sendPost ConnectException, url=" + url + ",param=" + param, e);
}
catch (SocketTimeoutException e)
{
log.error("调用HttpUtils.sendPost SocketTimeoutException, url=" + url + ",param=" + param, e);
}
catch (IOException e)
{
log.error("调用HttpUtils.sendPost IOException, url=" + url + ",param=" + param, e);
}
catch (Exception e)
{
log.error("调用HttpsUtil.sendPost Exception, url=" + url + ",param=" + param, e);
}
finally
{
try
{
if (out != null)
{
out.close();
}
if (in != null)
{
in.close();
}
}
catch (IOException ex)
{
log.error("调用in.close Exception, url=" + url + ",param=" + param, ex);
}
}
return result.toString();
}
public static String sendSSLPost(String url, String param)
{
StringBuilder result = new StringBuilder();
String urlNameString = url + "?" + param;
try
{
log.info("sendSSLPost - {}", urlNameString);
SSLContext sc = SSLContext.getInstance("SSL");
sc.init(null, new TrustManager[] { new TrustAnyTrustManager() }, new java.security.SecureRandom());
URL console = new URL(urlNameString);
HttpsURLConnection conn = (HttpsURLConnection) console.openConnection();
conn.setRequestProperty("accept", "*/*");
conn.setRequestProperty("connection", "Keep-Alive");
conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
conn.setRequestProperty("Accept-Charset", "utf-8");
conn.setRequestProperty("contentType", "utf-8");
conn.setDoOutput(true);
conn.setDoInput(true);
conn.setSSLSocketFactory(sc.getSocketFactory());
conn.setHostnameVerifier(new TrustAnyHostnameVerifier());
conn.connect();
InputStream is = conn.getInputStream();
BufferedReader br = new BufferedReader(new InputStreamReader(is));
String ret = "";
while ((ret = br.readLine()) != null)
{
if (ret != null && !ret.trim().equals(""))
{
result.append(new String(ret.getBytes("ISO-8859-1"), "utf-8"));
}
}
log.info("recv - {}", result);
conn.disconnect();
br.close();
}
catch (ConnectException e)
{
log.error("调用HttpUtils.sendSSLPost ConnectException, url=" + url + ",param=" + param, e);
}
catch (SocketTimeoutException e)
{
log.error("调用HttpUtils.sendSSLPost SocketTimeoutException, url=" + url + ",param=" + param, e);
}
catch (IOException e)
{
log.error("调用HttpUtils.sendSSLPost IOException, url=" + url + ",param=" + param, e);
}
catch (Exception e)
{
log.error("调用HttpsUtil.sendSSLPost Exception, url=" + url + ",param=" + param, e);
}
return result.toString();
}
private static class TrustAnyTrustManager implements X509TrustManager
{
@Override
public void checkClientTrusted(X509Certificate[] chain, String authType)
{
}
@Override
public void checkServerTrusted(X509Certificate[] chain, String authType)
{
}
@Override
public X509Certificate[] getAcceptedIssuers()
{
return new X509Certificate[] {};
}
}
private static class TrustAnyHostnameVerifier implements HostnameVerifier
{
@Override
public boolean verify(String hostname, SSLSession session)
{
return true;
}
}
}
\ No newline at end of file
package cn.timer.api.utils;
/**
* 处理并记录日志文件
*
* @author ruoyi
*/
public class LogUtils
{
public static String getBlock(Object msg)
{
if (msg == null)
{
msg = "";
}
return "[" + msg.toString() + "]";
}
}
package cn.timer.api.utils;
import java.io.IOException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.StrUtil;
/**
* 客户端工具类
*
* @author ruoyi
*/
public class ServletUtils
{
/**
* 获取String参数
*/
public static String getParameter(String name)
{
return getRequest().getParameter(name);
}
/**
* 获取String参数
*/
public static String getParameter(String name, String defaultValue)
{
return Convert.toStr(getRequest().getParameter(name), defaultValue);
}
/**
* 获取Integer参数
*/
public static Integer getParameterToInt(String name)
{
return Convert.toInt(getRequest().getParameter(name));
}
/**
* 获取Integer参数
*/
public static Integer getParameterToInt(String name, Integer defaultValue)
{
return Convert.toInt(getRequest().getParameter(name), defaultValue);
}
/**
* 获取request
*/
public static HttpServletRequest getRequest()
{
return getRequestAttributes().getRequest();
}
/**
* 获取response
*/
public static HttpServletResponse getResponse()
{
return getRequestAttributes().getResponse();
}
/**
* 获取session
*/
public static HttpSession getSession()
{
return getRequest().getSession();
}
public static ServletRequestAttributes getRequestAttributes()
{
RequestAttributes attributes = RequestContextHolder.getRequestAttributes();
return (ServletRequestAttributes) attributes;
}
/**
* 将字符串渲染到客户端
*
* @param response 渲染对象
* @param string 待渲染的字符串
* @return null
*/
public static String renderString(HttpServletResponse response, String string)
{
try
{
response.setStatus(200);
response.setContentType("application/json");
response.setCharacterEncoding("utf-8");
response.getWriter().print(string);
}
catch (IOException e)
{
e.printStackTrace();
}
return null;
}
/**
* 是否是Ajax异步请求
*
* @param request
*/
public static boolean isAjaxRequest(HttpServletRequest request)
{
String accept = request.getHeader("accept");
if (accept != null && accept.indexOf("application/json") != -1)
{
return true;
}
String xRequestedWith = request.getHeader("X-Requested-With");
if (xRequestedWith != null && xRequestedWith.indexOf("XMLHttpRequest") != -1)
{
return true;
}
String uri = request.getRequestURI();
if (StrUtil.containsAnyIgnoreCase(uri, ".json", ".xml"))
{
return true;
}
String ajax = request.getParameter("__ajax");
if (StrUtil.containsAnyIgnoreCase(ajax, "json", "xml"))
{
return true;
}
return false;
}
}
package cn.timer.api.utils;
import org.springframework.aop.framework.AopContext;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.stereotype.Component;
/**
* spring工具类 方便在非spring管理环境中获取bean
*
* @author ruoyi
*/
@Component
public final class SpringUtils implements BeanFactoryPostProcessor
{
/** Spring应用上下文环境 */
private static ConfigurableListableBeanFactory beanFactory;
@Override
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException
{
SpringUtils.beanFactory = beanFactory;
}
/**
* 获取对象
*
* @param name
* @return Object 一个以所给名字注册的bean的实例
* @throws org.springframework.beans.BeansException
*
*/
@SuppressWarnings("unchecked")
public static <T> T getBean(String name) throws BeansException
{
return (T) beanFactory.getBean(name);
}
/**
* 获取类型为requiredType的对象
*
* @param clz
* @return
* @throws org.springframework.beans.BeansException
*
*/
public static <T> T getBean(Class<T> clz) throws BeansException
{
T result = (T) beanFactory.getBean(clz);
return result;
}
/**
* 如果BeanFactory包含一个与所给名称匹配的bean定义,则返回true
*
* @param name
* @return boolean
*/
public static boolean containsBean(String name)
{
return beanFactory.containsBean(name);
}
/**
* 判断以给定名字注册的bean定义是一个singleton还是一个prototype。 如果与给定名字相应的bean定义没有被找到,将会抛出一个异常(NoSuchBeanDefinitionException)
*
* @param name
* @return boolean
* @throws org.springframework.beans.factory.NoSuchBeanDefinitionException
*
*/
public static boolean isSingleton(String name) throws NoSuchBeanDefinitionException
{
return beanFactory.isSingleton(name);
}
/**
* @param name
* @return Class 注册对象的类型
* @throws org.springframework.beans.factory.NoSuchBeanDefinitionException
*
*/
public static Class<?> getType(String name) throws NoSuchBeanDefinitionException
{
return beanFactory.getType(name);
}
/**
* 如果给定的bean名字在bean定义中有别名,则返回这些别名
*
* @param name
* @return
* @throws org.springframework.beans.factory.NoSuchBeanDefinitionException
*
*/
public static String[] getAliases(String name) throws NoSuchBeanDefinitionException
{
return beanFactory.getAliases(name);
}
/**
* 获取aop代理对象
*
* @param invoker
* @return
*/
@SuppressWarnings("unchecked")
public static <T> T getAopProxy(T invoker)
{
return (T) AopContext.currentProxy();
}
}
package cn.timer.api.utils;
import java.util.concurrent.CancellationException;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* 线程相关工具类.
*
* @author Tang
*/
public class Threads
{
private static final Logger logger = LoggerFactory.getLogger(Threads.class);
/**
* sleep等待,单位为毫秒
*/
public static void sleep(long milliseconds)
{
try
{
Thread.sleep(milliseconds);
}
catch (InterruptedException e)
{
return;
}
}
/**
* 停止线程池
* 先使用shutdown, 停止接收新任务并尝试完成所有已存在任务.
* 如果超时, 则调用shutdownNow, 取消在workQueue中Pending的任务,并中断所有阻塞函数.
* 如果仍人超時,則強制退出.
* 另对在shutdown时线程本身被调用中断做了处理.
*/
public static void shutdownAndAwaitTermination(ExecutorService pool)
{
if (pool != null && !pool.isShutdown())
{
pool.shutdown();
try
{
if (!pool.awaitTermination(120, TimeUnit.SECONDS))
{
pool.shutdownNow();
if (!pool.awaitTermination(120, TimeUnit.SECONDS))
{
logger.info("Pool did not terminate");
}
}
}
catch (InterruptedException ie)
{
pool.shutdownNow();
Thread.currentThread().interrupt();
}
}
}
/**
* 打印线程异常信息
*/
public static void printException(Runnable r, Throwable t)
{
if (t == null && r instanceof Future<?>)
{
try
{
Future<?> future = (Future<?>) r;
if (future.isDone())
{
future.get();
}
}
catch (CancellationException ce)
{
t = ce;
}
catch (ExecutionException ee)
{
t = ee.getCause();
}
catch (InterruptedException ie)
{
Thread.currentThread().interrupt();
}
}
if (t != null)
{
logger.error(t.getMessage(), t);
}
}
}
......@@ -11,6 +11,7 @@ import java.util.regex.Pattern;
import javax.servlet.http.HttpServletRequest;
import cn.hutool.core.util.StrUtil;
import nl.bitwalker.useragentutils.Browser;
import nl.bitwalker.useragentutils.OperatingSystem;
import nl.bitwalker.useragentutils.UserAgent;
......@@ -184,6 +185,125 @@ public class UserIp {
strings[1] = ip;
return strings;
}
/**
* 将IPv4地址转换成字节
*
* @param text IPv4地址
* @return byte 字节
*/
public static byte[] textToNumericFormatV4(String text)
{
if (text.length() == 0)
{
return null;
}
byte[] bytes = new byte[4];
String[] elements = text.split("\\.", -1);
try
{
long l;
int i;
switch (elements.length)
{
case 1:
l = Long.parseLong(elements[0]);
if ((l < 0L) || (l > 4294967295L))
return null;
bytes[0] = (byte) (int) (l >> 24 & 0xFF);
bytes[1] = (byte) (int) ((l & 0xFFFFFF) >> 16 & 0xFF);
bytes[2] = (byte) (int) ((l & 0xFFFF) >> 8 & 0xFF);
bytes[3] = (byte) (int) (l & 0xFF);
break;
case 2:
l = Integer.parseInt(elements[0]);
if ((l < 0L) || (l > 255L))
return null;
bytes[0] = (byte) (int) (l & 0xFF);
l = Integer.parseInt(elements[1]);
if ((l < 0L) || (l > 16777215L))
return null;
bytes[1] = (byte) (int) (l >> 16 & 0xFF);
bytes[2] = (byte) (int) ((l & 0xFFFF) >> 8 & 0xFF);
bytes[3] = (byte) (int) (l & 0xFF);
break;
case 3:
for (i = 0; i < 2; ++i)
{
l = Integer.parseInt(elements[i]);
if ((l < 0L) || (l > 255L))
return null;
bytes[i] = (byte) (int) (l & 0xFF);
}
l = Integer.parseInt(elements[2]);
if ((l < 0L) || (l > 65535L))
return null;
bytes[2] = (byte) (int) (l >> 8 & 0xFF);
bytes[3] = (byte) (int) (l & 0xFF);
break;
case 4:
for (i = 0; i < 4; ++i)
{
l = Integer.parseInt(elements[i]);
if ((l < 0L) || (l > 255L))
return null;
bytes[i] = (byte) (int) (l & 0xFF);
}
break;
default:
return null;
}
}
catch (NumberFormatException e)
{
return null;
}
return bytes;
}
public static boolean internalIp(String ip)
{
byte[] addr = textToNumericFormatV4(ip);
return internalIp(addr) || "127.0.0.1".equals(ip);
}
private static boolean internalIp(byte[] addr)
{
if (StrUtil.isEmptyIfStr(addr) || addr.length < 2)
{
return true;
}
final byte b0 = addr[0];
final byte b1 = addr[1];
// 10.x.x.x/8
final byte SECTION_1 = 0x0A;
// 172.16.x.x/12
final byte SECTION_2 = (byte) 0xAC;
final byte SECTION_3 = (byte) 0x10;
final byte SECTION_4 = (byte) 0x1F;
// 192.168.x.x/16
final byte SECTION_5 = (byte) 0xC0;
final byte SECTION_6 = (byte) 0xA8;
switch (b0)
{
case SECTION_1:
return true;
case SECTION_2:
if (b1 >= SECTION_3 && b1 <= SECTION_4)
{
return true;
}
case SECTION_5:
switch (b1)
{
case SECTION_6:
return true;
}
default:
return false;
}
}
......
......@@ -19,6 +19,7 @@ import cn.timer.api.bean.spmk.SpmkApproveSummary;
import cn.timer.api.bean.spmk.SpmkExecutor;
import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.bean.zzgl.ZzglBmgwM;
import cn.timer.api.config.enuminterface.SpmkEnumInterface.ExecutorSts;
import cn.timer.api.dto.spmk.Condition;
import cn.timer.api.dto.spmk.FlowChildren;
import cn.timer.api.dto.spmk.FromData;
......@@ -289,6 +290,7 @@ public class RouterUtils {
// 审批执行记录 持久化
public static void insertogExecuteRecord(List<FlowChildren> listFlowChildren,Integer asId) throws Exception{
for_insert:
for (int i = 0,m = listFlowChildren.size() ; i < m; i++) {
if (UNEXECUTED.equals(listFlowChildren.get(i).getExecute())) {
i++;
......@@ -315,7 +317,7 @@ public class RouterUtils {
.empNum(Integer.parseInt(user.getId()))
.operatorHeaderUrl(user.getHeadUrl())
.executorName(user.getName())
.sts(2)
.sts(ExecutorSts.AGREE.ordinal())
.build()
.insert();
break;
......@@ -333,7 +335,6 @@ public class RouterUtils {
// 新增 执行人
List<User> listUser = listFlowChildren.get(i).getRelation().get(0).getUsers();
executor:
for (User user2 : listUser) {
SpmkExecutor executor = SpmkExecutor.builder()
.approveExecuteRecordId(aer2.getId())
......@@ -343,16 +344,14 @@ public class RouterUtils {
.build();
switch (user2.getExecute()) {
case EXECUTING:
executor.setSts(1);
executor.setSts(ExecutorSts.IN_EXECUTION.ordinal());
executor.insert();
break executor;
break for_insert;
case EXECUTED:
executor.setSts(2);
executor.setSts(ExecutorSts.AGREE.ordinal());
executor.insert();
break;
}
}
break;
case COPY:
......@@ -378,7 +377,7 @@ public class RouterUtils {
.empNum(Integer.parseInt(user2.getId()))
.executorName(user2.getName())
.operatorHeaderUrl(user2.getHeadUrl())
.sts(2)
.sts(ExecutorSts.AGREE.ordinal())
.build();
executor.insert();
}
......@@ -428,7 +427,7 @@ public class RouterUtils {
// 0未执行 1执行中 2同意 3拒绝 4 转派
if (sts == 3) {
// 更新 审批汇总 状态
SpmkApproveSummary.builder().id(asId).endTime(new Date()).sts(sts).build().updateById();
SpmkApproveSummary.builder().id(asId).currentApprover("").endTime(new Date()).sts(sts).build().updateById();
SpmkApproveExecuteRecord
.builder()
.id(executeRecordId)
......@@ -452,7 +451,7 @@ public class RouterUtils {
.empNum(Integer.parseInt(listUser.get(i_user).getId()))
.executorName(listUser.get(i_user).getName())
.operatorHeaderUrl(listUser.get(i_user).getHeadUrl())
.sts(1)
.sts(ExecutorSts.IN_EXECUTION.ordinal())
.build()
.insert();
hasNextApprover = true;
......@@ -499,7 +498,7 @@ public class RouterUtils {
.empNum(Integer.parseInt(user.getId()))
.executorName(user.getName())
.operatorHeaderUrl(user.getHeadUrl())
.sts(2)
.sts(ExecutorSts.AGREE.ordinal())
.build()
.insert();
......@@ -522,7 +521,7 @@ public class RouterUtils {
.empNum(Integer.parseInt(listUser.get(i_user2).getId()))
.executorName(listUser.get(i_user2).getName())
.operatorHeaderUrl(listUser.get(i_user2).getHeadUrl())
.sts(1)
.sts(ExecutorSts.IN_EXECUTION.ordinal())
.build();
executor.insert();
......@@ -554,7 +553,7 @@ public class RouterUtils {
.empNum(Integer.parseInt(user2.getId()))
.executorName(user2.getName())
.operatorHeaderUrl(user2.getHeadUrl())
.sts(2)
.sts(ExecutorSts.AGREE.ordinal())
.build();
executor.insert();
}
......
......@@ -175,7 +175,7 @@ config-8timer:
one: 3
two: 7
three: 30
init-password: 123456
......@@ -146,4 +146,5 @@ config-8timer:
remind: #合同提醒时间 默认小于等于1天会提醒+三个配置项
one: 3
two: 7
three: 30
\ No newline at end of file
three: 30
init-password: 123456
\ No newline at end of file
......@@ -146,4 +146,5 @@ config-8timer:
remind: #合同提醒时间 默认小于等于1天会提醒+三个配置项
one: 3
two: 7
three: 30
\ No newline at end of file
three: 30
init-password: 123456
\ No newline at end of file
......@@ -29,6 +29,7 @@
<result column="dkfs" property="dkfs" jdbcType="VARCHAR" />
<result column="kqjid" property="kqjid" jdbcType="INTEGER" />
<result column="is_wq" property="isWq" jdbcType="INTEGER" />
<result column="overtime_rules_id" property="overtimeRulesId" />
<collection property="kqzdkfslist" ofType="cn.timer.api.bean.kqgl.AttGroupBinPunchMode">
<result column="kqzId" property="kqzId" jdbcType="INTEGER" />
......@@ -92,7 +93,7 @@
<sql id="Base_Column_List" >
id, name, kqbz, pbfs, qyid, is_fdjjr, kqkssj_time, zsgzsc, zcgzsc, jbzdsc, is_dqtx,
txry, txfs, txxhts, txsj_time, tsfs, is_wpbsdk,sybc,is_xzbcdk,is_wq
txry, txfs, txxhts, txsj_time, tsfs, is_wpbsdk,sybc,is_xzbcdk,is_wq,overtime_rules_id
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
......@@ -180,6 +181,9 @@
<if test="isWq != null" >
is_wq,
</if>
<if test="overtimeRulesId != null" >
overtime_rules_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
......@@ -240,6 +244,9 @@
<if test="isWq != null" >
#{isWq,jdbcType=INTEGER},
</if>
<if test="overtimeRulesId != null" >
#{overtimeRulesId,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="cn.timer.api.bean.kqgl.AttendanceGroup" >
......@@ -302,6 +309,9 @@
<if test="isWq != null" >
is_wq = #{isWq,jdbcType=INTEGER},
</if>
<if test="overtimeRulesId != null" >
overtime_rules_id = #{overtimeRulesId,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
......@@ -325,7 +335,8 @@
is_wpbsdk = #{isWpbsdk,jdbcType=INTEGER},
sybc = #{sybc,jdbcType=VARCHAR},
is_xzbcdk = #{isXzbcdk,jdbcType=INTEGER},
is_wq = #{isWq,jdbcType=INTEGER}
is_wq = #{isWq,jdbcType=INTEGER},
overtime_rules_id = #{overtimeRulesId,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
......
......@@ -147,6 +147,17 @@
luryid KqglAssoBcsz_luryid
</sql>
<select id="selectRosterByKqzid" resultMap="BaseResultMap">
select bcsz.* from kqgl_asso_bcsz bcsz
where bcsz.id in (
select pbmx.bcid from kqgl_asso_pbmx pbmx
where pbmx.kqzid = #{qyid,jdbcType=INTEGER}
<if test="overall != null" >
and SUBSTR(pbmx.`data`,1,7) = #{overall,jdbcType=VARCHAR}
</if>
GROUP BY pbmx.bcid
)
</select>
<insert id="insert" useGeneratedKeys="true" keyProperty="id" parameterType="cn.timer.api.bean.kqmk.KqglAssoBcsz">
......
......@@ -29,6 +29,29 @@
qyid KqglAssoKqzdkfs_qyid,
state KqglAssoKqzdkfs_state
</sql>
<insert id="insertKqglAssokqzdKfsList" parameterType="java.util.List" >
insert into kqgl_asso_kqzdkfs (dkfsid, kqz_id, type, qyid, state)
<foreach collection="list" item="item" index="index" open="values " close="" separator=",">
(
<if test="item.dkfsid != null" >
#{item.dkfsid,jdbcType=INTEGER},
</if>
<if test="item.kqzId != null" >
#{item.kqzId,jdbcType=INTEGER},
</if>
<if test="item.type != null" >
#{item.type,jdbcType=INTEGER},
</if>
<if test="item.qyid != null" >
#{item.qyid,jdbcType=INTEGER},
</if>
<if test="item.state != null" >
#{item.state,jdbcType=INTEGER}
</if>
)
</foreach>
</insert>
<!--
......
......@@ -14,6 +14,18 @@
<result column="modify_timer" property="modifyTimer" />
<result column="modify_number" property="modifyNumber" />
<result column="org_code" property="orgCode" />
<result column="is_automatic" property="isAutomatic" />
</resultMap>
<resultMap id="LeaveBalanceMap" type="cn.timer.api.dto.kqmk.EmployeeLeaveBalanceDto" >
<result column="empnum" property="empnum" />
<result column="empname" property="empname" />
<result column="department" property="department" />
<result column="rztime" property="rztime" />
<collection property="balanceTo" ofType="cn.timer.api.dto.kqmk.BalanceSheetDataDto">
<result column="leaverulesid" property="leaverulesid"/>
<result column="balancedays" property="balancedays"/>
</collection>
</resultMap>
<sql id="Base_Column_List">
......@@ -26,7 +38,8 @@
modify_userid,
modify_timer,
modify_number,
org_code
org_code,
is_automatic
</sql>
<sql id="Base_Column_List_Alias">
......@@ -39,8 +52,32 @@
modify_userid KqglAssoLeaveBalance_modify_userid,
modify_timer KqglAssoLeaveBalance_modify_timer,
modify_number KqglAssoLeaveBalance_modify_number,
org_code KqglAssoLeaveBalance_org_code
org_code KqglAssoLeaveBalance_org_code,
is_automatic KqglAssoLeaveBalance_is_automatic
</sql>
<select id="selectPageByQueryLeaveBalance" resultMap="LeaveBalanceMap">
SELECT emp.emp_num as empnum,
emp.`name` as empname,
IFNULL(c.name,'') as department,
IFNULL(emp.rz_time,'') as rztime,
yz.leave_rules_id as leaverulesid,
yz.balancedays
from yggl_main_emp emp
LEFT JOIN zzgl_bmgw_m as gw on gw.id = emp.bmgw_id
LEFT JOIN zzgl_bmgw_m as c ON c.id = gw.up_id
LEFT JOIN (select bal.leave_rules_id,bal.userid,SUM(bal.balance_days) as balancedays
from kqgl_asso_leave_balance bal
where bal.org_code = #{param.orgCode}
GROUP BY bal.userid,bal.leave_rules_id) as yz on yz.userid = emp.emp_num
where emp.org_code = #{param.orgCode}
<if test="param.query != null and param.query != ''">
and ( emp.`name` like CONCAT('%',#{param.query},'%') or
emp.emp_num like CONCAT('%',#{param.query},'%') or
c.name like CONCAT('%',#{param.query},'%'))
</if>
ORDER BY emp.emp_num DESC
</select>
<!--
......@@ -72,7 +109,10 @@
modify_number,
</if>
<if test ='null != orgCode'>
org_code
org_code,
</if>
<if test ='null != isAutomatic'>
is_automatic
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
......@@ -101,7 +141,10 @@
#{modifyNumber},
</if>
<if test ='null != orgCode'>
#{orgCode}
#{orgCode},
</if>
<if test ='null != isAutomatic'>
#{isAutomatic}
</if>
</trim>
</insert>
......@@ -122,7 +165,8 @@
<if test ='null != modifyUserid'>modify_userid = #{modifyUserid},</if>
<if test ='null != modifyTimer'>modify_timer = #{modifyTimer},</if>
<if test ='null != modifyNumber'>modify_number = #{modifyNumber},</if>
<if test ='null != orgCode'>org_code = #{orgCode}</if>
<if test ='null != orgCode'>org_code = #{orgCode},</if>
<if test ='null != isAutomatic'>is_automatic = #{isAutomatic}</if>
</set>
WHERE id = #{id}
</update>
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.timer.api.dao.kqmk.KqglAssoOvertimeRangeMapper">
<resultMap id="BaseResultMap" type="cn.timer.api.bean.kqmk.KqglAssoOvertimeRange" >
<id column="id" property="id" />
<result column="overtime_rules_id" property="overtimeRulesId" />
<result column="attgroup_id" property="attgroupId" />
</resultMap>
<sql id="Base_Column_List">
id,
overtime_rules_id,
attgroup_id
</sql>
<sql id="Base_Column_List_Alias">
id KqglAssoOvertimeRange_id,
overtime_rules_id KqglAssoOvertimeRange_overtime_rules_id,
attgroup_id KqglAssoOvertimeRange_attgroup_id
</sql>
<insert id="insertovertimerangelist" parameterType="java.util.List" >
insert into kqgl_asso_overtime_range (overtime_rules_id, attgroup_id)
<foreach collection="list" item="item" index="index" open="values " close="" separator=",">
(
<if test="item.overtimeRulesId != null" >
#{item.overtimeRulesId,jdbcType=INTEGER},
</if>
<if test="item.attgroupId != null" >
#{item.attgroupId,jdbcType=INTEGER}
</if>
)
</foreach>
</insert>
<!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.kqmk.KqglAssoOvertimeRange">
INSERT INTO kqgl_asso_overtime_range
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test ='null != overtimeRulesId'>
overtime_rules_id,
</if>
<if test ='null != attgroupId'>
attgroup_id
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test ='null != overtimeRulesId'>
#{overtimeRulesId},
</if>
<if test ='null != attgroupId'>
#{attgroupId}
</if>
</trim>
</insert>
<delete id="delete" >
DELETE FROM kqgl_asso_overtime_range
WHERE id = #{id}
</delete>
<update id="update" parameterType="cn.timer.api.bean.kqmk.KqglAssoOvertimeRange">
UPDATE kqgl_asso_overtime_range
<set>
<if test ='null != overtimeRulesId'>overtime_rules_id = #{overtimeRulesId},</if>
<if test ='null != attgroupId'>attgroup_id = #{attgroupId}</if>
</set>
WHERE id = #{id}
</update>
<select id="load" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM kqgl_asso_overtime_range
WHERE id = #{id}
</select>
<select id="pageList" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM kqgl_asso_overtime_range
LIMIT #{offset}, #{pageSize}
</select>
<select id="pageListCount" resultType="java.lang.Integer">
SELECT count(1)
FROM kqgl_asso_overtime_range
</select>
-->
</mapper>
\ No newline at end of file
......@@ -93,7 +93,42 @@
and pbmx.userid = #{userid}
and pbmx.`data` = #{date}
</select>
<insert id="insertKqglAssoPbmxList" parameterType="java.util.List" >
insert into kqgl_asso_pbmx (userid, data, bcid, kqzid)
<foreach collection="list" item="item" index="index" open="values " close="" separator=",">
(
<if test="item.userid != null" >
#{item.userid,jdbcType=INTEGER},
</if>
<if test="item.data != null" >
#{item.data,jdbcType=DATE},
</if>
<if test="item.bcid != null" >
#{item.bcid,jdbcType=INTEGER},
</if>
<if test="item.kqzid != null" >
#{item.kqzid,jdbcType=INTEGER}
</if>
)
</foreach>
</insert>
<select id="selectAttGroupScheduling" resultMap="AssoPbmxMap">
select pbmx.*,
info.`name` as username,
bcsz.`name` bcname,
SUBSTR(pbmx.`data`,1,7) as yemo,
SUBSTR(pbmx.`data`,9,10) as xsrq
from kqgl_asso_pbmx pbmx
LEFT JOIN yggl_main_emp as info on info.emp_num = pbmx.userid
LEFT JOIN kqgl_asso_bcsz as bcsz on bcsz.id = pbmx.bcid
where info.org_code = #{qyid,jdbcType=INTEGER}
<if test="date != null" >
and SUBSTR(pbmx.`data`,1,7) = #{date,jdbcType=VARCHAR}
</if>
and pbmx.kqzid = #{kqzid,jdbcType=INTEGER}
</select>
<!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.kqmk.KqglAssoPbmx">
......
......@@ -33,6 +33,31 @@
type KqglAssoTeshu_type
</sql>
<insert id="insertKqglAssoTeshuList" parameterType="java.util.List" >
insert into kqgl_asso_teshu (kqzid, tsrq, bcid, lusj_time, luryid, type)
<foreach collection="list" item="item" index="index" open="values " close="" separator=",">
(
<if test="item.kqzid != null" >
#{item.kqzid,jdbcType=INTEGER},
</if>
<if test="item.tsrq != null" >
#{item.tsrq,jdbcType=VARCHAR},
</if>
<if test="item.bcid != null" >
#{item.bcid,jdbcType=INTEGER},
</if>
<if test="item.lusjTime != null" >
#{item.lusjTime,jdbcType=BIGINT},
</if>
<if test="item.luryid != null" >
#{item.luryid,jdbcType=INTEGER},
</if>
<if test="item.type != null" >
#{item.type,jdbcType=INTEGER}
</if>
)
</foreach>
</insert>
<!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.kqmk.KqglAssoTeshu">
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.timer.api.dao.kqmk.KqglAssoYhkqzMapper">
<resultMap id="BaseResultMap" type="cn.timer.api.bean.kqmk.KqglAssoYhkqz" >
<id column="id" property="id" />
<result column="kqzid" property="kqzid" />
<result column="userid" property="userid" />
<result column="qyid" property="qyid" />
</resultMap>
<sql id="Base_Column_List">
id,
kqzid,
userid,
qyid
</sql>
<sql id="Base_Column_List_Alias">
id KqglAssoYhkqz_id,
kqzid KqglAssoYhkqz_kqzid,
userid KqglAssoYhkqz_userid,
qyid KqglAssoYhkqz_qyid
</sql>
<insert id="insertKqglAssoKqzdkfsList" parameterType="java.util.List" >
insert into kqgl_asso_yhkqz (kqzid, userid, qyid)
<foreach collection="list" item="item" index="index" open="values " close="" separator=",">
(
<if test="item.kqzid != null" >
#{item.kqzid,jdbcType=INTEGER},
</if>
<if test="item.userid != null" >
#{item.userid,jdbcType=INTEGER},
</if>
<if test="item.qyid != null" >
#{item.qyid,jdbcType=INTEGER}
</if>
)
</foreach>
</insert>
<!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.kqmk.KqglAssoYhkqz">
INSERT INTO kqgl_asso_yhkqz
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test ='null != kqzid'>
kqzid,
</if>
<if test ='null != userid'>
userid,
</if>
<if test ='null != qyid'>
qyid
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test ='null != kqzid'>
#{kqzid},
</if>
<if test ='null != userid'>
#{userid},
</if>
<if test ='null != qyid'>
#{qyid}
</if>
</trim>
</insert>
<delete id="delete" >
DELETE FROM kqgl_asso_yhkqz
WHERE id = #{id}
</delete>
<update id="update" parameterType="cn.timer.api.bean.kqmk.KqglAssoYhkqz">
UPDATE kqgl_asso_yhkqz
<set>
<if test ='null != kqzid'>kqzid = #{kqzid},</if>
<if test ='null != userid'>userid = #{userid},</if>
<if test ='null != qyid'>qyid = #{qyid}</if>
</set>
WHERE id = #{id}
</update>
<select id="load" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM kqgl_asso_yhkqz
WHERE id = #{id}
</select>
<select id="pageList" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM kqgl_asso_yhkqz
LIMIT #{offset}, #{pageSize}
</select>
<select id="pageListCount" resultType="java.lang.Integer">
SELECT count(1)
FROM kqgl_asso_yhkqz
</select>
-->
</mapper>
\ No newline at end of file
......@@ -23,6 +23,23 @@
type KqglAssoZhoupaiban_type,
bcid KqglAssoZhoupaiban_bcid
</sql>
<insert id="insertKqglAssoZhoupaibanList" parameterType="java.util.List" >
insert into kqgl_asso_zhoupaiban (kqzid, type, bcid)
<foreach collection="list" item="item" index="index" open="values " close="" separator=",">
(
<if test="item.kqzid != null" >
#{item.kqzid,jdbcType=INTEGER},
</if>
<if test="item.type != null" >
#{item.type,jdbcType=INTEGER},
</if>
<if test="item.bcid != null" >
#{item.bcid,jdbcType=INTEGER}
</if>
)
</foreach>
</insert>
<!--
......
......@@ -24,6 +24,7 @@
<result column="sybc" property="sybc" />
<result column="is_xzbcdk" property="isXzbcdk" />
<result column="is_wq" property="isWq" />
<result column="overtime_rules_id" property="overtimeRulesId" />
</resultMap>
<resultMap id="AuxiliaryMap" type="cn.timer.api.dto.kqmk.KqglMainKqzDto" >
......@@ -47,6 +48,7 @@
<result column="sybc" property="sybc" />
<result column="is_xzbcdk" property="isXzbcdk" />
<result column="is_wq" property="isWq" />
<result column="overtime_rules_id" property="overtimeRulesId" />
<result column="kqznum" property="kqznum" />
<result column="pbfsnm" property="pbfsnm" />
......@@ -74,7 +76,8 @@
is_wpbsdk,
sybc,
is_xzbcdk,
is_wq
is_wq,
overtime_rules_id
</sql>
<sql id="Base_Column_List_Alias">
......@@ -97,7 +100,8 @@
is_wpbsdk KqglMainKqz_is_wpbsdk,
sybc KqglMainKqz_sybc,
is_xzbcdk KqglMainKqz_is_xzbcdk,
is_wq KqglMainKqz_is_wq
is_wq KqglMainKqz_is_wq,
overtime_rules_id KqglMainKqz_overtime_rules_id
</sql>
<sql id="Base_Column_List_a">
......@@ -120,7 +124,8 @@
a.is_wpbsdk,
a.sybc,
a.is_xzbcdk,
a.is_wq
a.is_wq,
a.overtime_rules_id
</sql>
<select id="selectAttGroupMachineByQyid" resultMap="AuxiliaryMap">
......@@ -137,6 +142,31 @@
where kqz.id = (select yhkqz.kqzid from kqgl_asso_yhkqz yhkqz
where yhkqz.userid = #{userid,jdbcType=INTEGER} and yhkqz.qyid = #{qyid,jdbcType=INTEGER})
</select>
<select id="selectPageByQueryKqglMain" resultMap="AuxiliaryMap">
select kqz.*,
case kqz.pbfs
WHEN '1' then '固定排班'
WHEN '2' then '排班制'
else '自由工时'
end as pbfsnm,
znm.kqznum,
dkfs.type
from kqgl_main_kqz kqz
LEFT JOIN (select count(yhkqz.kqzid) as kqznum,
yhkqz.kqzid as kqzid
from kqgl_asso_yhkqz yhkqz
where yhkqz.qyid = #{param.orgCode}
GROUP BY yhkqz.kqzid) as znm on znm.kqzid = kqz.id
LEFT JOIN (select kqzdkfs.kqz_id as kqzId,kqzdkfs.type as type from kqgl_asso_kqzdkfs kqzdkfs
where kqzdkfs.qyid = #{param.orgCode} ) as dkfs on dkfs.kqzId = kqz.id
where 1=1
and kqz.qyid = #{param.orgCode}
<if test="param.query != null and param.query != ''">
and kqz.`name` like CONCAT('%',#{param.query},'%')
</if>
</select>
<!--
......@@ -198,7 +228,10 @@
is_xzbcdk,
</if>
<if test ='null != isWq'>
is_wq
is_wq,
</if>
<if test ='null != overtimeRulesId'>
overtime_rules_id
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
......@@ -257,7 +290,10 @@
#{isXzbcdk},
</if>
<if test ='null != isWq'>
#{isWq}
#{isWq},
</if>
<if test ='null != overtimeRulesId'>
#{overtimeRulesId}
</if>
</trim>
</insert>
......@@ -288,7 +324,8 @@
<if test ='null != isWpbsdk'>is_wpbsdk = #{isWpbsdk},</if>
<if test ='null != sybc'>sybc = #{sybc},</if>
<if test ='null != isXzbcdk'>is_xzbcdk = #{isXzbcdk},</if>
<if test ='null != isWq'>is_wq = #{isWq}</if>
<if test ='null != isWq'>is_wq = #{isWq},</if>
<if test ='null != overtimeRulesId'>overtime_rules_id = #{overtimeRulesId}</if>
</set>
WHERE id = #{id}
</update>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment