提交 a011bb5c authored 作者: 李秋林's avatar 李秋林

添加远程调用考勤规则

上级 f53a9da8
package com.sfa.system.api;
import com.sfa.common.core.constant.SecurityConstants;
import com.sfa.common.core.constant.ServiceNameConstants;
import com.sfa.common.core.domain.R;
import com.sfa.system.api.factory.RemoteKqRuleFallbackFactory;
import com.sfa.system.api.pojo.response.MdmKqRuleDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;
/**
* @author : liqiulin
* @date : 2024-11-04 19
* @describe : 考勤规则
*/
@FeignClient(contextId = "RemoteKqRuleService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteKqRuleFallbackFactory.class)
public interface RemoteKqRuleService {
@GetMapping(value = "/system/kq_rule/{ruleId}")
public R<MdmKqRuleDto> getInfo(@PathVariable("ruleId") Long ruleId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}
package com.sfa.system.api.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
......@@ -51,4 +52,10 @@ public class SysLogininfor
@Excel(name = "访问时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date accessTime;
/** 操作开始时间 **/
@TableField(exist = false)
private Date beginTime;
/** 操作结束时间 **/
@TableField(exist = false)
private Date endTime;
}
\ No newline at end of file
package com.sfa.system.api.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
......@@ -21,7 +22,7 @@ import java.util.Date;
@NoArgsConstructor
@AllArgsConstructor
@Data
@TableName(value = "oper_log")
@TableName(value = "sys_oper_log")
public class SysOperLog implements Serializable
{
private static final long serialVersionUID = 1L;
......@@ -40,6 +41,7 @@ public class SysOperLog implements Serializable
private Integer businessType;
/** 业务类型数组 */
@TableField(exist = false)
private Integer[] businessTypes;
/** 请求方法 */
......@@ -95,4 +97,10 @@ public class SysOperLog implements Serializable
@Excel(name = "消耗时间", suffix = "毫秒")
private Long costTime;
/** 操作开始时间 **/
@TableField(exist = false)
private Date beginTime;
/** 操作结束时间 **/
@TableField(exist = false)
private Date endTime;
}
package com.sfa.system.api.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.*;
import com.sfa.common.core.web.domain.BaseDo;
import lombok.Data;
import lombok.NoArgsConstructor;
......@@ -64,29 +61,35 @@ public class SysUser extends BaseDo
private String postName;
/** 考勤规则Id */
@TableField(updateStrategy = FieldStrategy.IGNORED)
private Long ruleId;
/** 考勤名称 */
@TableField(updateStrategy = FieldStrategy.IGNORED)
private String ruleName;
/**
* 工作-省编码
*/
@TableField(updateStrategy = FieldStrategy.IGNORED)
private String workProvinceNum;
/**
* 工作-省名称
*/
@TableField(updateStrategy = FieldStrategy.IGNORED)
private String workProvinceName;
/**
* 工作-市编码
*/
@TableField(updateStrategy = FieldStrategy.IGNORED)
private String workCityNum;
/**
* 工作-市编码
*/
@TableField(updateStrategy = FieldStrategy.IGNORED)
private String workCityName;
/** 帐号状态(0正常 1停用) */
......
package com.sfa.system.api.factory;
import com.sfa.common.core.domain.R;
import com.sfa.system.api.RemoteKqRuleService;
import com.sfa.system.api.pojo.response.MdmKqRuleDto;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
/**
* @author : liqiulin
* @date : 2024-11-04 19
* @describe :考勤规则
*/
@Component
public class RemoteKqRuleFallbackFactory implements FallbackFactory<RemoteKqRuleService> {
private static final Logger log = LoggerFactory.getLogger(RemoteLogFallbackFactory.class);
@Override
public RemoteKqRuleService create(Throwable cause) {
log.error("考勤规则查询信息失败:{}", cause.getMessage());
return new RemoteKqRuleService() {
@Override
public R<MdmKqRuleDto> getInfo(Long ruleId, String source) {
return R.fail("考勤规则查询信息失败:" + cause.getMessage());
}
};
}
}
......@@ -167,4 +167,8 @@ public class UserVo {
/** 备注 */
private String remark;
private Date beginTime;
private Date endTime;
private Boolean existRole;
}
package com.sfa.system.api.pojo.response;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalTime;
/**
* @author : liqiulin
* @date : 2024-10-29 14
* @describe :
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class MdmKqRuleDto {
/** 规则ID */
private Long ruleId;
/** 规则编号 */
private String ruleNum;
/** 规则名称 */
private String ruleName;
/** 上班打卡允许开始时间 */
private LocalTime firBegintime;
/** 上班打卡允许结束时间 */
private LocalTime firEndtime;
/** 午班打卡允许开始时间 */
private LocalTime secBegintime;
/** 午班打卡允许结束时间 */
private LocalTime secEndtime;
/** 下班打卡允许开始时间 */
private LocalTime thiBegintime;
/** 下班打卡允许结束时间 */
private LocalTime thiEndtime;
/** 备注 */
private String remark;
private LocalTime currently;
/** 记录版本 */
private Long flag;
/** 删除标识 */
private String delFlag;
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论