Merge remote-tracking branch 'origin/guoshengxiong' into guoshengxiong
This commit is contained in:
commit
68c6283193
@ -122,7 +122,7 @@ public class LoginController {
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = false, dataType = "String"),
|
||||
})
|
||||
@PostMapping(value = "/workerInfo/login")
|
||||
public Result<WorkerInfo> workerInfoLogin(@RequestBody Map<String, Object> map) {
|
||||
public Result<Map<String, Object>> workerInfoLogin(@RequestBody Map<String, Object> map) {
|
||||
return Result.success(systemUserService.workerInfoLogin(map));
|
||||
}
|
||||
|
||||
|
||||
@ -294,7 +294,7 @@ public interface ISystemUserService extends IService<SystemUser> {
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
WorkerInfo workerInfoLogin(Map<String, Object> map);
|
||||
Map<String, Object> workerInfoLogin(Map<String, Object> map);
|
||||
|
||||
/**
|
||||
* 是否项目子账号
|
||||
|
||||
@ -1767,7 +1767,7 @@ public class SystemUserServiceImpl extends ServiceImpl<SystemUserMapper, SystemU
|
||||
}
|
||||
|
||||
@Override
|
||||
public WorkerInfo workerInfoLogin(Map<String, Object> map) {
|
||||
public Map<String, Object> workerInfoLogin(Map<String, Object> map) {
|
||||
String idCard = MapUtils.getString(map, "idCard");
|
||||
String name = MapUtils.getString(map, "name");
|
||||
String projectSn = MapUtils.getString(map, "projectSn");
|
||||
@ -1789,7 +1789,10 @@ public class SystemUserServiceImpl extends ServiceImpl<SystemUserMapper, SystemU
|
||||
throw new OpenAlertException("身份证号和人员姓名不匹配");
|
||||
}
|
||||
}
|
||||
return workerInfos.get(0);
|
||||
WorkerInfo workerInfo = workerInfos.get(0);
|
||||
Map<String, Object> paramMap = new HashMap<>();
|
||||
paramMap.put("workerId", workerInfo.getId());
|
||||
return (Map<String, Object>) workerInfoService.viewWorkerInfoDetail(paramMap).get("workerInfo");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -105,6 +105,9 @@ public class ZtWorkerController {
|
||||
requestMap.put("project_id", "1833149331474493441");
|
||||
requestMap.put("device_numbers", "E03C1CB19B121805,E03C1CB19F7A1805");
|
||||
String post = HttpUtil.post("http://spm3.1357.cn/hewu-api/api/realtime-records", JSON.toJSONString(requestMap));
|
||||
if (!post.contains("[")) {
|
||||
return Result.success(new ArrayList<>());
|
||||
}
|
||||
return Result.success(JSONArray.parseArray(post));
|
||||
}
|
||||
|
||||
|
||||
@ -11,51 +11,67 @@ import lombok.Data;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* @Description: 项目配置
|
||||
* @author: pds
|
||||
* @date: 2020-08-17
|
||||
* @date: 2020-08-17
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("project_config")
|
||||
@ApiModel(value="ProjectConfig实体类",description="ProjectConfig")
|
||||
@ApiModel(value = "ProjectConfig实体类", description = "ProjectConfig")
|
||||
public class ProjectConfig implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value="id")
|
||||
private java.lang.Long id ;
|
||||
/**项目SN*/
|
||||
@Excel(name = "项目SN", width = 15)
|
||||
@ApiModelProperty(value="项目SN")
|
||||
private java.lang.String projectSn ;
|
||||
/**人员定位类型,1卡片,2信标*/
|
||||
@Excel(name = "人员定位类型,1卡片,2信标", width = 15)
|
||||
@ApiModelProperty(value="人员定位类型,1卡片,2信标")
|
||||
private java.lang.Integer positionType ;
|
||||
/**手机打卡是否需要图片,0否,1是*/
|
||||
@Excel(name = "手机打卡是否需要图片,0否,1是", width = 15)
|
||||
@ApiModelProperty(value="手机打卡是否需要图片,0否,1是")
|
||||
private java.lang.Integer phoneClockImageType ;
|
||||
@ApiModelProperty(value = "id")
|
||||
private java.lang.Long id;
|
||||
/**
|
||||
* 项目SN
|
||||
*/
|
||||
@Excel(name = "项目SN", width = 15)
|
||||
@ApiModelProperty(value = "项目SN")
|
||||
private java.lang.String projectSn;
|
||||
/**
|
||||
* 人员定位类型,1卡片,2信标
|
||||
*/
|
||||
@Excel(name = "人员定位类型,1卡片,2信标", width = 15)
|
||||
@ApiModelProperty(value = "人员定位类型,1卡片,2信标")
|
||||
private java.lang.Integer positionType;
|
||||
/**
|
||||
* 手机打卡是否需要图片,0否,1是
|
||||
*/
|
||||
@Excel(name = "手机打卡是否需要图片,0否,1是", width = 15)
|
||||
@ApiModelProperty(value = "手机打卡是否需要图片,0否,1是")
|
||||
private java.lang.Integer phoneClockImageType;
|
||||
|
||||
/**人脸比对分数,0-100*/
|
||||
/**
|
||||
* 人脸比对分数,0-100
|
||||
*/
|
||||
@Excel(name = "人脸比对分数,0-100", width = 15)
|
||||
@ApiModelProperty(value="人脸比对分数,0-100")
|
||||
private java.lang.Integer faceScore ;
|
||||
@ApiModelProperty(value = "人脸比对分数,0-100")
|
||||
private java.lang.Integer faceScore;
|
||||
|
||||
/**手机录入人员是否需要审核,1是,0否*/
|
||||
/**
|
||||
* 手机录入人员是否需要审核,1是,0否
|
||||
*/
|
||||
@Excel(name = "手机录入人员是否需要审核,1是,0否", width = 15)
|
||||
@ApiModelProperty(value="手机录入人员是否需要审核,1是,0否")
|
||||
private java.lang.Integer workerAuditType ;
|
||||
@ApiModelProperty(value = "手机录入人员是否需要审核,1是,0否")
|
||||
private java.lang.Integer workerAuditType;
|
||||
|
||||
@Excel(name = "是否是深圳项目,1是,0否", width = 15)
|
||||
@ApiModelProperty(value="是否是深圳项目,1是,0否")
|
||||
private java.lang.Integer isSzProject ;
|
||||
@ApiModelProperty(value = "是否是深圳项目,1是,0否")
|
||||
private java.lang.Integer isSzProject;
|
||||
|
||||
@Excel(name = "是否是深圳项目,1是,0否", width = 15)
|
||||
@ApiModelProperty(value="外部平台项目审核状态,1待审核,2审核通过,3驳回")
|
||||
private java.lang.Integer projectAuditStatus ;
|
||||
@ApiModelProperty(value = "外部平台项目审核状态,1待审核,2审核通过,3驳回")
|
||||
private java.lang.Integer projectAuditStatus;
|
||||
|
||||
@Excel(name = "是否启用移动考勤,1是,0否", width = 15)
|
||||
@ApiModelProperty(value = "是否启用移动考勤,1是,0否")
|
||||
private java.lang.Integer isMobileAttendance;
|
||||
}
|
||||
|
||||
@ -119,5 +119,20 @@ public class WorkerAttendanceRuleController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 通过i查询
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "劳务管理",operType = "查询考勤规则信息",operDesc = "查询考勤规则信息")
|
||||
@ApiOperation(value = "查询考勤规则信息", notes = "查询考勤规则信息", httpMethod = "POST")
|
||||
@ApiImplicitParam(name = "id", value = "考勤规则ID", paramType = "body", required = true, dataType = "Integer")
|
||||
@PostMapping(value = "/queryById")
|
||||
public Result<WorkerAttendanceRule> queryById(@RequestBody Map<String,Object> map) {
|
||||
Result<WorkerAttendanceRule> result = new Result<WorkerAttendanceRule>();
|
||||
WorkerAttendanceRule workerAttendanceRule = workerAttendanceRuleService.getById(MapUtils.getString(map,"id"));
|
||||
result.setSuccess(true);
|
||||
result.setResult(workerAttendanceRule);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@ -60,6 +60,17 @@ public class WorkerMonthAttendanceStatisticsController {
|
||||
return Result.success(workerMonthAttendanceStatisticsService.selectMonthAttendanceByPage(map));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询人员考勤统计列表", notes = "查询人员考勤统计列表", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "workerId", value = "人员ID", paramType = "body", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "monthTime", value = "日期 格式2020-08", paramType = "body", required = true, dataType = "String"),
|
||||
})
|
||||
@PostMapping(value = "/selectMonthAttendanceByWorkerId")
|
||||
public Result<EntityMap> selectMonthAttendanceByWorkerId(@RequestBody Map<String,Object> map) {
|
||||
return Result.success(workerMonthAttendanceStatisticsService.selectMonthAttendanceByWorkerId(map));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询人员指定月份考勤统计", notes = "查询人员指定月份考勤统计", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "personSn", value = "人员唯一标识", paramType = "body", required = true, dataType = "String"),
|
||||
|
||||
@ -133,6 +133,11 @@ public class WorkerAttendance implements Serializable {
|
||||
*/
|
||||
@ApiModelProperty(value = "辅助考勤(补卡)原因")
|
||||
private java.lang.String reissueCardReason;
|
||||
/**
|
||||
* 打卡地址
|
||||
*/
|
||||
@ApiModelProperty(value = "打卡地址")
|
||||
private java.lang.String address;
|
||||
|
||||
/**
|
||||
* 出入时间的小时
|
||||
|
||||
@ -11,72 +11,108 @@ import lombok.Data;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* @Description: 考勤规则
|
||||
* @author: pds
|
||||
* @date: 2020-09-24
|
||||
* @date: 2020-09-24
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("worker_attendance_rule")
|
||||
@ApiModel(value="WorkerAttendanceRule实体类",description="WorkerAttendanceRule")
|
||||
@ApiModel(value = "WorkerAttendanceRule实体类", description = "WorkerAttendanceRule")
|
||||
public class WorkerAttendanceRule implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value="id")
|
||||
private java.lang.Long id ;
|
||||
/**项目sn*/
|
||||
@Excel(name = "项目sn", width = 15)
|
||||
@ApiModelProperty(value="项目sn")
|
||||
private java.lang.String projectSn ;
|
||||
/**规则名称*/
|
||||
@Excel(name = "规则名称", width = 15)
|
||||
@ApiModelProperty(value="规则名称")
|
||||
private java.lang.String ruleName ;
|
||||
/**开始上班时间*/
|
||||
@Excel(name = "开始上班时间", width = 15)
|
||||
@ApiModelProperty(value="开始上班时间")
|
||||
private java.lang.String startTime ;
|
||||
/**结束上班时间*/
|
||||
@Excel(name = "结束上班时间", width = 15)
|
||||
@ApiModelProperty(value="结束上班时间")
|
||||
private java.lang.String endTime ;
|
||||
/**迟到多久不算迟到*/
|
||||
@Excel(name = "迟到多久不算迟到", width = 15)
|
||||
@ApiModelProperty(value="迟到多久不算迟到")
|
||||
private java.lang.Integer notLater ;
|
||||
/**迟到多久算旷工*/
|
||||
@Excel(name = "迟到多久算旷工", width = 15)
|
||||
@ApiModelProperty(value="迟到多久算旷工")
|
||||
private java.lang.Integer yesLater ;
|
||||
/**早退多久不算早退*/
|
||||
@Excel(name = "早退多久不算早退", width = 15)
|
||||
@ApiModelProperty(value="早退多久不算早退")
|
||||
private java.lang.Integer notAdvance ;
|
||||
/**早退多久算旷工*/
|
||||
@Excel(name = "早退多久算旷工", width = 15)
|
||||
@ApiModelProperty(value="早退多久算旷工")
|
||||
private java.lang.Integer yesAdvance ;
|
||||
/**是否启用加班*/
|
||||
@Excel(name = "是否启用加班", width = 15)
|
||||
@ApiModelProperty(value="是否启用加班")
|
||||
private java.lang.Integer yesOrNotOvertime ;
|
||||
/**几点之后算加班*/
|
||||
@Excel(name = "几点之后算加班", width = 15)
|
||||
@ApiModelProperty(value="几点之后算加班")
|
||||
private java.lang.String overtimeDate ;
|
||||
/**是否需要中午外出,0否,1是*/
|
||||
@Excel(name = "是否需要中午外出,0否,1是", width = 15)
|
||||
@ApiModelProperty(value="是否需要中午外出,0否,1是")
|
||||
private java.lang.Integer isRest ;
|
||||
/**上午下班时间*/
|
||||
@Excel(name = "上午下班时间", width = 15)
|
||||
@ApiModelProperty(value="上午下班时间")
|
||||
private java.lang.String morningEndTime ;
|
||||
/**下午上班时间*/
|
||||
@Excel(name = "下午上班时间", width = 15)
|
||||
@ApiModelProperty(value="下午上班时间")
|
||||
private java.lang.String afternoonStartTime ;
|
||||
@ApiModelProperty(value = "id")
|
||||
private java.lang.Long id;
|
||||
/**
|
||||
* 项目sn
|
||||
*/
|
||||
@Excel(name = "项目sn", width = 15)
|
||||
@ApiModelProperty(value = "项目sn")
|
||||
private java.lang.String projectSn;
|
||||
/**
|
||||
* 规则名称
|
||||
*/
|
||||
@Excel(name = "规则名称", width = 15)
|
||||
@ApiModelProperty(value = "规则名称")
|
||||
private java.lang.String ruleName;
|
||||
/**
|
||||
* 开始上班时间
|
||||
*/
|
||||
@Excel(name = "开始上班时间", width = 15)
|
||||
@ApiModelProperty(value = "开始上班时间")
|
||||
private java.lang.String startTime;
|
||||
/**
|
||||
* 结束上班时间
|
||||
*/
|
||||
@Excel(name = "结束上班时间", width = 15)
|
||||
@ApiModelProperty(value = "结束上班时间")
|
||||
private java.lang.String endTime;
|
||||
/**
|
||||
* 迟到多久不算迟到
|
||||
*/
|
||||
@Excel(name = "迟到多久不算迟到", width = 15)
|
||||
@ApiModelProperty(value = "迟到多久不算迟到")
|
||||
private java.lang.Integer notLater;
|
||||
/**
|
||||
* 迟到多久算旷工
|
||||
*/
|
||||
@Excel(name = "迟到多久算旷工", width = 15)
|
||||
@ApiModelProperty(value = "迟到多久算旷工")
|
||||
private java.lang.Integer yesLater;
|
||||
/**
|
||||
* 早退多久不算早退
|
||||
*/
|
||||
@Excel(name = "早退多久不算早退", width = 15)
|
||||
@ApiModelProperty(value = "早退多久不算早退")
|
||||
private java.lang.Integer notAdvance;
|
||||
/**
|
||||
* 早退多久算旷工
|
||||
*/
|
||||
@Excel(name = "早退多久算旷工", width = 15)
|
||||
@ApiModelProperty(value = "早退多久算旷工")
|
||||
private java.lang.Integer yesAdvance;
|
||||
/**
|
||||
* 是否启用加班
|
||||
*/
|
||||
@Excel(name = "是否启用加班", width = 15)
|
||||
@ApiModelProperty(value = "是否启用加班")
|
||||
private java.lang.Integer yesOrNotOvertime;
|
||||
/**
|
||||
* 几点之后算加班
|
||||
*/
|
||||
@Excel(name = "几点之后算加班", width = 15)
|
||||
@ApiModelProperty(value = "几点之后算加班")
|
||||
private java.lang.String overtimeDate;
|
||||
/**
|
||||
* 是否需要中午外出,0否,1是
|
||||
*/
|
||||
@Excel(name = "是否需要中午外出,0否,1是", width = 15)
|
||||
@ApiModelProperty(value = "是否需要中午外出,0否,1是")
|
||||
private java.lang.Integer isRest;
|
||||
/**
|
||||
* 上午下班时间
|
||||
*/
|
||||
@Excel(name = "上午下班时间", width = 15)
|
||||
@ApiModelProperty(value = "上午下班时间")
|
||||
private java.lang.String morningEndTime;
|
||||
/**
|
||||
* 下午上班时间
|
||||
*/
|
||||
@Excel(name = "下午上班时间", width = 15)
|
||||
@ApiModelProperty(value = "下午上班时间")
|
||||
private java.lang.String afternoonStartTime;
|
||||
|
||||
/**
|
||||
* 是否启用一天一打卡(1:启用;0:不启用;)
|
||||
*/
|
||||
@Excel(name = "是否启用一天一打卡(1:启用;0:不启用;)", width = 15)
|
||||
@ApiModelProperty(value = "是否启用一天一打卡(1:启用;0:不启用;)")
|
||||
private java.lang.Integer onceAttendance;
|
||||
}
|
||||
|
||||
@ -28,6 +28,8 @@ public interface WorkerMonthAttendanceStatisticsMapper extends BaseMapper<Worker
|
||||
*/
|
||||
List<EntityMap> selectMonthAttendanceByPage(Page<EntityMap> page, @Param("param") Map<String, Object> map);
|
||||
|
||||
EntityMap selectMonthAttendanceByWorkerId( @Param("param") Map<String, Object> map);
|
||||
|
||||
/**
|
||||
* 更新人员考勤统计
|
||||
*
|
||||
|
||||
@ -10,6 +10,7 @@
|
||||
a.pass_type,
|
||||
a.project_sn,
|
||||
a.temperature,
|
||||
a.address,
|
||||
IF(a.image_url IS NOT NULL, a.image_url, b.id_card_big_photo_url) image_url,
|
||||
b.worker_name,
|
||||
b.id_card
|
||||
|
||||
@ -42,6 +42,24 @@
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectMonthAttendanceByWorkerId" resultType="com.zhgd.jeecg.common.mybatis.EntityMap">
|
||||
select
|
||||
a.worker_name,a.id_card,a.project_sn,a.person_sn,a.person_type, c.query_time,a.inService_type,
|
||||
day1, day2, day3,
|
||||
day4, day5, day6, day7, day8, day9, day10, day11, day12, day13, day14, day15, day16,
|
||||
day17, day18, day19, day20, day21, day22, day23, day24, day25, day26, day27, day28,
|
||||
IF(29>DAY(last_day(str_to_date(CONCAT(#{param.monthTime},'-01'),'%Y-%m-%d'))),NULL,day29) day29,
|
||||
IF(30>DAY(last_day(str_to_date(CONCAT(#{param.monthTime},'-01'),'%Y-%m-%d'))),NULL,day30) day30,
|
||||
IF(31>DAY(last_day(str_to_date(CONCAT(#{param.monthTime},'-01'),'%Y-%m-%d'))),NULL,day31) day31
|
||||
from worker_info a
|
||||
LEFT JOIN worker_month_attendance_statistics c ON a.person_sn=c.person_sn AND c.query_time=#{param.monthTime}
|
||||
where a.project_sn=#{param.projectSn}
|
||||
<if test="param.workerId != null and param.workerId != ''">
|
||||
and a.id=#{param.workerId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectWorkerMonthAttendanceTotal" resultType="com.zhgd.jeecg.common.mybatis.EntityMap">
|
||||
select a.worker_name,
|
||||
a.id_card,
|
||||
|
||||
@ -26,6 +26,7 @@ public interface IWorkerMonthAttendanceStatisticsService extends IService<Worker
|
||||
*/
|
||||
IPage<EntityMap> selectMonthAttendanceByPage(Map<String, Object> map);
|
||||
|
||||
EntityMap selectMonthAttendanceByWorkerId(Map<String, Object> map);
|
||||
/**
|
||||
* 统计前一天的考勤状况
|
||||
*
|
||||
|
||||
@ -515,6 +515,7 @@ public class WorkerAttendanceServiceImpl extends ServiceImpl<WorkerAttendanceMap
|
||||
workerAttendance.setAttendanceType(1);
|
||||
workerAttendance.setCardType(7);
|
||||
workerAttendance.setImageUrl(MapUtils.getString(map, "photoUrl"));
|
||||
workerAttendance.setAddress(MapUtils.getString(map, "address"));
|
||||
workerAttendanceMapper.insert(workerAttendance);
|
||||
if (environmentUtil.isJlwProd()) {
|
||||
// 向政务平台发送数据
|
||||
|
||||
@ -106,6 +106,27 @@ public class WorkerMonthAttendanceStatisticsServiceImpl extends ServiceImpl<Work
|
||||
return page.setRecords(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityMap selectMonthAttendanceByWorkerId(Map<String, Object> map) {
|
||||
EntityMap entityMap = workerMonthAttendanceStatisticsMapper.selectMonthAttendanceByWorkerId(map);
|
||||
Integer type = MapUtils.getInteger(map, "type");
|
||||
if (Objects.equals(type, 1)) {
|
||||
//1只显示出勤和未出勤(除了未出勤就是出勤),0无考勤,1、正常 2、迟到 3、早退 4、加班5、缺卡
|
||||
for (Map.Entry<String, Object> entry : entityMap.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
if (StringUtils.startsWith(key, "day")) {
|
||||
if (entry.getValue() != null) {
|
||||
Integer value = (Integer) entry.getValue();
|
||||
if (!Objects.equals(value, 0)) {
|
||||
entityMap.put(key, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return entityMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EntityMap> selectProjectMonthAttendanceList(HashMap<String, Object> param) {
|
||||
return workerMonthAttendanceStatisticsMapper.selectProjectMonthAttendanceList(param);
|
||||
@ -562,13 +583,15 @@ public class WorkerMonthAttendanceStatisticsServiceImpl extends ServiceImpl<Work
|
||||
//如果中午有休息
|
||||
int notLater = 0; //迟到多久不算迟到
|
||||
int notAdvance = 0; //早退多久不算早退
|
||||
int yesAdvance = 0; //早退多久算旷工
|
||||
int yesLater = 0; //迟到多久算旷工
|
||||
WorkerAttendanceRule attendanceRule = null;
|
||||
if (workerAttendanceRuleId != null) {
|
||||
attendanceRule = workerAttendanceRuleMapper.selectById(workerAttendanceRuleId);
|
||||
}
|
||||
if (attendanceRule == null) {
|
||||
startTimes = "09:00";
|
||||
endTimes = "17:00";
|
||||
endTimes = "18:00";
|
||||
} else {
|
||||
startTimes = attendanceRule.getStartTime();
|
||||
endTimes = attendanceRule.getEndTime();
|
||||
@ -576,7 +599,7 @@ public class WorkerMonthAttendanceStatisticsServiceImpl extends ServiceImpl<Work
|
||||
startTimes = "09:00";
|
||||
}
|
||||
if (StringUtils.isEmpty(endTimes)) {
|
||||
endTimes = "09:00";
|
||||
endTimes = "18:00";
|
||||
}
|
||||
if (attendanceRule.getNotLater() != null) {
|
||||
notLater = attendanceRule.getNotLater();
|
||||
@ -584,34 +607,68 @@ public class WorkerMonthAttendanceStatisticsServiceImpl extends ServiceImpl<Work
|
||||
if (attendanceRule.getNotAdvance() != null) {
|
||||
notAdvance = attendanceRule.getNotAdvance();
|
||||
}
|
||||
if (attendanceRule.getYesAdvance() != null) {
|
||||
yesAdvance = attendanceRule.getYesAdvance();
|
||||
}
|
||||
}
|
||||
//判断进和出时间是否都有
|
||||
if (StringUtils.isEmpty(maxTime) || StringUtils.isEmpty(minTime)) {
|
||||
attendanceType = 5; //缺卡
|
||||
} else {
|
||||
Date minDate = sdf.parse(minTime);
|
||||
Date maxDate = sdf.parse(maxTime);
|
||||
//计算工作时长
|
||||
if (maxDate.getTime() > minDate.getTime()) {
|
||||
long diff = (maxDate.getTime() - minDate.getTime()) / 1000 / 60;
|
||||
durationNum = (int) diff;
|
||||
}
|
||||
|
||||
Date startDate = sdf.parse(new StringBuilder(passTime).append(" ").append(startTimes).append(":00").toString());
|
||||
if (notLater > 0) {
|
||||
startDate = org.apache.commons.lang.time.DateUtils.addMinutes(startDate, notLater);
|
||||
}
|
||||
Date endDate = sdf.parse(new StringBuilder(passTime).append(" ").append(endTimes).append(":00").toString());
|
||||
if (notAdvance > 0) {
|
||||
endDate = org.apache.commons.lang.time.DateUtils.addMinutes(endDate, -notAdvance);
|
||||
}
|
||||
|
||||
if (minDate.getTime() > startDate.getTime()) {
|
||||
attendanceType = 2; //迟到
|
||||
} else if (maxDate.getTime() < endDate.getTime()) {
|
||||
attendanceType = 3; //早退
|
||||
if (attendanceRule != null && attendanceRule.getOnceAttendance() != null && attendanceRule.getOnceAttendance() == 1) {
|
||||
Date attendanceTime = null;
|
||||
if (StringUtils.isEmpty(maxTime) && StringUtils.isEmpty(minTime)) {
|
||||
attendanceType = 5; //缺卡
|
||||
} else {
|
||||
attendanceType = 1; //正常
|
||||
Date startDate = sdf.parse(new StringBuilder(passTime).append(" ").append(startTimes).append(":00").toString());
|
||||
Date endDate = sdf.parse(new StringBuilder(passTime).append(" ").append(endTimes).append(":00").toString());
|
||||
attendanceTime = StringUtils.isEmpty(maxTime) ? sdf.parse(minTime) : sdf.parse(maxTime);
|
||||
if (attendanceTime.getTime() < startDate.getTime() && attendanceTime.getTime() > endDate.getTime()) {
|
||||
attendanceType = 1; //正常
|
||||
} else {
|
||||
attendanceType = 0; //缺勤
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//判断进和出时间是否都有
|
||||
if (StringUtils.isEmpty(maxTime) || StringUtils.isEmpty(minTime)) {
|
||||
attendanceType = 5; //缺卡
|
||||
} else {
|
||||
Date minDate = sdf.parse(minTime);
|
||||
Date maxDate = sdf.parse(maxTime);
|
||||
//计算工作时长
|
||||
if (maxDate.getTime() > minDate.getTime()) {
|
||||
long diff = (maxDate.getTime() - minDate.getTime()) / 1000 / 60;
|
||||
durationNum = (int) diff;
|
||||
}
|
||||
|
||||
Date startDate = sdf.parse(new StringBuilder(passTime).append(" ").append(startTimes).append(":00").toString());
|
||||
Date yesLaterDate = null;
|
||||
if (yesLater > 0) {
|
||||
yesLaterDate = org.apache.commons.lang.time.DateUtils.addMinutes(startDate, yesLater);
|
||||
}
|
||||
if (notLater > 0) {
|
||||
startDate = org.apache.commons.lang.time.DateUtils.addMinutes(startDate, notLater);
|
||||
}
|
||||
Date endDate = sdf.parse(new StringBuilder(passTime).append(" ").append(endTimes).append(":00").toString());
|
||||
Date yesAdvanceDate = null;
|
||||
if (yesAdvance > 0) {
|
||||
yesAdvanceDate = org.apache.commons.lang.time.DateUtils.addMinutes(endDate, -yesAdvance);
|
||||
}
|
||||
if (notAdvance > 0) {
|
||||
endDate = org.apache.commons.lang.time.DateUtils.addMinutes(endDate, -notAdvance);
|
||||
}
|
||||
if (yesLaterDate != null && minDate.getTime() > yesLaterDate.getTime()) {
|
||||
attendanceType = 0; //缺勤
|
||||
} else if (minDate.getTime() > endDate.getTime() && maxDate.getTime() > endDate.getTime()) {
|
||||
attendanceType = 0; //缺勤
|
||||
} else if (minDate.getTime() > startDate.getTime()) {
|
||||
attendanceType = 2; //迟到
|
||||
} else if (maxDate.getTime() < endDate.getTime()) {
|
||||
if (yesAdvanceDate != null && maxDate.getTime() < yesAdvanceDate.getTime()) {
|
||||
attendanceType = 0; //缺勤
|
||||
} else {
|
||||
attendanceType = 3; //早退
|
||||
}
|
||||
} else {
|
||||
attendanceType = 1; //正常
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -417,6 +417,15 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
.antMatchers("/xmgl/safetyHatData/allList").permitAll()
|
||||
.antMatchers("/xmgl/api/saveHardWareAlarm").permitAll()
|
||||
.antMatchers("/xmgl/safetyHatData/exportUseHistory").permitAll()
|
||||
.antMatchers("/xmgl/workerAttendance/getPersonAttendanceTime").permitAll()
|
||||
.antMatchers("/xmgl/projectConfig/getProjectConfigList").permitAll()
|
||||
.antMatchers("/xmgl/workerAttendance/addPhoneAttendance").permitAll()
|
||||
.antMatchers("/xmgl/electricFence/checkLocation").permitAll()
|
||||
.antMatchers("/xmgl/workerMonthAttendanceStatistics/selectWorkerMonthAttendanceTotal").permitAll()
|
||||
.antMatchers("/xmgl/workerMonthAttendanceStatistics/selectWorkerMonthAttendanceType").permitAll()
|
||||
.antMatchers("/xmgl/workerMonthAttendanceStatistics/selectMonthAttendanceByWorkerId").permitAll()
|
||||
.antMatchers("/xmgl/workerAttendance/viewDayAttendanceList").permitAll()
|
||||
.antMatchers("/xmgl/workerAttendanceRule/queryById").permitAll()
|
||||
.antMatchers(HttpMethod.OPTIONS, "/**").anonymous()
|
||||
.anyRequest().authenticated() // 剩下所有的验证都需要验证.
|
||||
.and()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user