Compare commits
30 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6b18b1651b | ||
|
|
65eab9985b | ||
|
|
526bd7473c | ||
|
|
f8a75bb671 | ||
|
|
7d28cb895f | ||
|
|
ed6d997c41 | ||
|
|
098ab28150 | ||
|
|
a055d211ff | ||
|
|
1a6b582301 | ||
|
|
3cfd1b63ec | ||
|
|
04037fca60 | ||
|
|
896ebc9679 | ||
|
|
a15b5ec75a | ||
|
|
a68ae036b6 | ||
|
|
37323443d3 | ||
|
|
76cf1cfc2b | ||
|
|
fb3c3b44f1 | ||
|
|
967ea6020b | ||
|
|
5242b4f3d3 | ||
|
|
039dc85471 | ||
|
|
13f634ddb8 | ||
|
|
8406cf1eb8 | ||
|
|
5bbd6b02ba | ||
|
|
8eb0a5a58f | ||
|
|
cb1d56c751 | ||
|
|
022bfe4fb4 | ||
|
|
2002d2a45b | ||
|
|
6c1c95352d | ||
|
|
99640b1edc | ||
|
|
31f481a78b |
@ -15,8 +15,6 @@ public class RzSalaryVo {
|
||||
|
||||
@Excel(name = "姓名")
|
||||
private String name;
|
||||
@Excel(name = "身份证号")
|
||||
private String idCard;
|
||||
@Excel(name = "提成金额")
|
||||
private BigDecimal sale;
|
||||
@Excel(name = "日期", width = 30, dateFormat = "yyyy-MM")
|
||||
|
||||
@ -101,20 +101,11 @@ public class KQDeviceExchangeProcessor implements PunchTheClockStrategyExchangeP
|
||||
//如果最后一条数据的卡类型为下班卡,则返回上班卡和加班卡权限 or 检查当前人员是否存在特殊加班中 或者 检查当前人员部门是否开启加班 or 暂时取消这个判定 当天打过加班卡 ( || rzAttendanceDetailMapper.checkOverTimeCard(sysStaff.getUserId(), new Date()) > 0)
|
||||
if(ObjectUtils.isNotEmpty(eqOverStaffMapper.selectEqOverStaffByUserId(sysStaff.getUserId())) || ObjectUtils.isEmpty(sysDeptMapper.selectOne(new LambdaQueryWrapper<SysDept>().eq(SysDept::getDeptId, sysStaff.getDeptId()).eq(SysDept::getIsOverTime,"1")))){
|
||||
//如果存在特殊加班, 或者当前部门没有开启加班 或者当天打过加班, 则无法打加班卡
|
||||
// return initMessage(0,"验证通过", "111000000");
|
||||
return initMessage(0,"验证通过", "000000000");
|
||||
return initMessage(0,"验证通过", "111000000");
|
||||
}
|
||||
//检查最后一条打卡记录是否为钉钉的下班卡, 如果不存在禁止打加班卡
|
||||
// return initMessage(0,"验证通过", "111100000");
|
||||
return initMessage(0,"验证通过", "000100000");
|
||||
return initMessage(0,"验证通过", "111100000");
|
||||
}else{
|
||||
//检查钉钉是否存在今天的下班卡, 和加班卡
|
||||
if("加班卡".equals(rzAttendanceDetail.getButtonType())){
|
||||
return initMessage(0,"验证通过", "000011000");
|
||||
}else{
|
||||
return initMessage(0,"验证通过", "000000000");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -220,13 +211,11 @@ public class KQDeviceExchangeProcessor implements PunchTheClockStrategyExchangeP
|
||||
}
|
||||
|
||||
public Boolean checkToDayCard(String userId, String rules, Date date){
|
||||
//原位getOne, 修正钉钉打打卡后 会出现多条记录, 所以改为list
|
||||
return ObjectUtils.isNotEmpty(rzAttendanceDetailService.list(new LambdaQueryWrapper<RzAttendanceDetail>()
|
||||
return ObjectUtils.isNotEmpty(rzAttendanceDetailService.getOne(new LambdaQueryWrapper<RzAttendanceDetail>()
|
||||
.like(RzAttendanceDetail::getButtonType,"%"+rules+"%")
|
||||
.eq(RzAttendanceDetail::getStaffId, Long.valueOf(userId))
|
||||
.eq(RzAttendanceDetail::getDelFlag, Constants.DELETE_FLAG_0)
|
||||
.apply(" date_format(date_time,'%Y%m%d') = date_format({0},'%Y%m%d') ", date)
|
||||
.orderByDesc(RzAttendanceDetail::getCreateTime)));
|
||||
.apply(" date_format(date_time,'%Y%m%d') = date_format({0},'%Y%m%d') ", date)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -9,6 +9,7 @@ import com.evo.attendance.domain.vo.RzAttendanceDetailTimeLineVO;
|
||||
import com.evo.attendance.mapper.RzAttendanceDetailMapper;
|
||||
import com.evo.attendance.mapper.RzAttendancePhotoMapper;
|
||||
import com.evo.attendance.service.RzAttendanceDetailService;
|
||||
import com.evo.attendance.service.RzAttendancePhotoService;
|
||||
import com.evo.common.constant.Constants;
|
||||
import com.evo.common.core.domain.entity.SysDept;
|
||||
import com.evo.common.utils.Collections;
|
||||
@ -17,11 +18,9 @@ import com.evo.common.utils.ParamUtils;
|
||||
import com.evo.common.utils.StringUtils;
|
||||
import com.evo.personnelMatters.domain.RzLeaveDetail;
|
||||
import com.evo.personnelMatters.mapper.RzLeaveDetailMapper;
|
||||
import com.evo.system.domain.ExceptionNotification;
|
||||
import com.evo.system.domain.SysStaff;
|
||||
import com.evo.system.mapper.SysDeptMapper;
|
||||
import com.evo.system.mapper.SysStaffMapper;
|
||||
import com.evo.system.service.ExceptionNotificationService;
|
||||
import com.evo.wechat.service.SendClientService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
@ -30,11 +29,14 @@ import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 类
|
||||
@ -58,8 +60,7 @@ public class RzAttendanceDetailServiceImpl extends ServiceImpl<RzAttendanceDetai
|
||||
private SysStaffMapper sysStaffMapper;
|
||||
@Autowired
|
||||
private RzAttendancePhotoMapper rzAttendancePhotoMapper;
|
||||
@Autowired
|
||||
private ExceptionNotificationService exceptionNotificationService;
|
||||
|
||||
@Override
|
||||
public RzAttendanceDetail addDetail(RzAttendance attendance, String rules, String sn, Date date, String remark, String photo) {
|
||||
return addOrUpdateDetail("clock_in", attendance,rules,sn,date,remark, photo);
|
||||
@ -79,7 +80,7 @@ public class RzAttendanceDetailServiceImpl extends ServiceImpl<RzAttendanceDetai
|
||||
//.apply( " DATE_FORMAT(date_time,'%Y%m%d') = DATE_FORMAT({0},'%Y%m%d')", date)
|
||||
//以下为特殊规则, 只针对下班卡起作用
|
||||
.orderByAsc("下班卡".equals(rules), RzAttendanceDetail::getDateTime)
|
||||
.last(" limit 1 ")
|
||||
.last("下班卡".equals(rules)," limit 1 ")
|
||||
);
|
||||
}
|
||||
|
||||
@ -149,7 +150,6 @@ public class RzAttendanceDetailServiceImpl extends ServiceImpl<RzAttendanceDetai
|
||||
//查询所有上次打开时间距今天超过3天的员工信息
|
||||
List<Map<String, Object>> threeDayNotCheckList = super.getBaseMapper().getThreeDayNotCheck();
|
||||
if(Collections.isNotEmpty(threeDayNotCheckList)){
|
||||
Long overdueLimit = ParamUtils.overdueLimit();
|
||||
for (Map<String, Object> threeDayNotCheck : threeDayNotCheckList){
|
||||
//用户Id
|
||||
Integer userId = Integer.valueOf(String.valueOf(threeDayNotCheck.get("userId")));
|
||||
@ -178,7 +178,7 @@ public class RzAttendanceDetailServiceImpl extends ServiceImpl<RzAttendanceDetai
|
||||
}
|
||||
|
||||
//剩余时长> 3天, 继续检查请假
|
||||
if(Long.valueOf(holidayDates.size()).compareTo(overdueLimit) > -1){
|
||||
if(holidayDates.size() > 3){
|
||||
//排除假期
|
||||
List<String> leaveDays = Collections.emptyList();
|
||||
for (String holidayDate : holidayDates){
|
||||
@ -200,45 +200,25 @@ public class RzAttendanceDetailServiceImpl extends ServiceImpl<RzAttendanceDetai
|
||||
holidayDates.removeAll(holidays);
|
||||
}
|
||||
//如果假期还是> 3天, 则准备推送
|
||||
if(Long.valueOf(holidayDates.size()).compareTo(overdueLimit) > -1){
|
||||
ExceptionNotification exceptionNotification = exceptionNotificationService.getExceptionNotification(2, holidayDates.size());
|
||||
List<SysStaff> sysStaffList = Collections.emptyList();
|
||||
if(exceptionNotification == null){
|
||||
// 如果异常订阅为空, 默认使用人资办通知
|
||||
sysStaffList.addAll(sysStaffMapper.queryysStaffByDeptId(Collections.asList(28l)));
|
||||
}else{
|
||||
// 异常订阅的信息
|
||||
sysStaffList.addAll(sysStaffMapper.selectList(new LambdaQueryWrapper<>(new SysStaff()).in(SysStaff::getUserId, Collections.asList(exceptionNotification.getUserIds().split(",")))));
|
||||
}
|
||||
if(holidayDates.size() > 3){
|
||||
SysStaff sysStaff = sysStaffMapper.selectById(userId);
|
||||
if(sysStaff != null) {
|
||||
SysDept sysDept = sysDeptMapper.selectById(sysStaff.getDeptId());
|
||||
String deptName = sysDept != null ? sysDept.getDeptName() : "未知";
|
||||
|
||||
for (SysStaff rz : sysStaffList){
|
||||
sendAttendanceDetail(sysStaff.getName(), rz.getName(), deptName, rz.getOpenid());
|
||||
String userName = sysStaff.getName();
|
||||
// 查询人资办人员信息
|
||||
List<SysStaff> rzb = sysStaffMapper.queryysStaffByDeptId(Collections.asList(28l));
|
||||
if(Collections.isNotEmpty(rzb)){
|
||||
for (SysStaff rz : rzb){
|
||||
sendAttendanceDetail(userName, rz.getName(), deptName, rz.getOpenid());
|
||||
}
|
||||
}
|
||||
//查询部门负责人
|
||||
SysStaff leaderSysStaff = sysStaffMapper.selectLeaderSysStaffByDeptId(sysStaff.getDeptId());
|
||||
if(leaderSysStaff != null){
|
||||
sendAttendanceDetail(userName, leaderSysStaff.getName(), deptName, leaderSysStaff.getOpenid());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// SysStaff sysStaff = sysStaffMapper.selectById(userId);
|
||||
// if(sysStaff != null) {
|
||||
// SysDept sysDept = sysDeptMapper.selectById(sysStaff.getDeptId());
|
||||
// String deptName = sysDept != null ? sysDept.getDeptName() : "未知";
|
||||
// String userName = sysStaff.getName();
|
||||
// // 查询人资办人员信息
|
||||
// List<SysStaff> rzb = sysStaffMapper.queryysStaffByDeptId(Collections.asList(28l));
|
||||
// if(Collections.isNotEmpty(rzb)){
|
||||
// for (SysStaff rz : rzb){
|
||||
// sendAttendanceDetail(userName, rz.getName(), deptName, rz.getOpenid());
|
||||
// }
|
||||
// }
|
||||
// //查询部门负责人
|
||||
// SysStaff leaderSysStaff = sysStaffMapper.selectLeaderSysStaffByDeptId(sysStaff.getDeptId());
|
||||
// if(leaderSysStaff != null){
|
||||
// sendAttendanceDetail(userName, leaderSysStaff.getName(), deptName, leaderSysStaff.getOpenid());
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -30,9 +30,6 @@ import com.evo.system.mapper.SysDeptMapper;
|
||||
import com.evo.system.mapper.SysStaffMapper;
|
||||
import com.evo.system.service.ISysStaffService;
|
||||
import com.evo.wechat.service.SendClientService;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
@ -149,19 +146,6 @@ public class RzAttendanceServiceImpl extends ServiceImpl<RzAttendanceMapper, RzA
|
||||
*/
|
||||
@Override
|
||||
public int attendenceCount() {
|
||||
// Map<String, String> addressMap = ParamUtils.checkKqAddressCount();
|
||||
// Map<String, Integer> resultMap = Collections.emptyMap();
|
||||
// ObjectMapper mapper = new ObjectMapper();
|
||||
// addressMap.keySet().stream().forEach(key -> {
|
||||
// try {
|
||||
// Map<String, String> limitMap = mapper.readValue(addressMap.get(key), new TypeReference<Map<String, String>>() {});
|
||||
// limitMap.get()
|
||||
// resultMap.put(key, getBaseMapper().attendenceCount())
|
||||
// } catch (JsonProcessingException e) {
|
||||
// throw new RuntimeException(e);
|
||||
// }
|
||||
// });
|
||||
|
||||
List<RzAttendance> list = getBaseMapper().attendenceCount();
|
||||
return list.size();
|
||||
}
|
||||
@ -553,6 +537,33 @@ public class RzAttendanceServiceImpl extends ServiceImpl<RzAttendanceMapper, RzA
|
||||
JSONObject ob = jsonArray.getJSONObject(i);
|
||||
if(bizId.equals(ob.getString("bizId"))){
|
||||
calculationAddRzOverTime(result, sysStaff, ob, null);
|
||||
// //打卡类型
|
||||
// String checkType = ob.getString("checkType");
|
||||
// //考勤组
|
||||
// String groupId = ob.getString("groupId");
|
||||
// //排班时间
|
||||
// Long planCheckTime = ob.getLong("planCheckTime");
|
||||
// // 格式化:先转Date对象,再格式化
|
||||
// String formatPlanCheckTime = DateUtils.parseDateToStr("HH:mm:ss", new Date(planCheckTime));
|
||||
// //用户打卡时间
|
||||
// Long userCheckTime = ob.getLong("userCheckTime");
|
||||
// //工作时间 (这里指的是哪一天的卡)
|
||||
// Long workDate = ob.getLong("workDate");
|
||||
// /***
|
||||
// * 打卡结果
|
||||
// * Normal:正常
|
||||
// * Early:早退
|
||||
// * Late:迟到
|
||||
// * SeriousLate:严重迟到
|
||||
// * Absenteeism:旷工迟到
|
||||
// * NotSigned:未打卡
|
||||
// */
|
||||
// String timeResult = ob.getString("timeResult");
|
||||
//
|
||||
// Date formatWorkDate = Date.from(Instant.ofEpochMilli(workDate));
|
||||
// Date formatUserCheckTime = Date.from(Instant.ofEpochMilli(userCheckTime));
|
||||
// DingShiftGroup dingsShiftGroup = dingsShiftGroupMapper.selectByGroupIdAndTypeAndCheckTime(groupId, checkType, formatPlanCheckTime);
|
||||
// addRzOverTime(result, sysStaff, dingsShiftGroup, checkType, formatWorkDate, formatUserCheckTime, timeResult, null, 0d);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -587,12 +598,6 @@ public class RzAttendanceServiceImpl extends ServiceImpl<RzAttendanceMapper, RzA
|
||||
attendance.setWorkEndTime(formatUserCheckTime);
|
||||
if("Normal".equals(timeResult) && !"1".equals(attendance.getYcsFlag()) && attendance.getWorkStartTime() != null){
|
||||
attendance.setWorkSum(BigDecimal.valueOf(dingsShift.getWorkHour()));
|
||||
//核验下打卡信息, 如果实际工作时间 < 默认工作时长, 修正为实际工作时长
|
||||
Long hours = (attendance.getWorkEndTime().getTime() - attendance.getWorkStartTime().getTime())/1000/60/60;
|
||||
//如果实际工作时长, 小于设定时长, 存在误差 0.5小时之内, 超出0.5小时, 更新为实际工作时长
|
||||
if(BigDecimal.valueOf(dingsShift.getWorkHour()).compareTo(BigDecimal.valueOf(hours)) > 0 && hours <= (dingsShift.getWorkHour()-0.5)){
|
||||
attendance.setWorkSum(BigDecimal.valueOf(hours));
|
||||
}
|
||||
}else{
|
||||
//早退需要计算工时
|
||||
if(attendance.getWorkStartTime() != null){
|
||||
@ -610,7 +615,6 @@ public class RzAttendanceServiceImpl extends ServiceImpl<RzAttendanceMapper, RzA
|
||||
//终止继续执行
|
||||
return;
|
||||
}
|
||||
|
||||
//判断打卡时间, 添加夜班次数 打卡时间在晚上7点以后
|
||||
if(dingsShift.getWorkHour() == 12 && attendance.getWorkSum().intValue() >= 12 && attendance.getWorkStartTime()!= null && attendance.getWorkStartTime().getHours() > 12){
|
||||
attendance.setNightNumber(1);
|
||||
|
||||
@ -171,21 +171,21 @@ public class RzAttendanceStatisticalServiceImpl extends ServiceImpl<RzAttendance
|
||||
RzAttendanceStatistical rzAttendanceStatistical = getBaseMapper().getRzAttendanceStatisticalByDateAndName(sysStaff.getUserId(),date);
|
||||
if(StringUtils.isNotNull(rzAttendanceStatistical)){
|
||||
//判断名称和部门是否一样。不一样操作修改
|
||||
if(!rzAttendanceStatistical.getName().equals(sysStaff.getName()) || rzAttendanceStatistical.getDeptId() != sysStaff.getDeptId()){
|
||||
// if(!rzAttendanceStatistical.getName().equals(sysStaff.getName())){
|
||||
//if(!rzAttendanceStatistical.getName().equals(sysStaff.getName()) || rzAttendanceStatistical.getDeptId() != sysStaff.getDeptId()){
|
||||
if(!rzAttendanceStatistical.getName().equals(sysStaff.getName())){
|
||||
//修改部门和姓名
|
||||
rzAttendanceStatistical.setName(sysStaff.getName());
|
||||
//if(rzAttendanceStatistical.getDeptId() == null){
|
||||
if(rzAttendanceStatistical.getDeptId() == null){
|
||||
rzAttendanceStatistical.setDeptId(sysStaff.getDeptId());
|
||||
//}
|
||||
}
|
||||
getBaseMapper().updateRzAttendanceStatistical(rzAttendanceStatistical);
|
||||
//查询考勤详情修改
|
||||
List<RzAttendance> kq_list = rzAttendanceMapper.queryMonthAttendanceByStaffId(sysStaff.getUserId(),new Date());
|
||||
//循环修改信息
|
||||
for (RzAttendance rzAttendance : kq_list) {
|
||||
//if(rzAttendanceStatistical.getDeptId() == null){
|
||||
if(rzAttendanceStatistical.getDeptId() == null){
|
||||
rzAttendance.setDeptId(sysStaff.getDeptId());
|
||||
//}
|
||||
}
|
||||
rzAttendance.setName(sysStaff.getName());
|
||||
rzAttendanceMapper.updateRzAttendance(rzAttendance);
|
||||
}
|
||||
|
||||
@ -40,7 +40,7 @@ public class CallbackController extends BaseController {
|
||||
List<DingCallBackExchangeProcessor> dingCallBackExchangeProcessorList;
|
||||
@PostMapping("/ding/clock")
|
||||
public Map<String, String> dingDingClock(@RequestBody Map<String, Object> params){
|
||||
log.info(JSONObject.toJSONString(params));
|
||||
System.out.println(JSONObject.toJSONString(params));
|
||||
try {
|
||||
// 1. 从http请求中获取加解密参数
|
||||
|
||||
@ -50,7 +50,7 @@ public class CallbackController extends BaseController {
|
||||
String encryptMsg = String.valueOf(params.get("encrypt"));
|
||||
String decryptMsg = callbackCrypto.getDecryptMsg(String.valueOf(params.get("msg_signature")), String.valueOf(params.get("timestamp")), String.valueOf(params.get("nonce")), encryptMsg);
|
||||
|
||||
log.info("==============>"+decryptMsg);
|
||||
System.out.println("==============>"+decryptMsg);
|
||||
// 3. 反序列化回调事件json数据
|
||||
JSONObject eventJson = JSON.parseObject(decryptMsg);
|
||||
String eventType = eventJson.getString("EventType");
|
||||
|
||||
@ -2,7 +2,6 @@ package com.evo.common.controller;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.aliyun.dingtalkstorage_1_0.models.GetFileUploadInfoResponseBody;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
@ -12,23 +11,13 @@ import com.evo.attendance.service.RzAttendanceDetailService;
|
||||
import com.evo.common.config.Global;
|
||||
import com.evo.common.constant.Constants;
|
||||
import com.evo.common.core.domain.AjaxResult;
|
||||
import com.evo.common.core.domain.entity.DeptMonthHistory;
|
||||
import com.evo.common.core.domain.entity.SysDept;
|
||||
import com.evo.common.utils.Collections;
|
||||
import com.evo.common.utils.DateUtils;
|
||||
import com.evo.common.utils.StringUtils;
|
||||
import com.evo.common.utils.http.HttpUtils;
|
||||
import com.evo.common.utils.spring.SpringUtils;
|
||||
import com.evo.ding.DingUtils;
|
||||
import com.evo.ding.processor.callback.DingCallBackExchangeProcessor;
|
||||
import com.evo.ding.processor.callback.impl.DingCallBackCheckRecordExchangeProcessor;
|
||||
import com.evo.ding.processor.callback.impl.DingCallBackUserAddOrgExchangeProcessor;
|
||||
import com.evo.personnelMatters.mapper.RzOverTimeDetailMapper;
|
||||
import com.evo.personnelMatters.mapper.RzOverTimeMapper;
|
||||
import com.evo.restaurant.service.IRzRestaurantStatisticsService;
|
||||
import com.evo.system.domain.SysStaff;
|
||||
import com.evo.system.mapper.SysDeptMapper;
|
||||
import com.evo.system.service.DeptMonthHistoryService;
|
||||
import com.evo.system.service.ISysStaffService;
|
||||
import com.evo.wechat.TemplateMessageUtil;
|
||||
import com.evo.wechat.dto.AbnormalAttendanceTemplate;
|
||||
@ -36,11 +25,13 @@ import com.evo.wechat.dto.MessageTemplate;
|
||||
import com.evo.wechat.service.GZHAccessTokenService;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.jasypt.encryption.StringEncryptor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.util.LinkedMultiValueMap;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@ -50,7 +41,6 @@ import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -88,47 +78,6 @@ public class TestController {
|
||||
private GZHAccessTokenService gzhAccessTokenService;
|
||||
@Resource
|
||||
private StringEncryptor stringEncryptor;
|
||||
@Autowired
|
||||
List<DingCallBackExchangeProcessor> dingCallBackExchangeProcessorList;
|
||||
@Resource
|
||||
private DeptMonthHistoryService deptMonthHistoryService;
|
||||
@Resource
|
||||
private SysDeptMapper deptMapper;
|
||||
|
||||
/**
|
||||
* 清洗加班
|
||||
*/
|
||||
@GetMapping("/dept/history")
|
||||
public AjaxResult deptHistory() throws ParseException {
|
||||
List<SysDept> deptList = deptMapper.selectList(new LambdaQueryWrapper<SysDept>());
|
||||
DeptMonthHistory history = new DeptMonthHistory();
|
||||
history.setDeptHistory(JSONArray.toJSONString(deptList));
|
||||
history.setDateMonth(DateUtil.format(DateUtils.addMonths(new Date(), -1), "yyyy-MM"));
|
||||
deptMonthHistoryService.save(history);
|
||||
return AjaxResult.success(history);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 清洗加班
|
||||
*/
|
||||
@GetMapping("/dk")
|
||||
public AjaxResult dk(@RequestBody JSONObject jsonObject) throws ParseException {
|
||||
SpringUtils.getBean(DingCallBackCheckRecordExchangeProcessor.class).exchange(jsonObject);
|
||||
return AjaxResult.success("");
|
||||
}
|
||||
|
||||
/**
|
||||
* 清洗加班
|
||||
*/
|
||||
@GetMapping("/ding/addUser")
|
||||
public AjaxResult dingAdduser() throws ParseException {
|
||||
String userStr = "{\"eventId\":\"8885d16e2e94467586272bac110c0083\",\"CorpId\":\"dinga5c6eeb2f797ecdbf5bf40eda33b7ba0\",\"EventType\":\"user_add_org\",\"UserId\":[\"04022527541521544736\"],\"OptStaffId\":\"190059053229069198\",\"TimeStamp\":\"1783990123767\"}";
|
||||
SpringUtils.getBean(DingCallBackUserAddOrgExchangeProcessor.class).exchange(JSONObject.parseObject(userStr));
|
||||
return AjaxResult.success("");
|
||||
}
|
||||
|
||||
/**
|
||||
* 清洗加班
|
||||
*/
|
||||
@ -166,10 +115,10 @@ public class TestController {
|
||||
|
||||
@GetMapping("/buildUser")
|
||||
public AjaxResult buildUser() throws ParseException {
|
||||
List<SysStaff> staffList = sysStaffService.list(new LambdaQueryWrapper<SysStaff>().ne(SysStaff::getStatus, -1).and(ew->ew.isNull(SysStaff::getDingUserId).or().isNull(SysStaff::getDingUnionId)));
|
||||
List<SysStaff> staffList = sysStaffService.list(new LambdaQueryWrapper<SysStaff>().ne(SysStaff::getStatus, -1).isNull(SysStaff::getDingUserId));
|
||||
List<String> notDingDing = Collections.emptyList();
|
||||
if(Collections.isNotEmpty(staffList)){
|
||||
staffList.stream().filter(d -> {return StringUtils.isEmpty(d.getDingUserId());}).forEach(data ->{
|
||||
staffList.stream().forEach(data ->{
|
||||
String result = DingUtils.getUserIdByPhoto(data.getPhone());
|
||||
JSONObject resObject = JSON.parseObject(result);
|
||||
if(Integer.valueOf(0).equals(resObject.getInteger("errcode"))){
|
||||
@ -180,18 +129,8 @@ public class TestController {
|
||||
notDingDing.add(data.getName());
|
||||
}
|
||||
});
|
||||
staffList.stream().filter(d -> {return StringUtils.isNotEmpty(d.getDingUserId()) && StringUtils.isEmpty(d.getDingUnionId());}).forEach(data ->{
|
||||
String dingUserInfo = DingUtils.getUserInfoByUserId(data.getDingUserId());
|
||||
JSONObject dingResult = JSONObject.parseObject(dingUserInfo);
|
||||
if(Integer.valueOf(0).equals(dingResult.getInteger("errcode"))){
|
||||
JSONObject result = dingResult.getJSONObject("result");
|
||||
data.setDingUnionId(result.getString("unionid"));
|
||||
}
|
||||
});
|
||||
|
||||
sysStaffService.updateBatchById(staffList);
|
||||
}
|
||||
|
||||
if(Collections.isNotEmpty(notDingDing)){
|
||||
return AjaxResult.success("部分更新失败, 未找到钉钉数据, 人员名单如下: "+ String.join(",", notDingDing));
|
||||
}
|
||||
@ -263,19 +202,19 @@ public class TestController {
|
||||
// params.add("files", resource);
|
||||
//// params.add("files", resource1);
|
||||
// StringBuilder markdownMsg = new StringBuilder();
|
||||
// markdownMsg.append("### 🚀 安全库存提醒")
|
||||
// .append("今日暂无安全库存预警数据。");
|
||||
// markdownMsg.append("### 🚀 安全库存提醒\n\n")
|
||||
// .append("今日暂无安全库存预警数据。\n\n");
|
||||
// // 只显示前三个安全库存数据
|
||||
// markdownMsg.append("**物料编号: ").append("123321").append("**")
|
||||
// .append("- 物料名称: ").append("测试测试567").append("")
|
||||
// .append("- 预计可用量: ").append("200").append("")
|
||||
// .append("- 即时库存: ").append("100").append("")
|
||||
// .append("- 最大库存: ").append("50").append("")
|
||||
// .append("- 创建时间: ").append(DateUtil.formatDateTime(new Date())).append("")
|
||||
// .append("---"); // 添加分隔线
|
||||
// markdownMsg.append("**物料编号: ").append("123321").append("**\n")
|
||||
// .append("- 物料名称: ").append("测试测试567").append("\n")
|
||||
// .append("- 预计可用量: ").append("200").append("\n")
|
||||
// .append("- 即时库存: ").append("100").append("\n")
|
||||
// .append("- 最大库存: ").append("50").append("\n")
|
||||
// .append("- 创建时间: ").append(DateUtil.formatDateTime(new Date())).append("\n")
|
||||
// .append("---\n"); // 添加分隔线
|
||||
// // 添加总数汇总
|
||||
// markdownMsg.append("**总数汇总**")
|
||||
// .append("- 今日安全库存预警数据总数: **").append(50).append("**");
|
||||
// markdownMsg.append("**总数汇总**\n")
|
||||
// .append("- 今日安全库存预警数据总数: **").append(50).append("**\n");
|
||||
//
|
||||
//
|
||||
//
|
||||
@ -303,36 +242,36 @@ public class TestController {
|
||||
|
||||
//String data = "{\"FormId\":\"BD_Empinfo\",\"FieldKeys\":\"FID\",\"FilterString\":[{\"Left\":\"\",\"FieldName\":\"FStaffNumber\",\"Compare\":\"17\",\"Value\":\"00046\",\"Right\":\"\",\"Logic\":0}],\"OrderString\":\"\",\"TopRowCount\":0,\"StartRow\":0,\"Limit\":2000,\"SubSystemId\":\"\"}";
|
||||
//
|
||||
// String data = "{" +
|
||||
// " \"FormId\" : \"PRD_MO\"," +
|
||||
// " \"FieldKeys\" : \"F_HBYT_SCLH,FBillNo,FWorkShopID.FName,FMaterialId.FNumber,FMaterialName,FPlanStartDate,FPlanFinishDate,FPickMtrlStatus\"," +
|
||||
// " \"FilterString\" : [ {" +
|
||||
// " \"FieldName\" : \"FStatus\"," +
|
||||
// " \"Compare\" : \"105\"," +
|
||||
// " \"Value\" : \"4\"," +
|
||||
// " \"Left\" : \"\"," +
|
||||
// " \"Right\" : \"\"," +
|
||||
// " \"Logic\" : 0" +
|
||||
// " }, {" +
|
||||
// " \"FieldName\" : \"FPickMtrlStatus\"," +
|
||||
// " \"Compare\" : \"29\"," +
|
||||
// " \"Value\" : \"1\"," +
|
||||
// " \"Left\" : \"\"," +
|
||||
// " \"Right\" : \"\"," +
|
||||
// " \"Logic\" : 0" +
|
||||
// " }, {" +
|
||||
// " \"FieldName\" : \"F_HBYT_SCLH\"," +
|
||||
// " \"Compare\" : \"67\"," +
|
||||
// " \"Value\" : \"QB-26-163-XCL\"," +
|
||||
// " \"Left\" : \"\"," +
|
||||
// " \"Right\" : \"\"," +
|
||||
// " \"Logic\" : 0" +
|
||||
// " } ]," +
|
||||
// " \"OrderString\" : \"\"," +
|
||||
// " \"TopRowCount\" : 0," +
|
||||
// " \"StartRow\" : 0," +
|
||||
// " \"Limit\" : 10000," +
|
||||
// " \"SubSystemId\" : \"\"" +
|
||||
// String data = "{\n" +
|
||||
// " \"FormId\" : \"PRD_MO\",\n" +
|
||||
// " \"FieldKeys\" : \"F_HBYT_SCLH,FBillNo,FWorkShopID.FName,FMaterialId.FNumber,FMaterialName,FPlanStartDate,FPlanFinishDate,FPickMtrlStatus\",\n" +
|
||||
// " \"FilterString\" : [ {\n" +
|
||||
// " \"FieldName\" : \"FStatus\",\n" +
|
||||
// " \"Compare\" : \"105\",\n" +
|
||||
// " \"Value\" : \"4\",\n" +
|
||||
// " \"Left\" : \"\",\n" +
|
||||
// " \"Right\" : \"\",\n" +
|
||||
// " \"Logic\" : 0\n" +
|
||||
// " }, {\n" +
|
||||
// " \"FieldName\" : \"FPickMtrlStatus\",\n" +
|
||||
// " \"Compare\" : \"29\",\n" +
|
||||
// " \"Value\" : \"1\",\n" +
|
||||
// " \"Left\" : \"\",\n" +
|
||||
// " \"Right\" : \"\",\n" +
|
||||
// " \"Logic\" : 0\n" +
|
||||
// " }, {\n" +
|
||||
// " \"FieldName\" : \"F_HBYT_SCLH\",\n" +
|
||||
// " \"Compare\" : \"67\",\n" +
|
||||
// " \"Value\" : \"QB-26-163-XCL\",\n" +
|
||||
// " \"Left\" : \"\",\n" +
|
||||
// " \"Right\" : \"\",\n" +
|
||||
// " \"Logic\" : 0\n" +
|
||||
// " } ],\n" +
|
||||
// " \"OrderString\" : \"\",\n" +
|
||||
// " \"TopRowCount\" : 0,\n" +
|
||||
// " \"StartRow\" : 0,\n" +
|
||||
// " \"Limit\" : 10000,\n" +
|
||||
// " \"SubSystemId\" : \"\"\n" +
|
||||
// "}";
|
||||
//
|
||||
// return AjaxResult.success(HttpUtils.sendPost("http://localhost:8089/distribution/kingdee/send", JSONObject.toJSONString(
|
||||
@ -587,83 +526,13 @@ public class TestController {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
|
||||
String str = "郝卫明,8000;" +
|
||||
"郝亮,1500;" +
|
||||
"柳晓龙,1300;" +
|
||||
"王旭,800;" +
|
||||
"张克龙,1500;" +
|
||||
"贾会涛,500;" +
|
||||
"李凯伟,2500;" +
|
||||
"石泽明,500;" +
|
||||
"马明广,500;" +
|
||||
"宋金娜,800;" +
|
||||
"吴海庆,318;" +
|
||||
"冯翠莎,500;" +
|
||||
"赵科飞,1000;" +
|
||||
"李进江,431;" +
|
||||
"李佳铭,1000;" +
|
||||
"耿利刚,100;" +
|
||||
"张雨轩,400;" +
|
||||
"李永文,1000;" +
|
||||
"代程翼,900;" +
|
||||
"李晓亮,800;" +
|
||||
"李兴酉,800;" +
|
||||
"王晓凡,800;" +
|
||||
"董献召,354;" +
|
||||
"王晓军,300;" +
|
||||
"苏冰,2000;" +
|
||||
"吴建彬,500;" +
|
||||
"王怀志,1000;" +
|
||||
"张广适,400;" +
|
||||
"赵兰争,800;" +
|
||||
"齐乐芳,500;" +
|
||||
"魏佳蕊,500;" +
|
||||
"范会雨,424;" +
|
||||
"康坤兰,500;" +
|
||||
"牛立革,600;" +
|
||||
"付佳兴,265;" +
|
||||
"游梦浩,277;" +
|
||||
"魏辰强,500;" +
|
||||
"吴凯亮,400;" +
|
||||
"董亚军,500;" +
|
||||
"赵雄飞,1000;" +
|
||||
"宁世汉,351;" +
|
||||
"张会杰,500;" +
|
||||
"王光磊,207;" +
|
||||
"梅丙立,189;" +
|
||||
"李泽宇,200;" +
|
||||
"印子鹏,100;" +
|
||||
"李雷升,100;" +
|
||||
"杨策,305;" +
|
||||
"赵芊慧,200;" +
|
||||
"朱海斌,100;" +
|
||||
"李彦辉,100;" +
|
||||
"李增全,200;" +
|
||||
"靳立节,100";
|
||||
String[] aa = str.split(";");
|
||||
for (int i = 0; i < aa.length; i++) {
|
||||
String a = aa[i].trim();
|
||||
String[] ss = a.split(",");
|
||||
System.out.println("CALL `修改其他补助`('"+ss[0]+"', "+ss[1]+");");
|
||||
|
||||
// System.out.println("INSERT INTO `evo_cw_dev`.`sys_dict_data` (`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) " +
|
||||
// "VALUES ( "+(sort++)+", '"+ss[1]+"', '"+ss[0]+"_"+ss[2]+"', 'job_info', NULL, 'default', 'N', '0', 'admin', now(), '', NULL, NULL);");
|
||||
|
||||
|
||||
|
||||
//System.out.println("update sys_staff s set s.dept_id = (select dept_id from sys_dept where dept_name = '"+ss[2]+"') where s.name='"+ss[0]+"' and s.id_card = '"+ss[1]+"';");
|
||||
//System.out.println("update rz_attendance_statistical ras left join sys_staff s on s.user_id = ras.staff_id set ras.dept_id = (select dept_id from sys_dept where dept_name = '"+ss[2]+"') where DATE_FORMAT(ras.month,'%Y-%m') = DATE_FORMAT('2026-07-01','%Y-%m') AND s.name='"+ss[0]+"' and s.id_card = '"+ss[1]+"';");
|
||||
//System.out.println("update rz_restaurant_statistics ras left join sys_staff s on s.user_id = ras.staff_id set ras.dept_id = (select dept_id from sys_dept where dept_name = '"+ss[2]+"') where DATE_FORMAT(ras.month,'%Y-%m') = DATE_FORMAT('2026-07-01','%Y-%m') AND s.name='"+ss[0]+"' and s.id_card = '"+ss[1]+"';");
|
||||
//System.out.println("update rz_leave l left join sys_staff s on s.user_id = l.user_id set l.dept_id = (select dept_id from sys_dept where dept_name = '"+ss[2]+"') where s.name='"+ss[0]+"' and s.id_card = '"+ss[1]+"';");
|
||||
// System.out.println("update sys_staff_detail ssd left join sys_staff ss on ss.user_id = ssd.staff_id set ssd.daily_wage = ssd.daily_wage-"+ss[1]+" where ss.id_card = '"+ss[0]+"';");
|
||||
BufferedReader reader = new BufferedReader(new FileReader(new File("D:\\andy\\文档\\考勤\\岗位任职部门信息.txt")));
|
||||
String line = reader.readLine();
|
||||
while (line != null) {
|
||||
String[] configData = line.split("_");
|
||||
System.out.println("update sys_dict_data set dict_value='"+line+"' where dict_value='"+configData[0]+"';\n");
|
||||
line = reader.readLine();
|
||||
}
|
||||
// BufferedReader reader = new BufferedReader(new FileReader(new File("D:\\andy\\文档\\考勤\\岗位任职部门信息.txt")));
|
||||
// String line = reader.readLine();
|
||||
// while (line != null) {
|
||||
// String[] configData = line.split("_");
|
||||
// System.out.println("update sys_dict_data set dict_value='"+line+"' where dict_value='"+configData[0]+"';");
|
||||
// line = reader.readLine();
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -2,10 +2,7 @@ package com.evo.common.core.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.evo.common.utils.Collections;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.evo.common.core.domain.entity.SysDept;
|
||||
import com.evo.common.core.domain.entity.SysMenu;
|
||||
@ -29,9 +26,6 @@ public class TreeSelect implements Serializable
|
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||
private List<TreeSelect> children;
|
||||
|
||||
/** 节点名称 */
|
||||
private Map<String, Object> extend;
|
||||
|
||||
public TreeSelect()
|
||||
{
|
||||
|
||||
@ -41,7 +35,6 @@ public class TreeSelect implements Serializable
|
||||
{
|
||||
this.id = dept.getDeptId();
|
||||
this.label = dept.getDeptName();
|
||||
this.extend = Collections.asMap("deptCode", dept.getDeptCode());
|
||||
this.children = dept.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@ -81,12 +74,4 @@ public class TreeSelect implements Serializable
|
||||
{
|
||||
this.children = children;
|
||||
}
|
||||
|
||||
public Map<String, Object> getExtend() {
|
||||
return extend;
|
||||
}
|
||||
|
||||
public void setExtend(Map<String, Object> extend) {
|
||||
this.extend = extend;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,29 +0,0 @@
|
||||
package com.evo.common.core.domain.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @desc:
|
||||
* @ClassName:DeptMonthHistory
|
||||
* @date: 2026年08月15日 15:34
|
||||
* @company: 茹臣科技
|
||||
* @author: andy.shi
|
||||
* @contact: 17330188597
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class DeptMonthHistory implements Serializable {
|
||||
|
||||
/***
|
||||
* id
|
||||
*/
|
||||
Long id;
|
||||
|
||||
String dateMonth;
|
||||
|
||||
String deptHistory;
|
||||
|
||||
}
|
||||
@ -34,8 +34,7 @@ public class SysDept extends BaseEntity
|
||||
|
||||
/** 祖级列表 */
|
||||
private String ancestors;
|
||||
/** 部门编码 */
|
||||
private String deptCode;
|
||||
|
||||
/** 部门名称 */
|
||||
private String deptName;
|
||||
|
||||
@ -58,9 +57,6 @@ public class SysDept extends BaseEntity
|
||||
/** 是否加班 */
|
||||
private String isOverTime;
|
||||
|
||||
/** 是否加班 */
|
||||
private String isShowFinancial;
|
||||
|
||||
private String dingId;
|
||||
|
||||
/** 子部门 */
|
||||
|
||||
@ -7,9 +7,6 @@ import com.evo.attendance.service.IRzSysParamService;
|
||||
import com.evo.personnelMatters.domain.RzHoliday;
|
||||
import com.evo.personnelMatters.service.IRzHolidayService;
|
||||
import com.evo.system.service.ISysDictDataService;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -121,20 +118,6 @@ public class ParamUtils {
|
||||
return param.getParamValue();
|
||||
}
|
||||
|
||||
public static Boolean sendWeiXin(){
|
||||
RzSysParam param= paramService.getRzSysParam("是否发送微信通知", "send_we_chat","true","是否允许发送微信通知");
|
||||
return Boolean.valueOf(param.getParamValue());
|
||||
}
|
||||
public static Boolean sendEveryDayCheckInWeiXin(){
|
||||
RzSysParam param= paramService.getRzSysParam("是否发送每天未打卡考勤信息到微信通知", "send_every_day_check_in_we_chat","false","是否发送每天未打卡考勤信息到微信通知");
|
||||
return Boolean.valueOf(param.getParamValue());
|
||||
}
|
||||
public static Long overdueLimit(){
|
||||
RzSysParam param= paramService.getRzSysParam("超期未打开天数", "overdue_limit","5","超期未打开天数");
|
||||
return Long.valueOf(param.getParamValue());
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***
|
||||
* 不住宿的实习生人员
|
||||
@ -215,16 +198,7 @@ public class ParamUtils {
|
||||
* @return
|
||||
*/
|
||||
public static List<String> getTsDevSn(){
|
||||
RzSysParam param= paramService.getRzSysParam("获取特殊类型的打卡机型号", "ts_device_sn","T71474,RT64815","获取特殊类型的打卡机型号, 多个参数使用,隔开");
|
||||
return Collections.asList(param.getParamValue().split(","));
|
||||
}
|
||||
|
||||
/***
|
||||
* 获取餐厅设备信息
|
||||
* @return
|
||||
*/
|
||||
public static List<String> getRestaurantDevSn(){
|
||||
RzSysParam param= paramService.getRzSysParam("获取餐厅打卡机型号", "restaurant_device_sn","T71474,RT64815","获取餐厅打卡机型号, 多个参数使用,隔开");
|
||||
RzSysParam param= paramService.getRzSysParam("获取特殊类型的打卡机型号", "ts_device_sn","ET74336,ET74335","获取特殊类型的打卡机型号, 多个参数使用,隔开");
|
||||
return Collections.asList(param.getParamValue().split(","));
|
||||
}
|
||||
|
||||
@ -243,24 +217,6 @@ public class ParamUtils {
|
||||
if(StringUtils.isEmpty(rulesVal)) return false;
|
||||
return Collections.asList(rulesVal.split(",")).contains(rules);
|
||||
}
|
||||
|
||||
/***
|
||||
* 检查各厂考勤人数
|
||||
* sn 设备号
|
||||
* rules 规则
|
||||
* @return
|
||||
*/
|
||||
public static Map<String, String> checkKqAddressCount(){
|
||||
try {
|
||||
RzSysParam param= paramService.getRzSysParam("检查各厂考勤人数规则", "check_kq_address_count","{\"北厂\":\"{\"longScope\":\"123-456\",\"latScope\":\"123-456\"}\"}","特殊打卡机的打卡按钮规则, 使用json格式, 如果打卡机存在多个按钮规则用,分割");
|
||||
String val = param.getParamValue();
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
// 第一层:外层 Map<String, String>
|
||||
return mapper.readValue(param.getParamValue(), new TypeReference<Map<String, String>>() {});
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
/***
|
||||
* 获取特殊加班的考勤规则
|
||||
* sn 设备号
|
||||
@ -404,11 +360,6 @@ public class ParamUtils {
|
||||
return Collections.asList(param.getParamValue().split(",")).stream().filter(StringUtils::isNotEmpty).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public static List<String> getWeBaoTaxCompany(){
|
||||
RzSysParam param= paramService.getRzSysParam("需要扣税的外包公司名称", "we_bao_tax_company","YTLW","需要扣税的外包公司名称)");
|
||||
return Collections.asList(param.getParamValue().split(",")).stream().filter(StringUtils::isNotEmpty).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
* 获取80%假期
|
||||
@ -420,16 +371,7 @@ public class ParamUtils {
|
||||
}
|
||||
|
||||
/***
|
||||
* 获取基本薪假期
|
||||
* @return
|
||||
*/
|
||||
public static List<Long> getBasicVacation(){
|
||||
RzSysParam param= paramService.getRzSysParam("基本薪假期类型", "basic_vacation","58","80%的假期类型; 58-陪产假");
|
||||
return Collections.asList(param.getParamValue().split(",")).stream().filter(StringUtils::isNotEmpty).map(Long::valueOf).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/***
|
||||
* 特殊年度免征额计算
|
||||
* 获取80%假期
|
||||
* @param nameAndIdCard 姓名-身份证
|
||||
* @return
|
||||
*/
|
||||
|
||||
@ -35,11 +35,6 @@ public final class SpringUtils implements BeanFactoryPostProcessor, ApplicationC
|
||||
SpringUtils.applicationContext = applicationContext;
|
||||
}
|
||||
|
||||
public static ApplicationContext getApplicationContext() throws BeansException
|
||||
{
|
||||
return SpringUtils.applicationContext;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取对象
|
||||
*
|
||||
|
||||
@ -101,7 +101,6 @@ public class DingUtils {
|
||||
DingTalkClient client = new DefaultDingTalkClient(DingGlobalParams.getUrl()+"v2/user/get");
|
||||
OapiV2UserGetRequest req = new OapiV2UserGetRequest();
|
||||
req.setUserid(userId);
|
||||
req.setLanguage("zh_CN");
|
||||
OapiV2UserGetResponse rsp = client.execute(req, getAccessToken());
|
||||
return rsp.getBody();
|
||||
} catch (Exception e) {
|
||||
@ -197,7 +196,7 @@ public class DingUtils {
|
||||
|
||||
|
||||
/***
|
||||
* 获取单个审批实例详情
|
||||
* 获取审批详情
|
||||
* @param processInstanceId 审批示例id
|
||||
*/
|
||||
public static GetProcessInstanceResponseBody.GetProcessInstanceResponseBodyResult getProcessInstanceInfo(String processInstanceId){
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
package com.evo.ding.processor.callback.impl;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.dingtalk.api.response.OapiAttendanceGroupQueryResponse;
|
||||
import com.dingtalk.api.response.OapiAttendanceShiftQueryResponse;
|
||||
@ -46,8 +45,6 @@ public class DingCallBackGroupChangeExchangeProcessor implements DingCallBackExc
|
||||
@Autowired
|
||||
DingShiftGroupService dingShiftGroupService;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean accept(String eventType) {
|
||||
return EVENT_TYPE_ATTEND_GROUP_CHANGE.equals(eventType);
|
||||
@ -82,7 +79,7 @@ public class DingCallBackGroupChangeExchangeProcessor implements DingCallBackExc
|
||||
for (Long shiftId : groupDetail.getShiftIds()) {
|
||||
String strShiftId = String.valueOf(shiftId);
|
||||
if(map.containsKey(strShiftId)){
|
||||
DingShift dingShift = dingShiftService.selectByDingIdEmptyCreate(strShiftId);
|
||||
DingShift dingShift = dingShiftService.selectByDingId(strShiftId);
|
||||
for (DingShiftGroup dingShiftGroup : map.get(strShiftId)){
|
||||
dingShiftGroup.setCheckTime(("OnDuty".equals(dingShiftGroup.getType()) ? dingShift.getOnDutyCheckTime() : dingShift.getOffDutyCheckTime()));
|
||||
dingShiftGroupService.updateById(dingShiftGroup);
|
||||
@ -100,7 +97,7 @@ public class DingCallBackGroupChangeExchangeProcessor implements DingCallBackExc
|
||||
}
|
||||
}
|
||||
public void crateDingShiftGroup(String groupId, String shiftId){
|
||||
DingShift dingShift = dingShiftService.selectByDingIdEmptyCreate(shiftId);
|
||||
DingShift dingShift = dingShiftService.selectByDingId(shiftId);
|
||||
//直接更新上班, 下班
|
||||
for (int i = 0; i < 2; i++) {
|
||||
DingShiftGroup dingShiftGroup = new DingShiftGroup();
|
||||
|
||||
@ -20,8 +20,6 @@ public interface InstanceChangeExchangeProcessor extends DingBasicExchangeProces
|
||||
|
||||
//补卡
|
||||
static final String PROCESS_CODE_RECHARGE_CARD = "PROC-19617D02-F632-402E-9ACD-134CC47E462F";
|
||||
//接待
|
||||
static final String PROCESS_CODE_RECEPTION_CARD = "PROC-D00584CA-55AA-4783-ABA3-9EE3D9A5F67B";
|
||||
|
||||
boolean accept(String processCode);
|
||||
|
||||
|
||||
@ -1,120 +0,0 @@
|
||||
package com.evo.ding.processor.instance.impl;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.aliyun.dingtalkworkflow_1_0.models.GetProcessInstanceResponseBody;
|
||||
import com.evo.common.constant.Constants;
|
||||
import com.evo.common.core.domain.entity.SysDictData;
|
||||
import com.evo.common.utils.Collections;
|
||||
import com.evo.common.utils.DataUtils;
|
||||
import com.evo.common.utils.ParamUtils;
|
||||
import com.evo.common.utils.StringUtils;
|
||||
import com.evo.ding.DingUtils;
|
||||
import com.evo.ding.processor.instance.InstanceChangeExchangeProcessor;
|
||||
import com.evo.personnelMatters.domain.RzMealExpenses;
|
||||
import com.evo.personnelMatters.domain.RzMealExpensesDetail;
|
||||
import com.evo.personnelMatters.service.RzMealExpensesDetailService;
|
||||
import com.evo.personnelMatters.service.RzMealExpensesService;
|
||||
import com.evo.system.mapper.SysDictDataMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 钉钉接待申请接口回调 InstanceChangeReceptionExchangeProcessor
|
||||
* @author andy.shi
|
||||
* @ClassName:InstanceChangeReceptionExchangeProcessor
|
||||
* @date: 2026年08月17日 13:51
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class InstanceChangeReceptionExchangeProcessor implements InstanceChangeExchangeProcessor {
|
||||
|
||||
@Resource
|
||||
private SysDictDataMapper sysDictDataMapper; //数据字典
|
||||
@Resource
|
||||
private RzMealExpensesService rzMealExpensesService;
|
||||
@Resource
|
||||
RzMealExpensesDetailService rzMealExpensesDetailService;
|
||||
@Override
|
||||
public boolean accept(String processCode) {
|
||||
return InstanceChangeExchangeProcessor.PROCESS_CODE_RECEPTION_CARD.equals(processCode);
|
||||
}
|
||||
@Override
|
||||
public void exchange(JSONObject json) {
|
||||
//获取审批示例id
|
||||
String processInstanceId = json.getString("processInstanceId");
|
||||
GetProcessInstanceResponseBody.GetProcessInstanceResponseBodyResult result = DingUtils.getProcessInstanceInfo(processInstanceId);
|
||||
log.info("招待申请审批表单信息:{}", JSON.toJSONString(result));
|
||||
try {
|
||||
List<GetProcessInstanceResponseBody.GetProcessInstanceResponseBodyResultFormComponentValues> resultFormValues = result.getFormComponentValues();
|
||||
//是否有餐饮需求
|
||||
String diningDemand = resultFormValues.stream().filter(data-> "餐饮需求".equals(data.getName()) && StringUtils.isNotEmpty(data.getValue())).findFirst().get().getValue();
|
||||
//是否有餐饮需求
|
||||
if(!"有".equals(diningDemand)) {
|
||||
log.info("本次招待信息没有就餐需求");
|
||||
return;
|
||||
}
|
||||
//餐券数量
|
||||
String diningNum = resultFormValues.stream().filter(data-> "餐券数量".equals(data.getName()) && StringUtils.isNotEmpty(data.getValue())).findFirst().get().getValue();
|
||||
//餐券类别
|
||||
String diningType = resultFormValues.stream().filter(data-> "餐券类别".equals(data.getName()) && StringUtils.isNotEmpty(data.getValue())).findFirst().get().getValue();
|
||||
//单价
|
||||
BigDecimal unitPrice = DataUtils.DEFAULT_VALUE;
|
||||
//查询消费情况
|
||||
Map<Long,String> dicMap = sysDictDataMapper.selectDictDataByType(Constants.SYS_RESTAUTANT).stream().collect(Collectors.toMap(SysDictData::getDictCode, SysDictData::getDictValue));
|
||||
RzMealExpensesDetail detail = new RzMealExpensesDetail();
|
||||
detail.setType(3);
|
||||
if("早餐".equals(diningType)){
|
||||
unitPrice = new BigDecimal(dicMap.get(Constants.zc_code));
|
||||
detail.setMealVoucherType("早餐");
|
||||
}else if ("午餐".equals(diningType)){
|
||||
unitPrice = new BigDecimal(dicMap.get(Constants.wc_code));
|
||||
detail.setMealVoucherType("午餐");
|
||||
} else if ("晚餐".equals(diningType)) {
|
||||
unitPrice = new BigDecimal(dicMap.get(Constants.wcc_code));
|
||||
detail.setMealVoucherType("晚餐");
|
||||
}
|
||||
BigDecimal totalAmount = unitPrice.multiply(new BigDecimal(diningNum));
|
||||
//预计月份
|
||||
String month = resultFormValues.stream().filter(data-> "预计来访日期".equals(data.getName()) && StringUtils.isNotEmpty(data.getValue())).findFirst().get().getValue();
|
||||
RzMealExpenses param = new RzMealExpenses();
|
||||
param.setYearMonthTime(month.substring(0, 7));
|
||||
List<RzMealExpenses> list = rzMealExpensesService.selectList(param);
|
||||
RzMealExpenses rzMealExpenses = new RzMealExpenses();
|
||||
if(Collections.isNotEmpty(list)){
|
||||
rzMealExpenses = list.get(0);
|
||||
// rzMealExpenses.setHospitalityFee(totalAmount.add(new BigDecimal(DataUtils.findDefaultValue(rzMealExpenses.getHospitalityFee(), 0d))).doubleValue());
|
||||
// rzMealExpensesService.updateById(rzMealExpenses);
|
||||
}else {
|
||||
rzMealExpenses = new RzMealExpenses();
|
||||
rzMealExpenses.setYearMonthTime(month.substring(0, 7));
|
||||
rzMealExpenses.setWaterUnitPrice(ParamUtils.getWaterUnitPrice());
|
||||
rzMealExpenses.setElectricityUnitPrice(ParamUtils.getElectricityUnitPrice());
|
||||
// rzMealExpenses.setHospitalityFee(totalAmount.doubleValue());
|
||||
rzMealExpensesService.save(rzMealExpenses);
|
||||
}
|
||||
detail.setExpensesId(rzMealExpenses.getId());
|
||||
detail.setNum(Integer.valueOf(diningNum));
|
||||
detail.setUnitPrice(unitPrice.doubleValue());
|
||||
detail.setTotalPrice(totalAmount.doubleValue());
|
||||
detail.setCompanyName("YT"); //默认为河北伊特
|
||||
rzMealExpensesDetailService.saveRzMealExpensesDetail(detail);
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("解析招待审批出现错误:错误信息为:{}", e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -18,7 +18,5 @@ public interface DingShiftService extends IService<DingShift> {
|
||||
|
||||
public DingShift selectByDingId(String dingId);
|
||||
|
||||
public DingShift selectByDingIdEmptyCreate(String dingId);
|
||||
|
||||
public List<DingShift> selectList(DingShift dingShift);
|
||||
}
|
||||
|
||||
@ -1,17 +1,12 @@
|
||||
package com.evo.ding.service.impl;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.evo.common.utils.Collections;
|
||||
import com.evo.ding.domain.DingShift;
|
||||
import com.evo.ding.domain.DingShiftGroup;
|
||||
import com.evo.ding.mapper.DingShiftGroupMapper;
|
||||
import com.evo.ding.mapper.DingShiftMapper;
|
||||
import com.evo.ding.processor.callback.impl.DingCallBackShiftChangeExchangeProcessor;
|
||||
import com.evo.ding.service.DingShiftGroupService;
|
||||
import com.evo.ding.service.DingShiftService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
@ -26,24 +21,11 @@ import java.util.List;
|
||||
*/
|
||||
@Service
|
||||
public class DingShiftServiceImpl extends ServiceImpl<DingShiftMapper, DingShift> implements DingShiftService {
|
||||
@Autowired
|
||||
@Lazy
|
||||
DingCallBackShiftChangeExchangeProcessor dingCallBackShiftChangeExchangeProcessor;
|
||||
@Override
|
||||
public DingShift selectByDingId(String dingId) {
|
||||
return getBaseMapper().selectByDingId(dingId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DingShift selectByDingIdEmptyCreate(String dingId) {
|
||||
DingShift dingShift = getBaseMapper().selectByDingId(dingId);
|
||||
if(dingShift == null){
|
||||
dingCallBackShiftChangeExchangeProcessor.exchange(JSONObject.from(Collections.asMap("id", dingId)));
|
||||
return selectByDingId(dingId);
|
||||
}
|
||||
return dingShift;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DingShift> selectList(DingShift dingShift) {
|
||||
return getBaseMapper().selectList(dingShift);
|
||||
|
||||
@ -1,13 +0,0 @@
|
||||
package com.evo.equipment.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class StaffDeleteDevicePhotoDto {
|
||||
private String cmd;
|
||||
private String user_id;
|
||||
private int user_type;
|
||||
|
||||
}
|
||||
@ -1,12 +1,12 @@
|
||||
package com.evo.equipment.domain.vo;
|
||||
|
||||
public class StaffDto<T> {
|
||||
public class StaffDto {
|
||||
|
||||
private String cmd;
|
||||
private String form;
|
||||
private String to;
|
||||
private String extra;
|
||||
private T data;
|
||||
private StaffData data;
|
||||
|
||||
public String getCmd() {
|
||||
return cmd;
|
||||
@ -40,11 +40,11 @@ public class StaffDto<T> {
|
||||
this.extra = extra;
|
||||
}
|
||||
|
||||
public T getData() {
|
||||
public StaffData getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(T data) {
|
||||
public void setData(StaffData data) {
|
||||
this.data = data;
|
||||
}
|
||||
}
|
||||
|
||||
@ -53,13 +53,7 @@ public interface IEqSnDetailService
|
||||
* @return
|
||||
*/
|
||||
public Boolean sendPhoto(List<String> snList, List<Map<String, String>> userPhotoList);
|
||||
/***
|
||||
* 删除照片
|
||||
* @param snList
|
||||
* @param deleteUserList
|
||||
* @return
|
||||
*/
|
||||
public Boolean sendDelete(List<String> snList, List<String> deleteUserList);
|
||||
|
||||
/***
|
||||
* 下发按钮
|
||||
* @param snList
|
||||
|
||||
@ -2,7 +2,6 @@ package com.evo.equipment.service.impl;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.evo.common.utils.ParamUtils;
|
||||
import com.evo.equipment.constant.Constants;
|
||||
import com.evo.common.core.domain.AjaxResult;
|
||||
import com.evo.common.utils.DateUtils;
|
||||
@ -114,7 +113,7 @@ public class EqImagesServiceImpl implements IEqImagesService
|
||||
|
||||
//定义公共打卡机
|
||||
List<String> dkj_list = new ArrayList<String>();
|
||||
dkj_list.addAll(ParamUtils.getRestaurantDevSn()); //食堂
|
||||
dkj_list.add(Constants.EQ_DEVICE_CODE); //食堂
|
||||
// dkj_list.add(Constants.EQ_DEVICE_PUBLIC_CODE); //公共
|
||||
dkj_list.add(eqImages.getTimeClock());
|
||||
|
||||
@ -266,7 +265,7 @@ public class EqImagesServiceImpl implements IEqImagesService
|
||||
Row row = sheet.getRow(p);
|
||||
if(StringUtils.isNotNull(row)){
|
||||
dkj_list = new ArrayList<String>();
|
||||
dkj_list.addAll(ParamUtils.getRestaurantDevSn()); //食堂
|
||||
dkj_list.add(Constants.EQ_DEVICE_CODE); //食堂
|
||||
// dkj_list.add(Constants.EQ_DEVICE_PUBLIC_CODE); //公共
|
||||
dkj_list.add(row.getCell(4).getStringCellValue());
|
||||
cau = new StaffDto();
|
||||
|
||||
@ -4,7 +4,6 @@ import com.alibaba.fastjson2.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.evo.common.config.Global;
|
||||
import com.evo.common.constant.Constants;
|
||||
import com.evo.common.core.domain.AjaxResult;
|
||||
import com.evo.common.core.domain.entity.RzUpload;
|
||||
@ -27,7 +26,6 @@ import com.evo.system.domain.SysStaff;
|
||||
import com.evo.system.mapper.SysStaffMapper;
|
||||
import com.evo.system.service.RzUploadService;
|
||||
import com.evo.system.service.impl.SysDeptServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.ApplicationArguments;
|
||||
import org.springframework.boot.ApplicationRunner;
|
||||
@ -47,9 +45,8 @@ import java.util.stream.Collectors;
|
||||
* @author chenyj
|
||||
* @date 2024-08-07
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class EqSnDetailServiceImpl extends ServiceImpl<EqSnDetailMapper, EqSnDetail> implements IEqSnDetailService
|
||||
public class EqSnDetailServiceImpl extends ServiceImpl<EqSnDetailMapper, EqSnDetail> implements IEqSnDetailService, ApplicationRunner
|
||||
{
|
||||
@Resource
|
||||
private SysStaffMapper sysStaffMapper;
|
||||
@ -121,15 +118,8 @@ public class EqSnDetailServiceImpl extends ServiceImpl<EqSnDetailMapper, EqSnDet
|
||||
public EqSnDetail selectEqSnDetailBySn(String sn){
|
||||
return getBaseMapper().selectEqSnDetailBySn(sn);
|
||||
}
|
||||
//com.evo.equipment.constant.Constants.EQ_DEVICE_PUBLIC_CODE, Collections.asList(com.evo.equipment.constant.Constants.EQ_DEVICE_CODE)
|
||||
static List<String> tsSn = Collections.emptyList();
|
||||
|
||||
public List<String> getTsSn(){
|
||||
tsSn.clear();
|
||||
tsSn.addAll(ParamUtils.getTsDevSn());
|
||||
tsSn.addAll(ParamUtils.getRestaurantDevSn());
|
||||
return tsSn;
|
||||
}
|
||||
//com.evo.equipment.constant.Constants.EQ_DEVICE_PUBLIC_CODE,
|
||||
static List<String> tsSn = Collections.asList(com.evo.equipment.constant.Constants.EQ_DEVICE_CODE);
|
||||
|
||||
private List<Map<String, String>> getPhoto(List<SysStaff> userList){
|
||||
List<Map<String, String>> userPhotoList = Collections.emptyList();
|
||||
@ -151,12 +141,11 @@ public class EqSnDetailServiceImpl extends ServiceImpl<EqSnDetailMapper, EqSnDet
|
||||
public Map<String, List<Map<String, String>>> initTsDkDevice(String deviceSn){
|
||||
Map<String, List<Map<String, String>>> snUserPhotoList = Collections.emptyMap();
|
||||
//如果有且只有一个设备信息, 并且设备信息为公共打卡机, 或者是 食堂打卡机
|
||||
if(getTsSn().contains(deviceSn)) {
|
||||
if(tsSn.contains(deviceSn)) {
|
||||
List<Map<String, String>> userPhotoList = Collections.emptyList();
|
||||
List<SysStaff> userList = Collections.emptyList();
|
||||
//deviceSn.equals(com.evo.equipment.constant.Constants.EQ_DEVICE_PUBLIC_CODE) ||
|
||||
//deviceSn.equals(com.evo.equipment.constant.Constants.EQ_DEVICE_CODE)
|
||||
if (ParamUtils.getRestaurantDevSn().contains(deviceSn)) {
|
||||
if (deviceSn.equals(com.evo.equipment.constant.Constants.EQ_DEVICE_CODE)) {
|
||||
//获取所有未删除的, 没有离职的员工信息
|
||||
userList = sysStaffMapper.selectList(new LambdaQueryWrapper<SysStaff>().eq(SysStaff::getDelFlag, Constants.DELETE_FLAG_0).ne(SysStaff::getStatus, Constants.JOB_STATIS_11).select(SysStaff::getUserId, SysStaff::getDeptId, SysStaff::getName));
|
||||
}
|
||||
@ -165,8 +154,8 @@ public class EqSnDetailServiceImpl extends ServiceImpl<EqSnDetailMapper, EqSnDet
|
||||
List<Long> userIds = eqOverStaffMapper.selectList(new LambdaQueryWrapper<EqOverStaff>().eq(EqOverStaff::getDelFlag, Constants.DELETE_FLAG_0).select(EqOverStaff::getUserId)).stream().map(EqOverStaff::getUserId).collect(Collectors.toList());
|
||||
userList = sysStaffMapper.selectList((new LambdaQueryWrapper<SysStaff>().in(SysStaff::getUserId, userIds).eq(SysStaff::getDelFlag, Constants.DELETE_FLAG_0).ne(SysStaff::getStatus, Constants.JOB_STATIS_11).select(SysStaff::getUserId, SysStaff::getDeptId, SysStaff::getName)));
|
||||
}
|
||||
//如果是下发的食堂打卡机, 则需要查找餐饮人员的数据 deviceSn.equals(com.evo.equipment.constant.Constants.EQ_DEVICE_CODE)deviceSn.equals(com.evo.equipment.constant.Constants.EQ_DEVICE_CODE)
|
||||
if (ParamUtils.getRestaurantDevSn().contains(deviceSn)) {
|
||||
//如果是下发的食堂打卡机, 则需要查找餐饮人员的数据
|
||||
if (deviceSn.equals(com.evo.equipment.constant.Constants.EQ_DEVICE_CODE)) {
|
||||
List<RzRestaurantImages> list = rzRestaurantImagesMapper.selectList(new LambdaQueryWrapper<RzRestaurantImages>().eq(RzRestaurantImages::getDelFlag, Constants.DELETE_FLAG_0));
|
||||
for (RzRestaurantImages img : list) {
|
||||
userPhotoList.add(Collections.asMap("userId", String.valueOf(img.getId()), "name", img.getName(), "photoUrl", img.getImageUrl(), "deptName", "实习生"));
|
||||
@ -209,24 +198,20 @@ public class EqSnDetailServiceImpl extends ServiceImpl<EqSnDetailMapper, EqSnDet
|
||||
|
||||
@Override
|
||||
public Boolean sendPhoto(List<String> snList, List<Map<String, String>> userPhotoList) {
|
||||
if(!"druid".equals(Global.newInstance().getActive())){
|
||||
log.info("非生产环境, 无需下发照片");
|
||||
return true;
|
||||
}
|
||||
//检查设备是否在链接状态
|
||||
Map<String, Session> sessionMap = checkSession(snList);
|
||||
|
||||
Map<String, List<Map<String, String>>> snUserPhotoList = Collections.emptyMap();
|
||||
if(Collections.isEmpty(userPhotoList)){
|
||||
//如果有且只有一个设备信息, 并且设备信息为公共打卡机, 或者是 食堂打卡机
|
||||
if(snList.size() ==1 && getTsSn().contains(snList.get(0))){
|
||||
if(snList.size() ==1 && tsSn.contains(snList.get(0))){
|
||||
snUserPhotoList.putAll(initTsDkDevice(snList.get(0)));
|
||||
}else{
|
||||
List<String> allSnList = new ArrayList<String>(){{addAll(snList);}};
|
||||
List<String> tsDeviceSn = Collections.findDuplicatesList(allSnList, getTsSn());
|
||||
List<String> tsDeviceSn = Collections.findDuplicatesList(allSnList, tsSn);
|
||||
//所有所有不是特殊打卡机人员信息
|
||||
snList.remove(tsDeviceSn);
|
||||
snList.stream().filter(sn-> !getTsSn().contains(sn)).forEach(sn ->{
|
||||
snList.stream().filter(sn-> !tsSn.contains(sn)).forEach(sn ->{
|
||||
//获取所有未删除的, 没有离职的员工信息
|
||||
List<SysStaff> userList = sysStaffMapper.selectList((new LambdaQueryWrapper<SysStaff>().like(SysStaff::getTimeClock, sn).eq(SysStaff::getDelFlag, Constants.DELETE_FLAG_0).ne(SysStaff::getStatus,Constants.JOB_STATIS_11).select(SysStaff::getUserId, SysStaff::getDeptId, SysStaff::getName)));
|
||||
snUserPhotoList.put(sn, getPhoto(userList));
|
||||
@ -245,9 +230,8 @@ public class EqSnDetailServiceImpl extends ServiceImpl<EqSnDetailMapper, EqSnDet
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//发送数据的类型
|
||||
StaffDto<StaffData> cau = new StaffDto<StaffData>();
|
||||
StaffDto cau = new StaffDto();
|
||||
//该接口固定为to_device,发送给设备用于识别对应哪个指令
|
||||
cau.setCmd("to_device");
|
||||
//无用值,空串
|
||||
@ -281,42 +265,11 @@ public class EqSnDetailServiceImpl extends ServiceImpl<EqSnDetailMapper, EqSnDet
|
||||
WebSocketUsers.sendMessageToUserByText(sessionMap.get(sn), JSONObject.toJSONString(cau));
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean sendDelete(List<String> snList, List<String> deleteUserList) {
|
||||
|
||||
if(!"druid".equals(Global.newInstance().getActive())){
|
||||
log.info("非生产环境, 无需删除照片");
|
||||
return true;
|
||||
}
|
||||
//检查设备是否在链接状态
|
||||
Map<String, Session> sessionMap = checkSession(snList);
|
||||
//发送数据的类型
|
||||
StaffDto<StaffDeleteDevicePhotoDto> cau = new StaffDto<StaffDeleteDevicePhotoDto>();
|
||||
//该接口固定为to_device,发送给设备用于识别对应哪个指令
|
||||
cau.setCmd("to_device");
|
||||
//无用值,空串
|
||||
cau.setForm("");
|
||||
//给服务端预留的补充字段,设备端不处理这个字段内容。设备在响应这条指令时原样返回
|
||||
cau.setExtra("");
|
||||
|
||||
//发送的具体Data
|
||||
StaffDeleteDevicePhotoDto caud = new StaffDeleteDevicePhotoDto();
|
||||
caud.setCmd("delUser");
|
||||
caud.setUser_type(0);
|
||||
|
||||
snList.stream().forEach(sn->{
|
||||
cau.setTo(sn);
|
||||
deleteUserList.stream().forEach(userId ->{
|
||||
caud.setUser_id(userId);
|
||||
//循环替换属性
|
||||
cau.setData(caud);
|
||||
//调用websocket,推送给设备
|
||||
WebSocketUsers.sendMessageToUserByText(sessionMap.get(sn), JSONObject.toJSONString(cau));
|
||||
});
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -351,10 +304,8 @@ public class EqSnDetailServiceImpl extends ServiceImpl<EqSnDetailMapper, EqSnDet
|
||||
update(new UpdateWrapper<EqSnDetail>().set("type","连接已断开").set("session_id","").eq( "session_id", sessionId));
|
||||
}
|
||||
|
||||
//
|
||||
// @Override
|
||||
// public void run(ApplicationArguments args) throws Exception {
|
||||
// tsSn.addAll(ParamUtils.getTsDevSn());
|
||||
// tsSn.addAll(ParamUtils.getRestaurantDevSn());
|
||||
// }
|
||||
@Override
|
||||
public void run(ApplicationArguments args) throws Exception {
|
||||
tsSn.addAll(ParamUtils.getTsDevSn());
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,7 +3,11 @@ package com.evo.finance.controller;
|
||||
import java.util.List;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.evo.common.annotation.Log;
|
||||
import com.evo.common.core.controller.BaseController;
|
||||
import com.evo.common.core.domain.AjaxResult;
|
||||
@ -47,15 +51,4 @@ public class RzSalaryStatisticsController extends BaseController
|
||||
{
|
||||
return rzSalaryStatisticsService.deleteRzSalaryStatisticsById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 确认发放工资
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('finance:financeStatistics:confirm')")
|
||||
@Log(title = "工资统计", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/{id}")
|
||||
public AjaxResult confirm(@PathVariable Long id)
|
||||
{
|
||||
return rzSalaryStatisticsService.confirmRzSalaryStatisticsById(id);
|
||||
}
|
||||
}
|
||||
|
||||
@ -198,11 +198,6 @@ public class RzSalaryDetail extends BaseEntity
|
||||
|
||||
@TableField(exist = false)
|
||||
private BigDecimal bjAmount;
|
||||
/***
|
||||
* 扣减费用,. 劳务税率计算
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private BigDecimal kjAmount;
|
||||
//基本工资全薪
|
||||
@TableField(exist = false)
|
||||
private BigDecimal basicAmount;
|
||||
@ -664,14 +659,6 @@ public class RzSalaryDetail extends BaseEntity
|
||||
this.socialSecurityDeduction = socialSecurityDeduction;
|
||||
}
|
||||
|
||||
public BigDecimal getKjAmount() {
|
||||
return kjAmount;
|
||||
}
|
||||
|
||||
public void setKjAmount(BigDecimal kjAmount) {
|
||||
this.kjAmount = kjAmount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "RzSalaryDetail{" +
|
||||
|
||||
@ -5,7 +5,6 @@ import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.evo.common.annotation.Excel;
|
||||
@ -17,7 +16,6 @@ import com.evo.common.core.domain.BaseEntity;
|
||||
* @author evo
|
||||
* @date 2024-11-26
|
||||
*/
|
||||
@Data
|
||||
public class RzSalaryStatistics extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
@ -45,12 +43,61 @@ public class RzSalaryStatistics extends BaseEntity
|
||||
|
||||
/** 删除标识 */
|
||||
private String delFlag;
|
||||
/***
|
||||
* 发放信息
|
||||
*/
|
||||
private String salaryInfo;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setMonth(Date month)
|
||||
{
|
||||
this.month = month;
|
||||
}
|
||||
|
||||
public Date getMonth()
|
||||
{
|
||||
return month;
|
||||
}
|
||||
public void setNumber(int number)
|
||||
{
|
||||
this.number = number;
|
||||
}
|
||||
|
||||
public int getNumber()
|
||||
{
|
||||
return number;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setRemarks(String remarks)
|
||||
{
|
||||
this.remarks = remarks;
|
||||
}
|
||||
|
||||
public String getRemarks()
|
||||
{
|
||||
return remarks;
|
||||
}
|
||||
public void setDelFlag(String delFlag)
|
||||
{
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public String getDelFlag()
|
||||
{
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
|
||||
@ -3,11 +3,10 @@ package com.evo.finance.domain.vo;
|
||||
import com.evo.common.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class SalaryVo implements Serializable {
|
||||
public class SalaryVo {
|
||||
|
||||
@Excel(name = "序号")
|
||||
private Integer seqNo;
|
||||
|
||||
@ -53,7 +53,7 @@ public interface RzSalaryDetailMapper extends BaseMapper<RzSalaryDetail>
|
||||
* @param staffId 工资详情主键
|
||||
* @return 工资详情
|
||||
*/
|
||||
public RzSalaryDetail selectRzSalaryDetailByStaffId(@Param("staffId") Long staffId, @Param("month")Date month);
|
||||
public RzSalaryDetail selectRzSalaryDetailByStaffId(Long staffId);
|
||||
|
||||
/**
|
||||
* 根据月份查询工资详情列表
|
||||
@ -62,14 +62,6 @@ public interface RzSalaryDetailMapper extends BaseMapper<RzSalaryDetail>
|
||||
* @return 工资详情集合
|
||||
*/
|
||||
public List<RzSalaryDetail> selectRzSalaryDetailByMonth(Date month);
|
||||
|
||||
/**
|
||||
* 根据月份删除工资详情列表
|
||||
*
|
||||
* @param month 工资详情
|
||||
* @return 工资详情集合
|
||||
*/
|
||||
public int deleteRzSalaryDetailByMonth(Date month);
|
||||
/**
|
||||
* 根据部门查询工资单
|
||||
* @return
|
||||
|
||||
@ -1,19 +0,0 @@
|
||||
package com.evo.finance.processor;
|
||||
|
||||
import com.evo.finance.domain.RzSalaryDetail;
|
||||
import com.evo.system.domain.SysStaffDetail;
|
||||
|
||||
/**
|
||||
* @desc: 接口
|
||||
* @ClassName:CalculationProcessor
|
||||
* @date: 2026年05月04日 14:36
|
||||
* @author: andy.shi
|
||||
* @contact: 17330188597
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
public interface CalculationProcessor {
|
||||
|
||||
boolean accept(String companyName);
|
||||
|
||||
RzSalaryDetail calculation(SysStaffDetail detail, RzSalaryDetail rzSalaryDetail);
|
||||
}
|
||||
@ -14,15 +14,12 @@ import com.evo.system.mapper.SysStaffDetailMapper;
|
||||
import com.evo.system.utils.SubsidyCalculationUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@ -42,9 +39,6 @@ public interface SalaryCalculationStrategyExchangeProcessor {
|
||||
SimpleDateFormat ymd = new SimpleDateFormat("yyyy-MM-dd");
|
||||
SimpleDateFormat ym = new SimpleDateFormat("yyyy-MM");
|
||||
SimpleDateFormat y = new SimpleDateFormat("yyyy");
|
||||
|
||||
|
||||
|
||||
boolean accept(SysStaffDetail detail);
|
||||
|
||||
/***
|
||||
@ -80,7 +74,7 @@ public interface SalaryCalculationStrategyExchangeProcessor {
|
||||
* 计算新薪资
|
||||
* @return
|
||||
*/
|
||||
void exchangeSalaryCalculation(SysStaff sysStaff, SysStaffDetail detail, RzSalaryDetail rzSalaryDetail, RzAttendanceStatistical attendanceStatistical, Map<Long, Boolean> overTimeMap, List<Map<String,Object>> salaryInfoMapList);
|
||||
void exchangeSalaryCalculation(SysStaff sysStaff, SysStaffDetail detail, RzSalaryDetail rzSalaryDetail, RzAttendanceStatistical attendanceStatistical, Map<Long, Boolean> overTimeMap);
|
||||
|
||||
void monthSalary(Date limitMonth, Date month, Date limitDate ,SysStaff sysStaff, SysStaffDetail sysStaffDetail, RzSalaryDetail rzSalaryDetail, RzAttendanceStatistical attendanceStatistical);
|
||||
|
||||
@ -225,13 +219,15 @@ public interface SalaryCalculationStrategyExchangeProcessor {
|
||||
* 开始计算薪资
|
||||
*/
|
||||
|
||||
default void calculation(SysStaff sysStaff, SysStaffDetail detail, RzSalaryDetail rzSalaryDetail, List<Map<String,Object>> salaryInfoMapList){
|
||||
default void calculation(SysStaff sysStaff, SysStaffDetail detail, RzSalaryDetail rzSalaryDetail){
|
||||
RzSalaryDetailMapper rzSalaryDetailMapper = SpringUtils.getBean(RzSalaryDetailMapper.class);
|
||||
SysStaffDetailMapper sysStaffDetailMapper = SpringUtils.getBean(SysStaffDetailMapper.class);
|
||||
|
||||
|
||||
//获取统计月份
|
||||
int curr_month = DateUtils.getMonth(rzSalaryDetail.getMonth());
|
||||
//获取工资统计月份,查询上个月的纳税公司 得到年度免征额
|
||||
RzSalaryDetail old_rzSalary = rzSalaryDetailMapper.selectRzSalaryDetailByStaffId(rzSalaryDetail.getStaffId(),DateUtils.addMonths(rzSalaryDetail.getMonth(), -1));
|
||||
RzSalaryDetail old_rzSalary = rzSalaryDetailMapper.selectRzSalaryDetailByStaffId(rzSalaryDetail.getStaffId());
|
||||
BigDecimal annualExemptionAmount = new BigDecimal("5000.00");
|
||||
//判断员工为 新入职,公司纳税主题改变,同一主题超一年的,同一主题不超一年但跨年的
|
||||
if(StringUtils.isNull(old_rzSalary) || !old_rzSalary.getWbFlag().equals(sysStaff.getCompanyName()) || curr_month == 12){
|
||||
@ -263,11 +259,79 @@ public interface SalaryCalculationStrategyExchangeProcessor {
|
||||
}
|
||||
|
||||
//判断是否外包,外包公司员工不做税(月薪50000不上税)
|
||||
Map<String, CalculationProcessor> calculationProcessorMap = SpringUtils.getApplicationContext().getBeansOfType(CalculationProcessor.class);
|
||||
for (CalculationProcessor processor : calculationProcessorMap.values()) {
|
||||
if (processor.accept(sysStaff.getCompanyName().toUpperCase())) {
|
||||
rzSalaryDetail = processor.calculation(detail, rzSalaryDetail);
|
||||
if(ParamUtils.getWebCompany().contains(sysStaff.getCompanyName().toUpperCase())){
|
||||
// 实发工资 = 税前工资
|
||||
rzSalaryDetail.setNetPayroll(rzSalaryDetail.getSalaryBeforeTax().subtract(rzSalaryDetail.getMealFee()));
|
||||
// 此阶税率为百分之3,速减数为0
|
||||
rzSalaryDetail.setTaxRate(DataUtils.DEFAULT_VALUE);
|
||||
// 速算扣除数(速算扣除数跟税率同步)
|
||||
rzSalaryDetail.setSlowDownTheDeduction(DataUtils.DEFAULT_VALUE);
|
||||
// 本年累计已缴税额
|
||||
rzSalaryDetail.setAggregatePersonalIncomeTax(DataUtils.DEFAULT_VALUE);
|
||||
rzSalaryDetail.setTaxPayable(DataUtils.DEFAULT_VALUE);
|
||||
}else {
|
||||
|
||||
// 判断应纳税所得额额度(额度不一样税率不一样)
|
||||
if (rzSalaryDetail.getTaxableIncome().doubleValue() > 0 && rzSalaryDetail.getTaxableIncome().doubleValue() <= 36000l) {
|
||||
// 此阶税率为百分之3,速减数为0
|
||||
rzSalaryDetail.setTaxRate(new BigDecimal("0.03"));
|
||||
// 速算扣除数(速算扣除数跟税率同步)
|
||||
rzSalaryDetail.setSlowDownTheDeduction(new BigDecimal("0"));
|
||||
} else if (rzSalaryDetail.getTaxableIncome().doubleValue() > 36000l && rzSalaryDetail.getTaxableIncome().doubleValue() <= 144000L) {
|
||||
// 此阶税率为百分之3,速减数为0
|
||||
rzSalaryDetail.setTaxRate(new BigDecimal("0.10"));
|
||||
// 速算扣除数(速算扣除数跟税率同步)
|
||||
rzSalaryDetail.setSlowDownTheDeduction(new BigDecimal("2520"));
|
||||
} else if (rzSalaryDetail.getTaxableIncome().doubleValue() > 144000L && rzSalaryDetail.getTaxableIncome().doubleValue() <= 300000l) {
|
||||
// 此阶税率为百分之3,速减数为0
|
||||
rzSalaryDetail.setTaxRate(new BigDecimal("0.20"));
|
||||
// 速算扣除数(速算扣除数跟税率同步)
|
||||
rzSalaryDetail.setSlowDownTheDeduction(new BigDecimal("16920"));
|
||||
} else if (rzSalaryDetail.getTaxableIncome().doubleValue() > 300000l && rzSalaryDetail.getTaxableIncome().doubleValue() <= 420000l) {
|
||||
// 此阶税率为百分之3,速减数为0
|
||||
rzSalaryDetail.setTaxRate(new BigDecimal("0.25"));
|
||||
// 速算扣除数(速算扣除数跟税率同步)
|
||||
rzSalaryDetail.setSlowDownTheDeduction(new BigDecimal("31920"));
|
||||
} else if (rzSalaryDetail.getTaxableIncome().doubleValue() > 420000l && rzSalaryDetail.getTaxableIncome().doubleValue() <= 660000l) {
|
||||
// 此阶税率为百分之3,速减数为0
|
||||
rzSalaryDetail.setTaxRate(new BigDecimal("0.30"));
|
||||
// 速算扣除数(速算扣除数跟税率同步)
|
||||
rzSalaryDetail.setSlowDownTheDeduction(new BigDecimal("52920"));
|
||||
} else if (rzSalaryDetail.getTaxableIncome().doubleValue() > 660000l && rzSalaryDetail.getTaxableIncome().doubleValue() <= 960000l) {
|
||||
// 此阶税率为百分之3,速减数为0
|
||||
rzSalaryDetail.setTaxRate(new BigDecimal("0.35"));
|
||||
// 速算扣除数(速算扣除数跟税率同步)
|
||||
rzSalaryDetail.setSlowDownTheDeduction(new BigDecimal("85920"));
|
||||
} else if (rzSalaryDetail.getTaxableIncome().doubleValue() > 960000l) {
|
||||
// 此阶税率为百分之3,速减数为0
|
||||
rzSalaryDetail.setTaxRate(new BigDecimal("0.45"));
|
||||
// 速算扣除数(速算扣除数跟税率同步)
|
||||
rzSalaryDetail.setSlowDownTheDeduction(new BigDecimal("181920"));
|
||||
} else {
|
||||
// 应纳税所得额小于0(免征额+专项扣除>应发工资时)
|
||||
// 此阶税率为百分之0,速减数为0
|
||||
rzSalaryDetail.setTaxRate(new BigDecimal("0.00"));
|
||||
// 速算扣除数(速算扣除数跟税率同步)
|
||||
rzSalaryDetail.setSlowDownTheDeduction(new BigDecimal("0"));
|
||||
}
|
||||
|
||||
|
||||
// 判断税前工资是否大于5000,如果小于,则不在计算个税
|
||||
if (rzSalaryDetail.getSalaryBeforeTax().doubleValue() > 5000.00){
|
||||
// 本月应缴税额(本月应纳税所得额*税率-速减数-本年累计已预缴个税)
|
||||
rzSalaryDetail.setTaxPayable(rzSalaryDetail.getTaxableIncome().multiply(rzSalaryDetail.getTaxRate()).setScale(2, BigDecimal.ROUND_HALF_UP).subtract(rzSalaryDetail.getSlowDownTheDeduction()).subtract(detail.getAggregatePersonalIncomeTax()));
|
||||
if (rzSalaryDetail.getTaxPayable().doubleValue() <= 0) {
|
||||
rzSalaryDetail.setTaxPayable(new BigDecimal("0.00"));
|
||||
}
|
||||
} else {
|
||||
// 应纳税所得额
|
||||
rzSalaryDetail.setTaxableIncome(new BigDecimal("0.00"));
|
||||
rzSalaryDetail.setTaxPayable(new BigDecimal("0.00"));
|
||||
}
|
||||
// 实发工资(税前工资-本月应缴个人所得税)
|
||||
rzSalaryDetail.setNetPayroll(rzSalaryDetail.getSalaryBeforeTax().subtract(rzSalaryDetail.getTaxPayable()).subtract(rzSalaryDetail.getMealFee()));
|
||||
// 本年累计已缴税额
|
||||
rzSalaryDetail.setAggregatePersonalIncomeTax(detail.getAggregatePersonalIncomeTax().add(rzSalaryDetail.getTaxPayable()));
|
||||
}
|
||||
rzSalaryDetail.setId(null);
|
||||
//更新下全年累计
|
||||
@ -275,50 +339,29 @@ public interface SalaryCalculationStrategyExchangeProcessor {
|
||||
if(rzSalaryDetailMapper.insert(rzSalaryDetail)< 0){
|
||||
throw new RuntimeException("生成员工考勤详情失败");
|
||||
}
|
||||
Map<String, Object> salaryInfoMap = Collections.asMap("detailId", detail.getId());
|
||||
//判断统计月缴费公司和上一次是否一个公司
|
||||
if(StringUtils.isNull(old_rzSalary)
|
||||
|| !old_rzSalary.getWbFlag().equals(sysStaff.getCompanyName())
|
||||
//判断12月, 是个税系统, 每年12月更新, 开始累计次年1月数据
|
||||
|| curr_month == 12){
|
||||
// 把本年累计已缴个税保存到员工信息表中
|
||||
salaryInfoMap.put("aggregatePersonalIncomeTax", rzSalaryDetail.getTaxPayable());
|
||||
detail.setAggregatePersonalIncomeTax(rzSalaryDetail.getTaxPayable());
|
||||
// 把本年累计专项扣除保存到员工信息表中
|
||||
salaryInfoMap.put("specialDeduction", kouChu);
|
||||
detail.setSpecialDeduction(kouChu);
|
||||
// 把本年累计已发工资保存到员工信息表中
|
||||
salaryInfoMap.put("totalWages", rzSalaryDetail.getSalaryBeforeTax());
|
||||
}else{
|
||||
// 把本年累计已缴个税保存到员工信息表中
|
||||
salaryInfoMap.put("aggregatePersonalIncomeTax", rzSalaryDetail.getAggregatePersonalIncomeTax());
|
||||
// 把本年累计专项扣除保存到员工信息表中
|
||||
salaryInfoMap.put("specialDeduction", detail.getSpecialDeduction().add(kouChu));
|
||||
// 把本年累计已发工资保存到员工信息表中
|
||||
salaryInfoMap.put("totalWages", rzSalaryDetail.getTotalWages());
|
||||
}
|
||||
salaryInfoMapList.add(salaryInfoMap);
|
||||
detail.setTotalWages(rzSalaryDetail.getSalaryBeforeTax());
|
||||
|
||||
//判断统计月缴费公司和上一次是否一个公司
|
||||
// if(StringUtils.isNull(old_rzSalary)
|
||||
// || !old_rzSalary.getWbFlag().equals(sysStaff.getCompanyName())
|
||||
// //判断12月, 是个税系统, 每年12月更新, 开始累计次年1月数据
|
||||
// || curr_month == 12){
|
||||
// // 把本年累计已缴个税保存到员工信息表中
|
||||
// detail.setAggregatePersonalIncomeTax(rzSalaryDetail.getTaxPayable());
|
||||
// // 把本年累计专项扣除保存到员工信息表中
|
||||
// detail.setSpecialDeduction(kouChu);
|
||||
// // 把本年累计已发工资保存到员工信息表中
|
||||
// detail.setTotalWages(rzSalaryDetail.getSalaryBeforeTax());
|
||||
//
|
||||
// }else{
|
||||
// // 把本年累计个税
|
||||
// detail.setAggregatePersonalIncomeTax(rzSalaryDetail.getAggregatePersonalIncomeTax());
|
||||
// // 把本年累计专项扣除保存到员工信息表中
|
||||
// detail.setSpecialDeduction(detail.getSpecialDeduction().add(kouChu));
|
||||
// // 把本年累计已发工资保存到员工信息表中
|
||||
// detail.setTotalWages(rzSalaryDetail.getTotalWages());
|
||||
// }
|
||||
// if(sysStaffDetailMapper.updateSysStaffDetail(detail)< 0){
|
||||
// throw new RuntimeException("更新员工详情信息异常");
|
||||
// }
|
||||
}else{
|
||||
// 把本年累计个税
|
||||
detail.setAggregatePersonalIncomeTax(rzSalaryDetail.getAggregatePersonalIncomeTax());
|
||||
// 把本年累计专项扣除保存到员工信息表中
|
||||
detail.setSpecialDeduction(detail.getSpecialDeduction().add(kouChu));
|
||||
// 把本年累计已发工资保存到员工信息表中
|
||||
detail.setTotalWages(rzSalaryDetail.getTotalWages());
|
||||
}
|
||||
if(sysStaffDetailMapper.updateSysStaffDetail(detail)< 0){
|
||||
throw new RuntimeException("更新员工详情信息异常");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -42,11 +42,11 @@ public class DailyWageStrategyExchangeProcessor implements SalaryCalculationStra
|
||||
@Override
|
||||
public boolean accept(SysStaffDetail detail) {
|
||||
//日薪不为空, 并且大于0
|
||||
return detail != null && detail.getDailyWage() != null && detail.getDailyWage().compareTo(new BigDecimal(0)) > 0;
|
||||
return detail.getDailyWage() != null && detail.getDailyWage().compareTo(new BigDecimal(0)) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exchangeSalaryCalculation(SysStaff sysStaff, SysStaffDetail sysStaffDetail, RzSalaryDetail rzSalaryDetail, RzAttendanceStatistical attendanceStatistical, Map<Long, Boolean> overTimeMap, List<Map<String,Object>> salaryInfoMapList) {
|
||||
public void exchangeSalaryCalculation(SysStaff sysStaff, SysStaffDetail sysStaffDetail, RzSalaryDetail rzSalaryDetail, RzAttendanceStatistical attendanceStatistical, Map<Long, Boolean> overTimeMap) {
|
||||
// //计算社保
|
||||
// socialSecurity(sysStaff,sysStaffDetail, attendanceStatistical);
|
||||
|
||||
@ -54,7 +54,7 @@ public class DailyWageStrategyExchangeProcessor implements SalaryCalculationStra
|
||||
buildRzSalaryDetail(false, sysStaff, sysStaffDetail,rzSalaryDetail, attendanceStatistical);
|
||||
|
||||
//计算薪资
|
||||
calculation(sysStaff, sysStaffDetail,rzSalaryDetail, salaryInfoMapList);
|
||||
calculation(sysStaff, sysStaffDetail,rzSalaryDetail);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,71 +0,0 @@
|
||||
package com.evo.finance.processor.impl;
|
||||
|
||||
import com.evo.common.utils.DataUtils;
|
||||
import com.evo.common.utils.ParamUtils;
|
||||
import com.evo.finance.domain.RzSalaryDetail;
|
||||
import com.evo.finance.processor.CalculationProcessor;
|
||||
import com.evo.system.domain.SysStaffDetail;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @desc:
|
||||
* @ClassName:LWTaxCalculationProcessor
|
||||
* @date: 2026年05月04日 14:42
|
||||
* @author: andy.shi
|
||||
* @contact: 17330188597
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Service
|
||||
public class LWTaxCalculationProcessor implements CalculationProcessor {
|
||||
private String companyName;
|
||||
@Override
|
||||
public boolean accept(String companyName) {
|
||||
this.companyName = companyName;;
|
||||
return ParamUtils.getWeBaoTaxCompany().contains(companyName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RzSalaryDetail calculation(SysStaffDetail detail, RzSalaryDetail rzSalaryDetail) {
|
||||
//年度免征额 强制归0
|
||||
rzSalaryDetail.setAnnualExemptionAmount(DataUtils.DEFAULT_VALUE);
|
||||
|
||||
if (rzSalaryDetail.getSalaryBeforeTax().doubleValue() <= 4000) {
|
||||
rzSalaryDetail.setTaxableIncome(rzSalaryDetail.getSalaryBeforeTax().subtract(BigDecimal.valueOf(800)));
|
||||
if (rzSalaryDetail.getTaxableIncome().doubleValue() <= 0) {
|
||||
rzSalaryDetail.setTaxableIncome(new BigDecimal("0.00"));
|
||||
}
|
||||
}else{
|
||||
rzSalaryDetail.setTaxableIncome(rzSalaryDetail.getSalaryBeforeTax().subtract(rzSalaryDetail.getSalaryBeforeTax().multiply(new BigDecimal("0.2")).setScale(2, BigDecimal.ROUND_HALF_UP)));
|
||||
}
|
||||
|
||||
if (rzSalaryDetail.getTaxableIncome().doubleValue() <= 20000L) {
|
||||
// 此阶税率为百分之3,速减数为0
|
||||
rzSalaryDetail.setTaxRate(new BigDecimal("0.20"));
|
||||
// 速算扣除数(速算扣除数跟税率同步)
|
||||
rzSalaryDetail.setSlowDownTheDeduction(DataUtils.DEFAULT_VALUE);
|
||||
} else if (rzSalaryDetail.getTaxableIncome().doubleValue() > 20000L && rzSalaryDetail.getTaxableIncome().doubleValue() <= 50000l) {
|
||||
// 此阶税率为百分之3,速减数为0
|
||||
rzSalaryDetail.setTaxRate(new BigDecimal("0.3"));
|
||||
// 速算扣除数(速算扣除数跟税率同步)
|
||||
rzSalaryDetail.setSlowDownTheDeduction(new BigDecimal("2000"));
|
||||
} else if (rzSalaryDetail.getTaxableIncome().doubleValue() > 50000l) {
|
||||
// 此阶税率为百分之3,速减数为0
|
||||
rzSalaryDetail.setTaxRate(new BigDecimal("0.40"));
|
||||
// 速算扣除数(速算扣除数跟税率同步)
|
||||
rzSalaryDetail.setSlowDownTheDeduction(new BigDecimal("7000"));
|
||||
}
|
||||
rzSalaryDetail.setTaxPayable(rzSalaryDetail.getTaxableIncome().multiply(rzSalaryDetail.getTaxRate()).setScale(2, BigDecimal.ROUND_HALF_UP).subtract(rzSalaryDetail.getSlowDownTheDeduction()));
|
||||
if (rzSalaryDetail.getTaxPayable().doubleValue() < 0) {
|
||||
rzSalaryDetail.setTaxPayable(new BigDecimal("0.00"));
|
||||
}
|
||||
|
||||
// 实发工资(税前工资-本月应缴个人所得税)
|
||||
rzSalaryDetail.setNetPayroll(rzSalaryDetail.getSalaryBeforeTax().subtract(rzSalaryDetail.getTaxPayable()).subtract(rzSalaryDetail.getMealFee()));
|
||||
// 本年累计已缴税额
|
||||
rzSalaryDetail.setAggregatePersonalIncomeTax(rzSalaryDetail.getTaxPayable());
|
||||
|
||||
return rzSalaryDetail;
|
||||
}
|
||||
}
|
||||
@ -12,8 +12,6 @@ import com.evo.finance.processor.SalaryCalculationStrategyExchangeProcessor;
|
||||
import com.evo.personnelMatters.mapper.RzLeaveDetailMapper;
|
||||
import com.evo.system.domain.SysStaff;
|
||||
import com.evo.system.domain.SysStaffDetail;
|
||||
import com.evo.utils.DateUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@ -38,14 +36,12 @@ public class MonthlySalaryStrategyExchangeProcessor implements SalaryCalculation
|
||||
private RzAttendanceMapper rzAttendanceMapper;
|
||||
@Resource
|
||||
private RzLeaveDetailMapper rzLeaveDetailMapper;
|
||||
@Autowired
|
||||
private DateUtil dateUtil1;
|
||||
|
||||
|
||||
@Override
|
||||
public boolean accept(SysStaffDetail detail) {
|
||||
//基本工资不为空, 并且大于0 并且岗位工资不为空, 并且大于0
|
||||
return (detail != null && detail.getBasicSalary() != null && detail.getBasicSalary().compareTo(new BigDecimal(0)) > 0) && (detail.getJobsSalary() != null && detail.getJobsSalary().compareTo(new BigDecimal(0)) > 0);
|
||||
return (detail.getBasicSalary() != null && detail.getBasicSalary().compareTo(new BigDecimal(0)) > 0) && (detail.getJobsSalary() != null && detail.getJobsSalary().compareTo(new BigDecimal(0)) > 0);
|
||||
}
|
||||
|
||||
/***
|
||||
@ -56,13 +52,13 @@ public class MonthlySalaryStrategyExchangeProcessor implements SalaryCalculation
|
||||
* @param overTimeMap
|
||||
*/
|
||||
@Override
|
||||
public void exchangeSalaryCalculation(SysStaff sysStaff, SysStaffDetail sysStaffDetail, RzSalaryDetail rzSalaryDetail, RzAttendanceStatistical attendanceStatistical, Map<Long, Boolean> overTimeMap, List<Map<String,Object>> salaryInfoMapList) {
|
||||
public void exchangeSalaryCalculation(SysStaff sysStaff, SysStaffDetail sysStaffDetail, RzSalaryDetail rzSalaryDetail, RzAttendanceStatistical attendanceStatistical, Map<Long, Boolean> overTimeMap) {
|
||||
//计算社保
|
||||
//socialSecurity(sysStaff,sysStaffDetail, attendanceStatistical);
|
||||
//组件基础数据
|
||||
buildRzSalaryDetail(true, sysStaff, sysStaffDetail,rzSalaryDetail, attendanceStatistical);
|
||||
//计算薪资
|
||||
calculation(sysStaff, sysStaffDetail,rzSalaryDetail, salaryInfoMapList);
|
||||
calculation(sysStaff, sysStaffDetail,rzSalaryDetail);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -120,28 +116,6 @@ public class MonthlySalaryStrategyExchangeProcessor implements SalaryCalculation
|
||||
// rzSalaryDetail.setMonthSalary(rzSalaryDetail.getMonthSalary().add(gs));
|
||||
rzSalaryDetail.setBjAmount(gs);
|
||||
}
|
||||
if(sysStaff.getName().equals("史国臣")){
|
||||
System.out.println("11111");
|
||||
}
|
||||
|
||||
BigDecimal basic = new BigDecimal("0");
|
||||
Long basicHour = 0l;
|
||||
for (Long type: ParamUtils.getBasicVacation()) {
|
||||
Long hour = rzLeaveDetailMapper.selectLeaveHourByUserIdAndDateAndType(sysStaff.getUserId(), rzSalaryDetail.getMonth(), type);
|
||||
if(hour.compareTo(0l)> 0){
|
||||
basicHour = basicHour+ hour;
|
||||
}
|
||||
}
|
||||
if(basicHour.compareTo(0l)> 0){
|
||||
//存在工伤假, 需要计算
|
||||
basic = rzSalaryDetail.getBasicSalary().divide(new BigDecimal(ParamUtils.getMonthWorkDayNum(DateUtils.getYear(rzSalaryDetail.getMonth()), DateUtils.getMonth(rzSalaryDetail.getMonth()))),2, RoundingMode.HALF_UP).multiply(new BigDecimal(basicHour).divide(Constants.DAY_WORK_HOUR,2,RoundingMode.HALF_UP));
|
||||
// rzSalaryDetail.setMonthSalary(rzSalaryDetail.getMonthSalary().add(gs));
|
||||
// rzSalaryDetail.setBjAmount(DataUtils.findDefaultValue(rzSalaryDetail.getBjAmount(), DataUtils.DEFAULT_VALUE).add(basic));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
BigDecimal gsj = new BigDecimal(0);
|
||||
Long totalAllHour = 0l;
|
||||
for (Long type: ParamUtils.getFullPaidLeave()) {
|
||||
@ -183,7 +157,7 @@ public class MonthlySalaryStrategyExchangeProcessor implements SalaryCalculation
|
||||
//计算社保占比
|
||||
socialSecurity(sysStaff, detail, gsj, attendanceStatistical);
|
||||
|
||||
//缺勤扣款
|
||||
rzSalaryDetail.setAbsenteeismSalary(hourlyWage.multiply(attendanceStatistical.getAbsenteeism().subtract(new BigDecimal(totalAllHour))).subtract(basic));
|
||||
//请假时长
|
||||
rzSalaryDetail.setAbsenteeismSalary(hourlyWage.multiply(attendanceStatistical.getAbsenteeism().subtract(new BigDecimal(totalAllHour))));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,39 +0,0 @@
|
||||
package com.evo.finance.processor.impl;
|
||||
|
||||
import com.evo.common.utils.DataUtils;
|
||||
import com.evo.common.utils.ParamUtils;
|
||||
import com.evo.finance.domain.RzSalaryDetail;
|
||||
import com.evo.finance.processor.CalculationProcessor;
|
||||
import com.evo.system.domain.SysStaffDetail;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @desc:
|
||||
* @ClassName:NotTaxCalculationProcessor
|
||||
* @date: 2026年05月04日 14:40
|
||||
* @author: andy.shi
|
||||
* @contact: 17330188597
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Service
|
||||
public class NotTaxCalculationProcessor implements CalculationProcessor {
|
||||
@Override
|
||||
public boolean accept(String companyName) {
|
||||
return ParamUtils.getWebCompany().contains(companyName.toUpperCase());
|
||||
}
|
||||
|
||||
@Override
|
||||
public RzSalaryDetail calculation(SysStaffDetail detail, RzSalaryDetail rzSalaryDetail) {
|
||||
// 实发工资 = 税前工资
|
||||
rzSalaryDetail.setNetPayroll(rzSalaryDetail.getSalaryBeforeTax().subtract(rzSalaryDetail.getMealFee()));
|
||||
// 此阶税率为百分之3,速减数为0
|
||||
rzSalaryDetail.setTaxRate(DataUtils.DEFAULT_VALUE);
|
||||
// 速算扣除数(速算扣除数跟税率同步)
|
||||
rzSalaryDetail.setSlowDownTheDeduction(DataUtils.DEFAULT_VALUE);
|
||||
// 本年累计已缴税额
|
||||
rzSalaryDetail.setAggregatePersonalIncomeTax(DataUtils.DEFAULT_VALUE);
|
||||
rzSalaryDetail.setTaxPayable(DataUtils.DEFAULT_VALUE);
|
||||
|
||||
return rzSalaryDetail;
|
||||
}
|
||||
}
|
||||
@ -1,91 +0,0 @@
|
||||
package com.evo.finance.processor.impl;
|
||||
|
||||
import com.evo.common.utils.DataUtils;
|
||||
import com.evo.common.utils.ParamUtils;
|
||||
import com.evo.finance.domain.RzSalaryDetail;
|
||||
import com.evo.finance.processor.CalculationProcessor;
|
||||
import com.evo.system.domain.SysStaffDetail;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @desc:
|
||||
* @ClassName:TaxCalculationProcessor
|
||||
* @date: 2026年05月04日 14:42
|
||||
* @author: andy.shi
|
||||
* @contact: 17330188597
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Service
|
||||
public class TaxCalculationProcessor implements CalculationProcessor {
|
||||
@Override
|
||||
public boolean accept(String companyName) {
|
||||
return !ParamUtils.getWeBaoTaxCompany().contains(companyName) && !ParamUtils.getWebCompany().contains(companyName.toUpperCase()) ;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RzSalaryDetail calculation(SysStaffDetail detail, RzSalaryDetail rzSalaryDetail) {
|
||||
// 判断应纳税所得额额度(额度不一样税率不一样)
|
||||
if (rzSalaryDetail.getTaxableIncome().doubleValue() > 0 && rzSalaryDetail.getTaxableIncome().doubleValue() <= 36000l) {
|
||||
// 此阶税率为百分之3,速减数为0
|
||||
rzSalaryDetail.setTaxRate(new BigDecimal("0.03"));
|
||||
// 速算扣除数(速算扣除数跟税率同步)
|
||||
rzSalaryDetail.setSlowDownTheDeduction(new BigDecimal("0"));
|
||||
} else if (rzSalaryDetail.getTaxableIncome().doubleValue() > 36000l && rzSalaryDetail.getTaxableIncome().doubleValue() <= 144000L) {
|
||||
// 此阶税率为百分之3,速减数为0
|
||||
rzSalaryDetail.setTaxRate(new BigDecimal("0.10"));
|
||||
// 速算扣除数(速算扣除数跟税率同步)
|
||||
rzSalaryDetail.setSlowDownTheDeduction(new BigDecimal("2520"));
|
||||
} else if (rzSalaryDetail.getTaxableIncome().doubleValue() > 144000L && rzSalaryDetail.getTaxableIncome().doubleValue() <= 300000l) {
|
||||
// 此阶税率为百分之3,速减数为0
|
||||
rzSalaryDetail.setTaxRate(new BigDecimal("0.20"));
|
||||
// 速算扣除数(速算扣除数跟税率同步)
|
||||
rzSalaryDetail.setSlowDownTheDeduction(new BigDecimal("16920"));
|
||||
} else if (rzSalaryDetail.getTaxableIncome().doubleValue() > 300000l && rzSalaryDetail.getTaxableIncome().doubleValue() <= 420000l) {
|
||||
// 此阶税率为百分之3,速减数为0
|
||||
rzSalaryDetail.setTaxRate(new BigDecimal("0.25"));
|
||||
// 速算扣除数(速算扣除数跟税率同步)
|
||||
rzSalaryDetail.setSlowDownTheDeduction(new BigDecimal("31920"));
|
||||
} else if (rzSalaryDetail.getTaxableIncome().doubleValue() > 420000l && rzSalaryDetail.getTaxableIncome().doubleValue() <= 660000l) {
|
||||
// 此阶税率为百分之3,速减数为0
|
||||
rzSalaryDetail.setTaxRate(new BigDecimal("0.30"));
|
||||
// 速算扣除数(速算扣除数跟税率同步)
|
||||
rzSalaryDetail.setSlowDownTheDeduction(new BigDecimal("52920"));
|
||||
} else if (rzSalaryDetail.getTaxableIncome().doubleValue() > 660000l && rzSalaryDetail.getTaxableIncome().doubleValue() <= 960000l) {
|
||||
// 此阶税率为百分之3,速减数为0
|
||||
rzSalaryDetail.setTaxRate(new BigDecimal("0.35"));
|
||||
// 速算扣除数(速算扣除数跟税率同步)
|
||||
rzSalaryDetail.setSlowDownTheDeduction(new BigDecimal("85920"));
|
||||
} else if (rzSalaryDetail.getTaxableIncome().doubleValue() > 960000l) {
|
||||
// 此阶税率为百分之3,速减数为0
|
||||
rzSalaryDetail.setTaxRate(new BigDecimal("0.45"));
|
||||
// 速算扣除数(速算扣除数跟税率同步)
|
||||
rzSalaryDetail.setSlowDownTheDeduction(new BigDecimal("181920"));
|
||||
} else {
|
||||
// 应纳税所得额小于0(免征额+专项扣除>应发工资时)
|
||||
// 此阶税率为百分之0,速减数为0
|
||||
rzSalaryDetail.setTaxRate(new BigDecimal("0.00"));
|
||||
// 速算扣除数(速算扣除数跟税率同步)
|
||||
rzSalaryDetail.setSlowDownTheDeduction(new BigDecimal("0"));
|
||||
}
|
||||
// 判断税前工资是否大于5000,如果小于,则不在计算个税
|
||||
if (rzSalaryDetail.getSalaryBeforeTax().doubleValue() > 5000.00){
|
||||
// 本月应缴税额(本月应纳税所得额*税率-速减数-本年累计已预缴个税)
|
||||
rzSalaryDetail.setTaxPayable(rzSalaryDetail.getTaxableIncome().multiply(rzSalaryDetail.getTaxRate()).setScale(2, BigDecimal.ROUND_HALF_UP).subtract(rzSalaryDetail.getSlowDownTheDeduction()).subtract(detail.getAggregatePersonalIncomeTax()));
|
||||
if (rzSalaryDetail.getTaxPayable().doubleValue() <= 0) {
|
||||
rzSalaryDetail.setTaxPayable(new BigDecimal("0.00"));
|
||||
}
|
||||
} else {
|
||||
// 应纳税所得额
|
||||
rzSalaryDetail.setTaxableIncome(new BigDecimal("0.00"));
|
||||
rzSalaryDetail.setTaxPayable(new BigDecimal("0.00"));
|
||||
}
|
||||
// 实发工资(税前工资-本月应缴个人所得税)
|
||||
rzSalaryDetail.setNetPayroll(rzSalaryDetail.getSalaryBeforeTax().subtract(rzSalaryDetail.getTaxPayable()).subtract(rzSalaryDetail.getMealFee()));
|
||||
// 本年累计已缴税额
|
||||
rzSalaryDetail.setAggregatePersonalIncomeTax(detail.getAggregatePersonalIncomeTax().add(rzSalaryDetail.getTaxPayable()));
|
||||
|
||||
return rzSalaryDetail;
|
||||
}
|
||||
}
|
||||
@ -35,6 +35,4 @@ public interface IRzSalaryStatisticsService extends IService<RzSalaryStatistics>
|
||||
* @return 结果
|
||||
*/
|
||||
public AjaxResult deleteRzSalaryStatisticsById(Long id);
|
||||
|
||||
public AjaxResult confirmRzSalaryStatisticsById(Long id);
|
||||
}
|
||||
|
||||
@ -1,15 +1,11 @@
|
||||
package com.evo.finance.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.evo.attendance.domain.RzAttendanceStatistical;
|
||||
import com.evo.attendance.mapper.RzAttendanceStatisticalMapper;
|
||||
import com.evo.common.constant.Constants;
|
||||
import com.evo.common.core.domain.AjaxResult;
|
||||
import com.evo.common.core.domain.entity.DeptMonthHistory;
|
||||
import com.evo.common.core.domain.entity.SysDept;
|
||||
import com.evo.common.core.domain.entity.SysDictData;
|
||||
import com.evo.common.utils.*;
|
||||
@ -24,8 +20,10 @@ import com.evo.finance.processor.SalaryCalculationStrategyExchangeProcessor;
|
||||
import com.evo.finance.service.IRzSalaryDetailService;
|
||||
import com.evo.system.domain.SysStaff;
|
||||
import com.evo.system.domain.SysStaffDetail;
|
||||
import com.evo.system.mapper.*;
|
||||
import com.evo.system.service.DeptMonthHistoryService;
|
||||
import com.evo.system.mapper.SysDeptMapper;
|
||||
import com.evo.system.mapper.SysDictDataMapper;
|
||||
import com.evo.system.mapper.SysStaffDetailMapper;
|
||||
import com.evo.system.mapper.SysStaffMapper;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
@ -63,8 +61,6 @@ public class RzSalaryDetailServiceImpl extends ServiceImpl<RzSalaryDetailMapper,
|
||||
private SysDictDataMapper sysDictDataMapper;
|
||||
@Autowired
|
||||
private ApplicationContext applicationContext;
|
||||
@Autowired
|
||||
private DeptMonthHistoryService deptMonthHistoryService;
|
||||
/**
|
||||
* 查询工资详情
|
||||
*
|
||||
@ -83,22 +79,11 @@ public class RzSalaryDetailServiceImpl extends ServiceImpl<RzSalaryDetailMapper,
|
||||
* @return 工资详情
|
||||
*/
|
||||
@Override
|
||||
public List<RzSalaryDetail> selectRzSalaryDetailList(RzSalaryDetail rzSalaryDetail) {
|
||||
public List<RzSalaryDetail> selectRzSalaryDetailList(RzSalaryDetail rzSalaryDetail)
|
||||
{
|
||||
List<RzSalaryDetail> res_list = rzSalaryDetailMapper.selectRzSalaryDetailList(rzSalaryDetail);
|
||||
List<DeptMonthHistory> list = deptMonthHistoryService.list();
|
||||
Map<String, String> historyMap = list.stream().collect(Collectors.toMap(DeptMonthHistory::getDateMonth, DeptMonthHistory::getDeptHistory));
|
||||
Map<String,Map<Long, String>> deptNameMaps = Collections.emptyMap();
|
||||
historyMap.keySet().forEach(key -> {
|
||||
if(StringUtils.isNotBlank(historyMap.get(key))){
|
||||
Map<Long, String> deptNameMap = Collections.emptyMap();
|
||||
deptNameMap.putAll(JSONArray.parseArray(historyMap.get(key), SysDept.class).stream().collect(Collectors.toMap(SysDept::getDeptId, SysDept::getDeptName)));
|
||||
deptNameMaps.put(key, deptNameMap);
|
||||
}
|
||||
});
|
||||
for (RzSalaryDetail salaryDetail : res_list) {
|
||||
String month = DateUtil.format(salaryDetail.getMonth(),"yyyy-MM");
|
||||
// salaryDetail.setDeptName(deptMapper.selectById(salaryDetail.getDeptId()).getDeptName());
|
||||
salaryDetail.setDeptName(deptNameMaps.containsKey(month) ? deptNameMaps.get(month).get(salaryDetail.getDeptId()) : deptMapper.selectById(salaryDetail.getDeptId()).getDeptName());
|
||||
salaryDetail.setDeptName(deptMapper.selectDeptById(salaryDetail.getDeptId()).getDeptName());
|
||||
}
|
||||
return res_list;
|
||||
}
|
||||
@ -154,12 +139,10 @@ public class RzSalaryDetailServiceImpl extends ServiceImpl<RzSalaryDetailMapper,
|
||||
e.printStackTrace();
|
||||
}
|
||||
Map<Long, Boolean> overTimeMap = deptMapper.selectList(new LambdaQueryWrapper<SysDept>().eq(SysDept::getDelFlag, Constants.DELETE_FLAG_0).select(SysDept::getIsOverTime, SysDept::getDeptId)).stream().collect(Collectors.toMap(SysDept::getDeptId,d->"0".equals(d.getIsOverTime())));
|
||||
List<Map<String,Object>> salaryInfoMapList = Collections.emptyList();
|
||||
|
||||
for (SysStaff sysStaff : st_list) {
|
||||
calculation(sysStaff, rzSalaryDetail.getMonth(), overTimeMap, 1, salaryInfoMapList);
|
||||
calculation(sysStaff, rzSalaryDetail.getMonth(), overTimeMap, 1);
|
||||
}
|
||||
rzSalaryStatistics.setSalaryInfo(JSON.toJSONString(salaryInfoMapList));
|
||||
rzSalaryStatisticsMapper.updateById(rzSalaryStatistics);
|
||||
//关闭日志记录
|
||||
ParamUtils.updateLogOperation(false);
|
||||
return AjaxResult.success();
|
||||
@ -176,34 +159,35 @@ public class RzSalaryDetailServiceImpl extends ServiceImpl<RzSalaryDetailMapper,
|
||||
}else{
|
||||
date = sysStaff.getEmploymentDate();
|
||||
}
|
||||
List<Map<String,Object>> salaryInfoMapList = Collections.emptyList();
|
||||
//进行离职工资计算操作
|
||||
while (date.compareTo(sysStaff.getQuitDate()) < 1){
|
||||
calculation(sysStaff, date, overTimeMap ,2, salaryInfoMapList);
|
||||
calculation(sysStaff, date, overTimeMap ,2);
|
||||
date = DateUtils.addMonths(date, 1);
|
||||
}
|
||||
}
|
||||
|
||||
public void calculation(SysStaff sysStaff, Date date, Map<Long, Boolean> overTimeMap, Integer type,List<Map<String,Object>> salaryInfoMapList){
|
||||
public static void main(String[] args) {
|
||||
System.out.println(DateUtils.parseDate("2025-05-21").compareTo(DateUtils.parseDate("2025-05-21 12:21:21")));
|
||||
}
|
||||
|
||||
public void calculation(SysStaff sysStaff, Date date, Map<Long, Boolean> overTimeMap, Integer type){
|
||||
RzSalaryDetail newRzSalaryDetail = new RzSalaryDetail();
|
||||
newRzSalaryDetail.setMonth(date);
|
||||
newRzSalaryDetail.setStaffId(sysStaff.getUserId()); //员工ID
|
||||
//newRzSalaryDetail.setDeptId(sysStaff.getDeptId()); //部门
|
||||
newRzSalaryDetail.setDeptId(sysStaff.getDeptId()); //部门
|
||||
newRzSalaryDetail.setName(sysStaff.getName()); //姓名
|
||||
newRzSalaryDetail.setWbFlag(sysStaff.getCompanyName()); //公司
|
||||
newRzSalaryDetail.setDelFlag(Constants.DELETE_FLAG_0);
|
||||
newRzSalaryDetail.setType(type);
|
||||
//查询考勤统计
|
||||
RzAttendanceStatistical attendanceStatistical = rzAttendanceStatisticalMapper.getRzAttendanceStatisticalByDateAndName(sysStaff.getUserId(), date);
|
||||
//修正, 考勤部门为历史部门
|
||||
newRzSalaryDetail.setDeptId(attendanceStatistical.getDeptId()); //部门
|
||||
//查询员工详情
|
||||
SysStaffDetail sysStaffDetail = sysStaffDetailMapper.selectSysStaffDetailByStaffId(sysStaff.getUserId());
|
||||
|
||||
Map<String, SalaryCalculationStrategyExchangeProcessor> salaryCalculationExchangeProcessorMap = applicationContext.getBeansOfType(SalaryCalculationStrategyExchangeProcessor.class);
|
||||
for (SalaryCalculationStrategyExchangeProcessor processor : salaryCalculationExchangeProcessorMap.values()) {
|
||||
if (processor.accept(sysStaffDetail)) {
|
||||
processor.exchangeSalaryCalculation(sysStaff, sysStaffDetail, newRzSalaryDetail, attendanceStatistical, overTimeMap, salaryInfoMapList);
|
||||
processor.exchangeSalaryCalculation(sysStaff, sysStaffDetail, newRzSalaryDetail, attendanceStatistical, overTimeMap);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -322,7 +306,7 @@ public class RzSalaryDetailServiceImpl extends ServiceImpl<RzSalaryDetailMapper,
|
||||
deptLists.add(depts);
|
||||
}
|
||||
SalaryVo result = sumSalaryVo(allList);
|
||||
result.setDeptName(sheetCompanyName+"合计");
|
||||
result.setDeptName(sheetCompanyName+"总计");
|
||||
result.setPeopleNum(dataList.size());
|
||||
allList.add(result);
|
||||
|
||||
@ -333,16 +317,10 @@ public class RzSalaryDetailServiceImpl extends ServiceImpl<RzSalaryDetailMapper,
|
||||
hjResult.setPeopleNum(dataList.size());
|
||||
List<SalaryVo> sortList = dataList.stream().sorted((x,y) -> {return x.getDeptName().compareTo(y.getDeptName()); }).collect(Collectors.toList());
|
||||
sortList.add(hjResult);
|
||||
List<SalaryVo> ewSalaryVoList = Collections.emptyList();
|
||||
for (SalaryVo salaryVo : sortList){
|
||||
SalaryVo allResult = new SalaryVo();
|
||||
BeanUtils.copyProperties(salaryVo,allResult);
|
||||
ewSalaryVoList.add(allResult);
|
||||
}
|
||||
companyLists.add(ewSalaryVoList);
|
||||
companyLists.add(sortList);
|
||||
}else{
|
||||
SalaryVo result = sumSalaryVo(dataList);
|
||||
result.setDeptName(sheetCompanyName+"合计");
|
||||
result.setDeptName(sheetCompanyName+"总计");
|
||||
result.setPeopleNum(dataList.size());
|
||||
allList.add(result);
|
||||
|
||||
@ -367,55 +345,39 @@ public class RzSalaryDetailServiceImpl extends ServiceImpl<RzSalaryDetailMapper,
|
||||
// allSheetNames.remove("河北伊特");
|
||||
companyLists.addAll(deptLists);
|
||||
|
||||
for (List<SalaryVo> dataList : companyLists){
|
||||
companyLists.stream().forEach(dataList
|
||||
->{
|
||||
int x = 1;
|
||||
for (SalaryVo salaryVo : dataList){
|
||||
salaryVo.setSeqNo(x++);
|
||||
}
|
||||
}
|
||||
// companyLists.stream().forEach(dataList ->{
|
||||
// int x = 1;
|
||||
// for (SalaryVo salaryVo : dataList){
|
||||
// salaryVo.setSeqNo(x++);
|
||||
// }
|
||||
// });
|
||||
});
|
||||
|
||||
return util.exportExcel(allList,companyLists,"总表", allSheetNames, new SimpleDateFormat("yyyy-MM").format(rzSalaryDetail.getMonth())+"月工资", "制表: "+"审核: "+"经理签字: "+"总经理签字:");
|
||||
|
||||
}
|
||||
|
||||
private List<SalaryVo> buildExportData(RzSalaryDetail rzSalaryDetail) {
|
||||
List<SysDept> deptList = Collections.emptyList();
|
||||
String history = deptMonthHistoryService.getDeptMonthHistory(DateUtil.format(rzSalaryDetail.getMonth(), "yyyy-MM"));
|
||||
if(StringUtils.isNotBlank(history)){
|
||||
deptList.addAll(JSONArray.parseArray(history, SysDept.class));
|
||||
}else{
|
||||
// 获取所有部门列表
|
||||
deptList.addAll(deptMapper.selectList(new LambdaQueryWrapper<SysDept>()));
|
||||
}
|
||||
|
||||
Map<Long, String> deptNameMap = Collections.emptyMap();
|
||||
for (SysDept dept : deptList) {
|
||||
deptNameMap.put(dept.getDeptId(), buildDept(dept.getDeptId(), deptList, deptNameMap));
|
||||
}
|
||||
List<SysDept> deptList = deptMapper.selectList(new LambdaQueryWrapper<SysDept>());
|
||||
//部门列表转换为部门ID到部门名称的映射
|
||||
// Map<Long, String> deptNameMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptId, SysDept::getDeptName));
|
||||
Map<Long, String> deptNameMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptId, SysDept::getDeptName));
|
||||
//键为部门ID,值为部门名称,用于快速查找父部门为根部门(ID为0)的部门名称
|
||||
Map<String, String> topDeptNameAndDeptIdMap = deptList.stream().filter(d -> d.getParentId().equals(0l)).collect(Collectors.toMap(d->String.valueOf(d.getDeptId()), SysDept::getDeptName));
|
||||
Map<String, String> nameAndDeptIdMap = deptList.stream().filter(d -> d.getParentId().equals(0l)).collect(Collectors.toMap(d->String.valueOf(d.getDeptId()), SysDept::getDeptName));
|
||||
Map<Long, String> companyNameMap = Collections.emptyMap();
|
||||
// 过滤出所有非根部门(即parentId不等于0的部门),并为每个部门执行以下操作
|
||||
deptList.stream().filter(d -> !d.getParentId().equals(0l)).forEach(d ->{
|
||||
// 将当前部门的祖ID字符串拆分成List以便后续处理
|
||||
List<String> parentIdList = Collections.asList(d.getAncestors().split(","));
|
||||
Iterator<String> it = topDeptNameAndDeptIdMap.keySet().iterator();
|
||||
Iterator<String> it = nameAndDeptIdMap.keySet().iterator();
|
||||
while (it.hasNext()){
|
||||
String pid = it.next();
|
||||
if(parentIdList.contains(pid)){
|
||||
companyNameMap.put(d.getDeptId(), topDeptNameAndDeptIdMap.get(pid));
|
||||
companyNameMap.put(d.getDeptId(), nameAndDeptIdMap.get(pid));
|
||||
}
|
||||
}
|
||||
});
|
||||
topDeptNameAndDeptIdMap.entrySet().stream().forEach(d->{
|
||||
nameAndDeptIdMap.entrySet().stream().forEach(d->{
|
||||
companyNameMap.put(Long.valueOf(d.getKey()), d.getValue());
|
||||
});
|
||||
|
||||
@ -440,21 +402,6 @@ public class RzSalaryDetailServiceImpl extends ServiceImpl<RzSalaryDetailMapper,
|
||||
return voResult;
|
||||
}
|
||||
|
||||
public String buildDept(Long deptId, List<SysDept> deptList, Map<Long,String> showDeptNameMap){
|
||||
if(showDeptNameMap.containsKey(deptList)){
|
||||
return showDeptNameMap.get(deptId);
|
||||
}
|
||||
SysDept sysDept = deptList.stream().filter(d -> d.getDeptId().equals(deptId)).findFirst().orElse(null);
|
||||
if(sysDept != null){
|
||||
if("1".equals(sysDept.getIsShowFinancial())){
|
||||
return sysDept.getDeptName();
|
||||
}else{
|
||||
return buildDept(sysDept.getParentId(), deptList, showDeptNameMap);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private List<RzSalaryDetail> selectRzSalaryDetaiList(RzSalaryDetail rzSalaryDetail) {
|
||||
return getBaseMapper().selectRzSalaryDetailList(rzSalaryDetail);
|
||||
}
|
||||
|
||||
@ -4,17 +4,12 @@ import java.text.SimpleDateFormat;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.evo.common.constant.Constants;
|
||||
import com.evo.common.core.domain.AjaxResult;
|
||||
import com.evo.common.utils.Collections;
|
||||
import com.evo.common.utils.DateUtils;
|
||||
import com.evo.common.utils.SecurityUtils;
|
||||
import com.evo.common.utils.StringUtils;
|
||||
import com.evo.finance.domain.RzSalaryDetail;
|
||||
import com.evo.finance.mapper.RzSalaryDetailMapper;
|
||||
import com.evo.system.domain.SysStaffDetail;
|
||||
@ -69,53 +64,38 @@ public class RzSalaryStatisticsServiceImpl extends ServiceImpl<RzSalaryStatistic
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public AjaxResult deleteRzSalaryStatisticsById(Long id){
|
||||
public AjaxResult deleteRzSalaryStatisticsById(Long id)
|
||||
{
|
||||
RzSalaryStatistics rzSalaryStatistics = rzSalaryStatisticsMapper.selectRzSalaryStatisticsById(id);
|
||||
//根据月份直接物理删除
|
||||
rzSalaryDetailMapper.deleteRzSalaryDetailByMonth(rzSalaryStatistics.getMonth());
|
||||
rzSalaryStatisticsMapper.deleteById(rzSalaryStatistics);
|
||||
// if(rzSalaryDetailMapper.deleteRzSalaryDetailByMonth(rzSalaryStatistics.getMonth()) < 1 || rzSalaryStatisticsMapper.deleteById(rzSalaryStatistics)< 1){
|
||||
// return AjaxResult.error();
|
||||
// }
|
||||
//根据月份查询员工的工资统计
|
||||
List<RzSalaryDetail> gz_list = rzSalaryDetailMapper.selectRzSalaryDetailByMonth(rzSalaryStatistics.getMonth());
|
||||
for (RzSalaryDetail rzSalaryDetail : gz_list) {
|
||||
//根据员工ID查询员工详情,修改员工详情
|
||||
SysStaffDetail sysStaffDetail = sysStaffDetailMapper.selectSysStaffDetailByStaffId(rzSalaryDetail.getStaffId());
|
||||
//修改个人详情
|
||||
sysStaffDetail.setAggregatePersonalIncomeTax(sysStaffDetail.getAggregatePersonalIncomeTax().subtract(rzSalaryDetail.getTaxPayable()));
|
||||
sysStaffDetail.setSpecialDeduction(sysStaffDetail.getSpecialDeduction().subtract(sysStaffDetail.getSpecialDeduction().subtract(rzSalaryDetail.getSpecialDeduction())));
|
||||
sysStaffDetail.setTotalWages(sysStaffDetail.getTotalWages().subtract(rzSalaryDetail.getSalaryBeforeTax()));
|
||||
int i = sysStaffDetailMapper.updateSysStaffDetail(sysStaffDetail);
|
||||
if(i < 1){
|
||||
return AjaxResult.error();
|
||||
}
|
||||
//删除个人员工工资详情
|
||||
rzSalaryDetail.setDelFlag(Constants.DELETE_FLAG_1);
|
||||
rzSalaryDetail.setUpdateBy(SecurityUtils.getUsername());
|
||||
rzSalaryDetail.setUpdateTime(DateUtils.getNowDate());
|
||||
i = rzSalaryDetailMapper.updateRzSalaryDetail(rzSalaryDetail);
|
||||
if(i < 1){
|
||||
return AjaxResult.error();
|
||||
}
|
||||
}
|
||||
rzSalaryStatistics.setDelFlag(Constants.DELETE_FLAG_1);
|
||||
rzSalaryStatistics.setUpdateTime(DateUtils.getNowDate());
|
||||
rzSalaryStatistics.setUpdateBy(SecurityUtils.getUsername());
|
||||
int p = rzSalaryStatisticsMapper.updateRzSalaryStatistics(rzSalaryStatistics);
|
||||
if(p< 1){
|
||||
return AjaxResult.error();
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult confirmRzSalaryStatisticsById(Long id) {
|
||||
RzSalaryStatistics rzSalaryStatistics = rzSalaryStatisticsMapper.selectById(id);
|
||||
if(rzSalaryStatistics == null){
|
||||
return AjaxResult.error("未找到统计信息");
|
||||
}
|
||||
if("已确认".equals(rzSalaryStatistics.getStatus())){
|
||||
return AjaxResult.error("当前信息已确认发放");
|
||||
}
|
||||
if(StringUtils.isEmpty(rzSalaryStatistics.getSalaryInfo())){
|
||||
return AjaxResult.error("未找到当前月份的薪资详情");
|
||||
}
|
||||
List<Long> detailIds = Collections.emptyList();
|
||||
JSONArray jsonArray = JSON.parseArray(rzSalaryStatistics.getSalaryInfo());
|
||||
for (int i = 0; i <jsonArray.size(); i++) {
|
||||
JSONObject jb = jsonArray.getJSONObject(i);
|
||||
if(jb != null){
|
||||
SysStaffDetail detail = sysStaffDetailMapper.selectSysStaffDetailById(jb.getLong("detailId"));
|
||||
if(detail != null){
|
||||
detail.setAggregatePersonalIncomeTax(jb.getBigDecimal("aggregatePersonalIncomeTax"));
|
||||
detail.setSpecialDeduction(jb.getBigDecimal("specialDeduction"));
|
||||
detail.setTotalWages(jb.getBigDecimal("totalWages"));
|
||||
sysStaffDetailMapper.updateById(detail);
|
||||
}else{
|
||||
detailIds.add(jb.getLong("detailId"));
|
||||
}
|
||||
}
|
||||
}
|
||||
if(Collections.isNotEmpty(detailIds)){
|
||||
return AjaxResult.error("部分员工详情未找到: 未找到的员工详情Id为: " + String.format(",", detailIds));
|
||||
}
|
||||
|
||||
rzSalaryStatistics.setStatus("已确认");
|
||||
rzSalaryStatisticsMapper.updateById(rzSalaryStatistics);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -57,6 +57,4 @@ public interface RzLeaveMapper extends BaseMapper<RzLeave>
|
||||
* @return
|
||||
*/
|
||||
public RzLeave queryRzLeaveByUserId(@Param("userId") Long userId);
|
||||
|
||||
public int updateDeptIdByStaffId(@Param("deptId") Long deptId, @Param("userId") Long userId);
|
||||
}
|
||||
|
||||
@ -335,7 +335,6 @@ public class RzLeaveDetailServiceImpl extends ServiceImpl<RzLeaveDetailMapper, R
|
||||
beginDate = DateUtils.addDays(beginDate,-1);
|
||||
//记录最终需要增加多少天
|
||||
Integer endDays = 0;
|
||||
Integer wordDays = holidayDates.size();
|
||||
//请假类型及不包含法休, 也不包含公休
|
||||
if(ParamUtils.getLeaveTypeNotIncludedFaXiuAndPublicHoliday().contains(flag)){
|
||||
//获取结果当中的假期时间
|
||||
@ -345,7 +344,6 @@ public class RzLeaveDetailServiceImpl extends ServiceImpl<RzLeaveDetailMapper, R
|
||||
rzLeaveDetail.setRemarks("不包含法定假日和周末");
|
||||
}
|
||||
endDays = new BigDecimal(endDays).add(new BigDecimal(holidays.size())).intValue();
|
||||
wordDays = endDays;
|
||||
}
|
||||
}else
|
||||
//请假类型不包含法休
|
||||
@ -357,16 +355,10 @@ public class RzLeaveDetailServiceImpl extends ServiceImpl<RzLeaveDetailMapper, R
|
||||
rzLeaveDetail.setRemarks("不包含法定假日");
|
||||
}
|
||||
}
|
||||
//因为包含公休, 所以需要剔除公休时长
|
||||
for (String year : yearList){
|
||||
List<String> holidays = Collections.findDuplicatesList(ParamUtils.getHoliddayList(Integer.valueOf(year), 2), holidayDates);
|
||||
//现有工作时长, 需要减去公休时长
|
||||
wordDays = new BigDecimal(wordDays).subtract(new BigDecimal(holidays.size())).intValue();
|
||||
}
|
||||
}
|
||||
//计算结束时间和请假时长 此处使用beginDate 而不使用rzLeaveDetail.getLeaveStartTime() 的原因是, 上面获取全部请假日期的时候, 已经处理过时间, 只需要增加公休,法休时间就可以了
|
||||
rzLeaveDetail.setLeaveEndTime(DateUtils.addDays(beginDate, endDays));
|
||||
rzLeaveDetail.setLeaveHour(new BigDecimal(wordDays).multiply(Constants.DAY_WORK_HOUR).intValue());
|
||||
rzLeaveDetail.setLeaveHour(new BigDecimal(sysDictData.getDictValue()).multiply(Constants.DAY_WORK_HOUR).intValue());
|
||||
}else{
|
||||
rzLeaveDetail = leaveHour(rzLeaveDetail);
|
||||
// //不需要计算, 过滤节假日啥的, 只过滤周末就好了
|
||||
|
||||
@ -7,7 +7,6 @@ import com.evo.common.utils.Collections;
|
||||
import com.evo.common.utils.DataUtils;
|
||||
import com.evo.common.utils.ParamUtils;
|
||||
import com.evo.common.utils.SecurityUtils;
|
||||
import com.evo.common.utils.bean.BeanUtils;
|
||||
import com.evo.common.utils.poi.handler.ExcelNewUtils;
|
||||
import com.evo.personnelMatters.domain.RzMealExpenses;
|
||||
import com.evo.personnelMatters.domain.vo.MealExpensesExportVo;
|
||||
@ -15,6 +14,7 @@ import com.evo.personnelMatters.mapper.RzMealExpensesDetailMapper;
|
||||
import com.evo.personnelMatters.mapper.RzMealExpensesMapper;
|
||||
import com.evo.personnelMatters.service.RzMealExpensesService;
|
||||
import com.evo.restaurant.mapper.RzRestaurantDetailMapper;
|
||||
import com.evo.system.mapper.SysDictDataMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@ -35,6 +35,8 @@ import java.util.stream.Collectors;
|
||||
@Service
|
||||
public class RzMealExpensesServiceImpl extends ServiceImpl<RzMealExpensesMapper, RzMealExpenses> implements RzMealExpensesService {
|
||||
|
||||
@Resource
|
||||
private SysDictDataMapper sysDictDataMapper;
|
||||
@Resource
|
||||
private RzRestaurantDetailMapper rzRestaurantDetailMapper;
|
||||
@Resource
|
||||
@ -56,11 +58,6 @@ public class RzMealExpensesServiceImpl extends ServiceImpl<RzMealExpensesMapper,
|
||||
if(Collections.isEmpty(list)){
|
||||
return new MealExpensesExportVo(BigDecimal.ZERO.intValue(), BigDecimal.ZERO.toString(), BigDecimal.ZERO);
|
||||
}
|
||||
if(list.size() == 1){
|
||||
MealExpensesExportVo result = new MealExpensesExportVo();
|
||||
BeanUtils.copyProperties(list.get(0), result);
|
||||
return result;
|
||||
}
|
||||
MealExpensesExportVo result = list.stream().reduce((x, y) -> new MealExpensesExportVo(
|
||||
new BigDecimal(x.getFaceScanNum()).add(new BigDecimal(y.getFaceScanNum())).intValue(),
|
||||
new BigDecimal(x.getMealVoucherNum()).add(new BigDecimal(y.getMealVoucherNum())).toString(),(x.getTotalAmount().add(y.getTotalAmount())))).orElse(new MealExpensesExportVo(BigDecimal.ZERO.intValue(), BigDecimal.ZERO.toString(), BigDecimal.ZERO));
|
||||
|
||||
@ -2,24 +2,13 @@ package com.evo.personnelMatters.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.evo.common.core.domain.AjaxResult;
|
||||
import com.evo.common.core.domain.entity.RzUpload;
|
||||
import com.evo.common.core.domain.entity.SysDept;
|
||||
import com.evo.common.utils.Collections;
|
||||
import com.evo.common.utils.ParamUtils;
|
||||
import com.evo.common.utils.SecurityUtils;
|
||||
import com.evo.equipment.service.IEqSnDetailService;
|
||||
import com.evo.personnelMatters.domain.EqOverStaff;
|
||||
import com.evo.personnelMatters.domain.SpecialOverTime;
|
||||
import com.evo.personnelMatters.mapper.BsOverTimeMapper;
|
||||
import com.evo.personnelMatters.mapper.EqOverStaffMapper;
|
||||
import com.evo.personnelMatters.service.SpecialOverTimeService;
|
||||
import com.evo.system.domain.SysStaff;
|
||||
import com.evo.system.mapper.SysDeptMapper;
|
||||
import com.evo.system.mapper.SysStaffMapper;
|
||||
import com.evo.system.service.RzUploadService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
@ -29,14 +18,6 @@ public class SpecialOverTimeServiceImpl extends ServiceImpl<BsOverTimeMapper, Sp
|
||||
|
||||
@Resource
|
||||
private EqOverStaffMapper eqOverStaffMapper;
|
||||
@Resource
|
||||
private IEqSnDetailService eqSnDetailService;//餐饮统计
|
||||
@Resource
|
||||
private SysStaffMapper sysStaffMapper;
|
||||
@Resource
|
||||
private SysDeptMapper sysDeptMapper;
|
||||
@Resource
|
||||
private RzUploadService rzUploadService;//文件上传
|
||||
|
||||
@Override
|
||||
public SpecialOverTime selectSpecialOverTimeById(){
|
||||
@ -76,21 +57,13 @@ public class SpecialOverTimeServiceImpl extends ServiceImpl<BsOverTimeMapper, Sp
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int insertEqOverStaff(EqOverStaff eqOverStaff)
|
||||
{
|
||||
|
||||
eqOverStaff.setCreateBy(SecurityUtils.getUsername());
|
||||
eqOverStaff.setCreateTime(new Date());
|
||||
eqOverStaff.setDelFlag("0");
|
||||
int res = eqOverStaffMapper.insertEqOverStaff(eqOverStaff);
|
||||
if(res > 0){
|
||||
SysStaff sysStaff = sysStaffMapper.selectSysStaffByUserId(eqOverStaff.getUserId());
|
||||
SysDept sysDept = sysDeptMapper.selectById(sysStaff.getDeptId());
|
||||
RzUpload upload = rzUploadService.selectByBusinessId(sysStaff.getUserId(), "avatar");
|
||||
eqSnDetailService.sendPhoto(ParamUtils.getTsDevSn(), Collections.asList(Collections.asMap("userId", String.valueOf(sysStaff.getUserId()), "name", sysStaff.getName(), "photoUrl", ParamUtils.getGlobalStaticUrl()+upload.getFileName(), "deptName", sysDept.getDeptName())));
|
||||
}
|
||||
return res;
|
||||
return eqOverStaffMapper.insertEqOverStaff(eqOverStaff);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -100,7 +73,8 @@ public class SpecialOverTimeServiceImpl extends ServiceImpl<BsOverTimeMapper, Sp
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateEqOverStaff(EqOverStaff eqOverStaff){
|
||||
public int updateEqOverStaff(EqOverStaff eqOverStaff)
|
||||
{
|
||||
eqOverStaff.setUpdateBy(SecurityUtils.getUsername());
|
||||
eqOverStaff.setUpdateTime(new Date());
|
||||
return eqOverStaffMapper.updateEqOverStaff(eqOverStaff);
|
||||
@ -119,11 +93,7 @@ public class SpecialOverTimeServiceImpl extends ServiceImpl<BsOverTimeMapper, Sp
|
||||
eqOverStaff.setDelFlag("1");
|
||||
eqOverStaff.setUpdateTime(new Date());
|
||||
eqOverStaff.setUpdateBy(SecurityUtils.getUsername());
|
||||
int res = eqOverStaffMapper.updateEqOverStaff(eqOverStaff);
|
||||
if(res > 0){
|
||||
eqSnDetailService.sendDelete(ParamUtils.getTsDevSn(), Collections.asList(String.valueOf(eqOverStaff.getUserId())));
|
||||
}
|
||||
return res;
|
||||
return eqOverStaffMapper.updateEqOverStaff(eqOverStaff);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -90,7 +90,7 @@ public class RzRestaurantDetailController extends BaseController
|
||||
*/
|
||||
@RequestMapping("/verify_user_yt")
|
||||
public String verifyUser(@RequestBody String json){
|
||||
return rzRestaurantDetailService.insertRzRestaurantDetail(json);
|
||||
return "接口停止使用";//rzRestaurantDetailService.insertRzRestaurantDetail(json);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -54,8 +54,6 @@ public class RzRestaurantDetail extends BaseEntity
|
||||
/** 删除标记 */
|
||||
private String delFlag;
|
||||
|
||||
private String deviceSn;
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
|
||||
@ -83,6 +83,7 @@ public class RzRestaurantDetailServiceImpl extends ServiceImpl<RzRestaurantDetai
|
||||
@Override
|
||||
public String insertRzRestaurantDetail(String json)
|
||||
{
|
||||
System.out.println(json.toString());
|
||||
//需要返回的对象
|
||||
RestaurantVo cfiv = new RestaurantVo();
|
||||
RestaurantData cfd = new RestaurantData();
|
||||
@ -97,6 +98,7 @@ public class RzRestaurantDetailServiceImpl extends ServiceImpl<RzRestaurantDetai
|
||||
if(!ParamUtils.getCanteenOpenHour().contains(hour)){
|
||||
cfiv.setResult(2);
|
||||
cfiv.setMsg("不在打卡时间内");
|
||||
System.out.println(JSONObject.toJSONString(cfiv));
|
||||
return JSONObject.toJSONString(cfiv);
|
||||
}
|
||||
|
||||
@ -130,7 +132,6 @@ public class RzRestaurantDetailServiceImpl extends ServiceImpl<RzRestaurantDetai
|
||||
RzRestaurantStatistics restaurantStatistics = rzRestaurantStatisticsMapper.selectRzRestaurantStatisticsByUserIdAndDate(Long.valueOf(userId),new Date());
|
||||
//增加打卡记录
|
||||
RzRestaurantDetail cyFaceInfo = new RzRestaurantDetail();
|
||||
cyFaceInfo.setDeviceSn(jsonObject.getString("sn"));
|
||||
cyFaceInfo.setDate(new Date());
|
||||
cyFaceInfo.setStaffId(restaurantStatistics.getStaffId());
|
||||
cyFaceInfo.setName(restaurantStatistics.getName());
|
||||
|
||||
@ -5,7 +5,10 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.evo.common.constant.Constants;
|
||||
import com.evo.common.core.domain.AjaxResult;
|
||||
import com.evo.common.core.domain.entity.RzUpload;
|
||||
import com.evo.common.utils.*;
|
||||
import com.evo.common.utils.Collections;
|
||||
import com.evo.common.utils.DateUtils;
|
||||
import com.evo.common.utils.SecurityUtils;
|
||||
import com.evo.common.utils.StringUtils;
|
||||
import com.evo.common.utils.file.FileUploadUtils;
|
||||
import com.evo.equipment.domain.vo.StaffData;
|
||||
import com.evo.equipment.domain.vo.StaffDto;
|
||||
@ -19,7 +22,6 @@ import com.evo.restaurant.service.IRzRestaurantImagesService;
|
||||
import com.evo.restaurant.service.IRzRestaurantStatisticsService;
|
||||
import com.evo.system.service.RzUploadService;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import javax.annotation.Resource;
|
||||
@ -43,9 +45,6 @@ public class RzRestaurantImagesServiceImpl extends ServiceImpl<RzRestaurantImage
|
||||
private IEqSnDetailService eqSnDetailService;//餐饮统计
|
||||
@Resource
|
||||
private RzUploadService rzUploadService;//文件上传
|
||||
@Autowired
|
||||
private ParamUtils paramUtils;
|
||||
|
||||
/**
|
||||
* 查询餐饮照片管理列表
|
||||
*
|
||||
@ -69,30 +68,27 @@ public class RzRestaurantImagesServiceImpl extends ServiceImpl<RzRestaurantImage
|
||||
{
|
||||
//根据id查询信息
|
||||
RzRestaurantImages rzRestaurantImages = getBaseMapper().selectRzRestaurantImagesById(id);
|
||||
//删除设备图片
|
||||
eqSnDetailService.sendDelete(ParamUtils.getRestaurantDevSn(), Collections.asList( String.valueOf(id)));
|
||||
// //需要返回的对象
|
||||
// StaffDto cau = new StaffDto();
|
||||
// //发送的数据
|
||||
// StaffData caud = new StaffData();
|
||||
// //该接口固定为to_device,发送给设备用于识别对应哪个指令
|
||||
// cau.setCmd("to_device");
|
||||
// //无用值,空串
|
||||
// cau.setForm("");
|
||||
// //给服务端预留的补充字段,设备端不处理这个字段内容。设备在响应这条指令时原样返回
|
||||
// cau.setExtra("");
|
||||
// //发送的数据
|
||||
// caud.setCmd("delUser");
|
||||
// caud.setUser_type(0);
|
||||
// caud.setUser_id(id+"");
|
||||
// cau.setData(caud);
|
||||
// //调用websocket,推送给设备
|
||||
// ParamUtils.getRestaurantDevSn().stream().forEach(deviceNo ->{
|
||||
// //设备号 com.evo.equipment.constant.Constants.EQ_DEVICE_CODE
|
||||
// cau.setTo(deviceNo);
|
||||
// WebSocketUsers.sendMessageToUsersByText(JSONObject.toJSONString(cau));
|
||||
// });
|
||||
|
||||
//删除打卡机照片
|
||||
String message = "";
|
||||
//需要返回的对象
|
||||
StaffDto cau = new StaffDto();
|
||||
//发送的数据
|
||||
StaffData caud = new StaffData();
|
||||
//该接口固定为to_device,发送给设备用于识别对应哪个指令
|
||||
cau.setCmd("to_device");
|
||||
//无用值,空串
|
||||
cau.setForm("");
|
||||
//设备号
|
||||
cau.setTo(com.evo.equipment.constant.Constants.EQ_DEVICE_CODE);
|
||||
//给服务端预留的补充字段,设备端不处理这个字段内容。设备在响应这条指令时原样返回
|
||||
cau.setExtra("");
|
||||
//发送的数据
|
||||
caud.setCmd("delUser");
|
||||
caud.setUser_type(0);
|
||||
caud.setUser_id(id+"");
|
||||
cau.setData(caud);
|
||||
//调用websocket,推送给设备
|
||||
WebSocketUsers.sendMessageToUsersByText(JSONObject.toJSONString(cau));
|
||||
//删除照片
|
||||
String img_name = rzRestaurantImages.getImageUrl().substring(rzRestaurantImages.getImageUrl().lastIndexOf("/")+1);
|
||||
File file = new File(com.evo.equipment.constant.Constants.STAFF_IMAGE_ADDRESS + img_name);
|
||||
@ -138,7 +134,7 @@ public class RzRestaurantImagesServiceImpl extends ServiceImpl<RzRestaurantImage
|
||||
log.error("处理上传照片信息出现错误", e);
|
||||
}
|
||||
//下发照片
|
||||
eqSnDetailService.sendPhoto(Collections.asList(ParamUtils.getRestaurantDevSn()),
|
||||
eqSnDetailService.sendPhoto(Collections.asList(com.evo.equipment.constant.Constants.EQ_DEVICE_CODE),
|
||||
Collections.asList(Collections.asMap("userId", String.valueOf(rzRestaurantImages.getId()),
|
||||
"name", rzRestaurantImages.getName(), "photoUrl", rzRestaurantImages.getImageUrl())));
|
||||
}
|
||||
|
||||
@ -14,17 +14,15 @@ import com.evo.restaurant.domain.RzRestaurantImages;
|
||||
import com.evo.restaurant.domain.RzRestaurantStatistics;
|
||||
import com.evo.restaurant.domain.vo.RzRestaurantStatisticsExportVo;
|
||||
import com.evo.restaurant.mapper.RzRestaurantDetailMapper;
|
||||
import com.evo.restaurant.mapper.RzRestaurantImagesMapper;
|
||||
import com.evo.restaurant.mapper.RzRestaurantStatisticsMapper;
|
||||
import com.evo.restaurant.service.IRzRestaurantStatisticsService;
|
||||
import com.evo.restaurant.utils.ExcelUtilCy;
|
||||
import com.evo.system.domain.SysStaff;
|
||||
import com.evo.system.domain.SysStaffDetail;
|
||||
import com.evo.system.mapper.SysDeptMapper;
|
||||
import com.evo.system.mapper.SysDictDataMapper;
|
||||
import com.evo.system.mapper.SysStaffDetailMapper;
|
||||
import com.evo.system.mapper.SysStaffMapper;
|
||||
import com.evo.system.mapper.*;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
@ -176,11 +174,7 @@ public class RzRestaurantStatisticsServiceImpl extends ServiceImpl<RzRestaurantS
|
||||
public List<RzRestaurantStatisticsExportVo> buildExportData(RzRestaurantStatistics rzRestaurantStatistics){
|
||||
|
||||
List<SysDept> deptList = deptMapper.selectList(new LambdaQueryWrapper<SysDept>());
|
||||
//Map<Long, String> deptNameMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptId, SysDept::getDeptName));
|
||||
Map<Long, String> deptNameMap = Collections.emptyMap(); //deptList.stream().collect(Collectors.toMap(SysDept::getDeptId, SysDept::getDeptName));
|
||||
for (SysDept dept : deptList) {
|
||||
deptNameMap.put(dept.getDeptId(), buildDept(dept.getDeptId(), deptList, deptNameMap));
|
||||
}
|
||||
Map<Long, String> deptNameMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptId, SysDept::getDeptName));
|
||||
Map<String, String> nameAndDeptIdMap = deptList.stream().filter(d -> d.getParentId().equals(0l)).collect(Collectors.toMap(d->String.valueOf(d.getDeptId()), SysDept::getDeptName));
|
||||
Map<Long, String> companyNameMap = Collections.emptyMap();
|
||||
deptList.stream().filter(d -> !d.getParentId().equals(0l)).forEach(d ->{
|
||||
@ -219,21 +213,6 @@ public class RzRestaurantStatisticsServiceImpl extends ServiceImpl<RzRestaurantS
|
||||
return voResult;
|
||||
}
|
||||
|
||||
public String buildDept(Long deptId, List<SysDept> deptList, Map<Long,String> showDeptNameMap){
|
||||
if(showDeptNameMap.containsKey(deptList)){
|
||||
return showDeptNameMap.get(deptId);
|
||||
}
|
||||
SysDept sysDept = deptList.stream().filter(d -> d.getDeptId().equals(deptId)).findFirst().orElse(null);
|
||||
if(sysDept != null){
|
||||
if("1".equals(sysDept.getIsShowFinancial())){
|
||||
return sysDept.getDeptName();
|
||||
}else{
|
||||
return buildDept(sysDept.getParentId(), deptList, showDeptNameMap);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult export(RzRestaurantStatistics rzRestaurantStatistics) {
|
||||
ExcelUtilCy<RzRestaurantStatisticsExportVo> util = new ExcelUtilCy<RzRestaurantStatisticsExportVo>(RzRestaurantStatisticsExportVo.class);
|
||||
@ -265,9 +244,9 @@ public class RzRestaurantStatisticsServiceImpl extends ServiceImpl<RzRestaurantS
|
||||
private void create(Long staffId, Long deptId, String name, Date date){
|
||||
RzRestaurantStatistics rzRestaurantStatistics = getBaseMapper().selectRzRestaurantStatisticsByUserIdAndDate(staffId,date);
|
||||
if(StringUtils.isNotNull(rzRestaurantStatistics)){
|
||||
//if(rzRestaurantStatistics.getDeptId() == null){
|
||||
if(rzRestaurantStatistics.getDeptId() == null){
|
||||
rzRestaurantStatistics.setDeptId(deptId);
|
||||
//}
|
||||
}
|
||||
rzRestaurantStatistics.setName(name);
|
||||
getBaseMapper().updateRzRestaurantStatistics(rzRestaurantStatistics);
|
||||
return;
|
||||
|
||||
@ -1,105 +0,0 @@
|
||||
package com.evo.system.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.evo.common.annotation.Log;
|
||||
import com.evo.common.annotation.RepeatSubmit;
|
||||
import com.evo.common.core.controller.BaseController;
|
||||
import com.evo.common.core.domain.AjaxResult;
|
||||
import com.evo.common.core.page.TableDataInfo;
|
||||
import com.evo.common.enums.BusinessType;
|
||||
import com.evo.common.utils.Collections;
|
||||
import com.evo.common.utils.StringUtils;
|
||||
import com.evo.system.domain.ExceptionNotification;
|
||||
import com.evo.system.domain.SysStaff;
|
||||
import com.evo.system.mapper.SysDeptMapper;
|
||||
import com.evo.system.mapper.SysStaffMapper;
|
||||
import com.evo.system.service.ExceptionNotificationService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @desc:
|
||||
* @ClassName:ExceptionNotificationController
|
||||
* @date: 2026年08月25日 17:18
|
||||
* @author: andy.shi
|
||||
* @contact: 17330188597
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/exceptionNotification")
|
||||
public class ExceptionNotificationController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private ExceptionNotificationService exceptionNotificationService;
|
||||
@Resource
|
||||
private SysStaffMapper sysStaffMapper;
|
||||
@Resource
|
||||
private SysDeptMapper sysDeptMapper;
|
||||
|
||||
/**
|
||||
* 查询员工管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:exceptionNotification:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ExceptionNotification exceptionNotification) {
|
||||
startPage();
|
||||
List<ExceptionNotification> list = exceptionNotificationService.list(new LambdaQueryWrapper<ExceptionNotification>()
|
||||
.eq(exceptionNotification.getNotificationType() != null, ExceptionNotification::getNotificationType, exceptionNotification.getNotificationType()));
|
||||
list.stream().forEach(item->{
|
||||
if(StringUtils.isNotEmpty(item.getUserIds())){
|
||||
item.setUserNames(sysStaffMapper.selectNameByUserIds(Collections.asList(item.getUserIds().split(",")).stream().map(Long::parseLong).collect(Collectors.toList())));
|
||||
}
|
||||
if(StringUtils.isNotEmpty(item.getDeptIds())){
|
||||
item.setDeptNames(sysDeptMapper.selectNameByIds(Collections.asList(item.getDeptIds().split(",")).stream().map(Long::parseLong).collect(Collectors.toList())));
|
||||
}
|
||||
|
||||
});
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增员工管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:exceptionNotification:add')")
|
||||
@Log(title = "异常规则", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
@RepeatSubmit
|
||||
public AjaxResult add(@RequestBody ExceptionNotification exceptionNotification) {
|
||||
exceptionNotificationService.save(exceptionNotification);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取员工管理详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(exceptionNotificationService.getById(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:exceptionNotification:edit')")
|
||||
@Log(title = "异常规则", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
@RepeatSubmit
|
||||
public AjaxResult edit(@RequestBody ExceptionNotification exceptionNotification) {
|
||||
exceptionNotificationService.updateById(exceptionNotification);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除员工管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:exceptionNotification:delete')")
|
||||
@Log(title = "异常规则", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{id}")
|
||||
public AjaxResult delete(@PathVariable Long id){
|
||||
return toAjax(exceptionNotificationService.removeById(id));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -11,6 +11,7 @@ import com.evo.common.utils.poi.ExcelUtil;
|
||||
import com.evo.system.domain.SysStaff;
|
||||
import com.evo.system.domain.vo.SysStaffVo;
|
||||
import com.evo.system.service.ISysStaffService;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
@ -19,7 +20,6 @@ import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 员工管理Controller
|
||||
*
|
||||
@ -33,12 +33,6 @@ public class SysStaffController extends BaseController
|
||||
@Resource
|
||||
private ISysStaffService sysStaffService;
|
||||
|
||||
@PostMapping("/checkName")
|
||||
public AjaxResult checkStaffName(@RequestBody SysStaff sysStaff) {
|
||||
boolean repeat = sysStaffService.checkNameRepeat(sysStaff.getUserId(), sysStaff.getName());
|
||||
return AjaxResult.success(repeat);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询员工管理列表
|
||||
*/
|
||||
|
||||
@ -1,42 +0,0 @@
|
||||
package com.evo.system.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 异常接收人
|
||||
* @ClassName:ExceptionNotification
|
||||
* @date: 2026年08月24日 16:15
|
||||
* @author: andy.shi
|
||||
* @contact: 17330188597
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Data
|
||||
public class ExceptionNotification implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
Long id;
|
||||
|
||||
String userIds;
|
||||
@TableField(exist = false)
|
||||
String userNames;
|
||||
|
||||
String deptIds;
|
||||
@TableField(exist = false)
|
||||
String deptNames;
|
||||
/***
|
||||
* 什么类型的通知
|
||||
* 1. 未打卡通知
|
||||
* 2 超过N天未打卡通知
|
||||
* 3. 异常通知
|
||||
*/
|
||||
Integer notificationType;
|
||||
/***
|
||||
* 超过几天通知
|
||||
* 做级别限制, 比如说, 3天通知部门负责人, 5天通知人资办, 10田通知公司高层
|
||||
*/
|
||||
Integer day;
|
||||
}
|
||||
@ -214,10 +214,8 @@ public class SysStaff extends BaseEntity
|
||||
|
||||
|
||||
private String extended;
|
||||
//钉钉的用户ID
|
||||
|
||||
private String dingUserId;
|
||||
//员工在当前开发者企业账号范围内的唯一标识。
|
||||
private String dingUnionId;
|
||||
//数据来源 1 平台, 2 钉钉
|
||||
private String source;
|
||||
|
||||
|
||||
@ -1,15 +0,0 @@
|
||||
package com.evo.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.evo.common.core.domain.entity.DeptMonthHistory;
|
||||
|
||||
/**
|
||||
* @desc: 接口
|
||||
* @ClassName:DeptMonthHistoryMapper
|
||||
* @date: 2026年08月15日 15:48
|
||||
* @author: andy.shi
|
||||
* @contact: 17330188597
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
public interface DeptMonthHistoryMapper extends BaseMapper<DeptMonthHistory> {
|
||||
}
|
||||
@ -1,19 +0,0 @@
|
||||
package com.evo.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.evo.system.domain.ExceptionNotification;
|
||||
import com.evo.system.domain.SysStaffDetail;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 员工详情Mapper接口
|
||||
*
|
||||
* @author evo
|
||||
* @date 2024-11-22
|
||||
*/
|
||||
public interface ExceptionNotificationMapper extends BaseMapper<ExceptionNotification>
|
||||
{
|
||||
|
||||
List<ExceptionNotification> getExceptionNotification(Integer type);
|
||||
}
|
||||
@ -20,9 +20,6 @@ public interface SysDeptMapper extends BaseMapper<SysDept>
|
||||
* @return 部门信息集合
|
||||
*/
|
||||
public List<SysDept> selectDeptList(SysDept dept);
|
||||
|
||||
public String selectNameByIds(@Param("deptIds") List<Long> deptIds);
|
||||
|
||||
/**
|
||||
* 根据角色ID查询部门树信息
|
||||
*
|
||||
|
||||
@ -24,8 +24,6 @@ public interface SysStaffMapper extends BaseMapper<SysStaff>
|
||||
*/
|
||||
public SysStaff selectSysStaffByUserId(Long userId);
|
||||
|
||||
public String selectNameByUserIds(@Param("userIds") List<Long> userIds);
|
||||
|
||||
/**
|
||||
* 查询员工管理列表
|
||||
*
|
||||
|
||||
@ -1,18 +0,0 @@
|
||||
package com.evo.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.evo.common.core.domain.entity.DeptMonthHistory;
|
||||
|
||||
/**
|
||||
* @desc: 接口
|
||||
* @ClassName:DeptMonthHistoryService
|
||||
* @date: 2026年08月15日 14:54
|
||||
* @company: 茹臣科技
|
||||
* @author: andy.shi
|
||||
* @contact: 17330188597
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
public interface DeptMonthHistoryService extends IService<DeptMonthHistory> {
|
||||
|
||||
String getDeptMonthHistory(String month);
|
||||
}
|
||||
@ -1,18 +0,0 @@
|
||||
package com.evo.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.evo.system.domain.ExceptionNotification;
|
||||
|
||||
/**
|
||||
* 异常通知接口
|
||||
* @ClassName:ExceptionNotificationService
|
||||
* @date: 2026年08月24日 16:43
|
||||
* @author: andy.shi
|
||||
* @contact: 17330188597
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
|
||||
public interface ExceptionNotificationService extends IService<ExceptionNotification> {
|
||||
|
||||
ExceptionNotification getExceptionNotification(Integer type, Integer day);
|
||||
}
|
||||
@ -1,8 +1,6 @@
|
||||
package com.evo.system.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.evo.common.core.domain.TreeSelect;
|
||||
import com.evo.common.core.domain.entity.SysDept;
|
||||
|
||||
@ -11,7 +9,7 @@ import com.evo.common.core.domain.entity.SysDept;
|
||||
*
|
||||
* @author evo
|
||||
*/
|
||||
public interface ISysDeptService extends IService<SysDept>
|
||||
public interface ISysDeptService
|
||||
{
|
||||
/**
|
||||
* 查询部门管理数据
|
||||
|
||||
@ -9,6 +9,7 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 员工管理Service接口
|
||||
*
|
||||
@ -23,13 +24,6 @@ public interface ISysStaffService extends IService<SysStaff>
|
||||
* @param userId 员工管理主键
|
||||
* @return 员工管理
|
||||
*/
|
||||
/**
|
||||
* 校验员工名称是否重复
|
||||
* @param id 员工主键ID,新增时传null
|
||||
* @param name 员工姓名
|
||||
* @return true 名称重复,false 名称可用
|
||||
*/
|
||||
boolean checkNameRepeat(Long id, String name);
|
||||
public SysStaff selectSysStaffByUserId(Long userId);
|
||||
/**
|
||||
* 查询员工管理列表
|
||||
@ -143,11 +137,4 @@ public interface ISysStaffService extends IService<SysStaff>
|
||||
public void sysStaffLeaveByDingUserId(String dingUserId);
|
||||
|
||||
AjaxResult getDingUserId(String userName);
|
||||
/**
|
||||
* 校验员工姓名是否重复(包含在职、离职全部员工,全局唯一)
|
||||
* @param userId 当前员工主键,新增传null,编辑传员工userId
|
||||
* @param name 待校验姓名
|
||||
* @return true=存在重名;false=无重名
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
@ -1,35 +0,0 @@
|
||||
package com.evo.system.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.evo.common.core.domain.entity.DeptMonthHistory;
|
||||
import com.evo.common.utils.Collections;
|
||||
import com.evo.system.mapper.DeptMonthHistoryMapper;
|
||||
import com.evo.system.service.DeptMonthHistoryService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @desc:
|
||||
* @ClassName:DeptMonthHistoryServiceImpl
|
||||
* @date: 2026年08月15日 15:30
|
||||
* @company: 茹臣科技
|
||||
* @author: andy.shi
|
||||
* @contact: 17330188597
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
|
||||
@Service
|
||||
public class DeptMonthHistoryServiceImpl extends ServiceImpl<DeptMonthHistoryMapper, DeptMonthHistory> implements DeptMonthHistoryService {
|
||||
|
||||
@Override
|
||||
public String getDeptMonthHistory(String month) {
|
||||
List<DeptMonthHistory> list = list(new LambdaQueryWrapper<DeptMonthHistory>().eq(DeptMonthHistory::getDateMonth, month).orderByDesc(DeptMonthHistory::getId));
|
||||
if(Collections.isNotEmpty(list)){
|
||||
return list.get(0).getDeptHistory();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,36 +0,0 @@
|
||||
package com.evo.system.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.evo.common.utils.Collections;
|
||||
import com.evo.system.domain.ExceptionNotification;
|
||||
import com.evo.system.mapper.ExceptionNotificationMapper;
|
||||
import com.evo.system.service.ExceptionNotificationService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @desc:
|
||||
* @ClassName:ExceptionNotificationServiceImpl
|
||||
* @date: 2026年08月25日 13:17
|
||||
* @author: andy.shi
|
||||
* @contact: 17330188597
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Service
|
||||
public class ExceptionNotificationServiceImpl extends ServiceImpl<ExceptionNotificationMapper, ExceptionNotification> implements ExceptionNotificationService {
|
||||
|
||||
@Override
|
||||
public ExceptionNotification getExceptionNotification(Integer type, Integer day){
|
||||
List<ExceptionNotification> list = getBaseMapper().getExceptionNotification(type);
|
||||
if(Collections.isEmpty(list)){
|
||||
return null;
|
||||
}
|
||||
for (ExceptionNotification notification : list) {
|
||||
if (day >= notification.getDay()) {
|
||||
return notification;
|
||||
}
|
||||
}
|
||||
return list.get(0);
|
||||
}
|
||||
}
|
||||
@ -1,10 +1,11 @@
|
||||
package com.evo.system.service.impl;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.evo.common.utils.Collections;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.evo.common.annotation.DataScope;
|
||||
import com.evo.common.constant.UserConstants;
|
||||
@ -350,39 +351,9 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
|
||||
@Override
|
||||
public List<TreeSelect> selectAllDeptList(){
|
||||
List<SysDept> depts = deptMapper.queryDeptTreeList();
|
||||
Map<Long, String> deptCodeMap = Collections.emptyMap();
|
||||
for (SysDept dept : depts) {
|
||||
String code = buildDept(dept, depts, deptCodeMap);
|
||||
deptCodeMap.put(dept.getDeptId(), code);
|
||||
dept.setDeptCode(code);
|
||||
}
|
||||
return buildDeptTreeSelect(depts);
|
||||
}
|
||||
|
||||
public String buildDept(SysDept dept, List<SysDept> deptList, Map<Long,String> showDeptNameMap){
|
||||
if(showDeptNameMap.containsKey(dept.getDeptId())){
|
||||
return showDeptNameMap.get(dept.getDeptId());
|
||||
}
|
||||
if(dept != null){
|
||||
if(StringUtils.isNotEmpty(dept.getDeptCode())){
|
||||
return dept.getDeptCode();
|
||||
}else{
|
||||
SysDept opt = deptList.stream().filter(d-> d.getDeptId().equals(dept.getParentId())).findFirst().orElse(null);
|
||||
if(opt == null){
|
||||
return null;
|
||||
}else{
|
||||
try {
|
||||
return buildDept(opt, deptList, showDeptNameMap);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有的公司
|
||||
* @return
|
||||
|
||||
@ -29,7 +29,6 @@ import com.evo.finance.service.IRzSalaryDetailService;
|
||||
import com.evo.kingdeeUtils.KingdeeRequestUtils;
|
||||
import com.evo.kingdeeUtils.kenum.KingdeeParamsEnum;
|
||||
import com.evo.personnelMatters.domain.RzSubsidyInfo;
|
||||
import com.evo.personnelMatters.mapper.RzLeaveMapper;
|
||||
import com.evo.personnelMatters.mapper.RzSubsidyInfoMapper;
|
||||
import com.evo.restaurant.service.IRzRestaurantStatisticsService;
|
||||
import com.evo.system.domain.SysStaff;
|
||||
@ -91,18 +90,6 @@ public class SysStaffServiceImpl extends ServiceImpl<SysStaffMapper, SysStaff> i
|
||||
private RzSubsidyInfoMapper rzSubsidyInfoMapper;
|
||||
@Resource
|
||||
IRzSalaryDetailService rzSalaryDetailService;
|
||||
@Resource
|
||||
private RzLeaveMapper rzLeaveMapper;
|
||||
@Override
|
||||
public boolean checkNameRepeat(Long userId, String name) {
|
||||
LambdaQueryWrapper<SysStaff> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(SysStaff::getName, name.trim());
|
||||
// 编辑时排除自身员工
|
||||
if(userId != null){
|
||||
wrapper.ne(SysStaff::getUserId, userId);
|
||||
}
|
||||
return this.count(wrapper) > 0;
|
||||
}
|
||||
/**
|
||||
* 查询员工管理
|
||||
*
|
||||
@ -144,10 +131,6 @@ public class SysStaffServiceImpl extends ServiceImpl<SysStaffMapper, SysStaff> i
|
||||
@Transactional
|
||||
public AjaxResult insertSysStaff(SysStaff sysStaff)
|
||||
{
|
||||
boolean repeat = checkNameRepeat(null, sysStaff.getName());
|
||||
if(repeat){
|
||||
return AjaxResult.error("姓名【"+sysStaff.getName()+"】已存在,所有员工(含离职)不可重名");
|
||||
}
|
||||
//根据省份证号查询是否已经录入
|
||||
SysStaff p_staff = getBaseMapper().queryysStaffByIdCard(sysStaff.getIdCard());
|
||||
if(StringUtils.isNotNull(p_staff)){
|
||||
@ -183,12 +166,12 @@ public class SysStaffServiceImpl extends ServiceImpl<SysStaffMapper, SysStaff> i
|
||||
if(CollectionUtils.isNotEmpty(sysStaff.getTimeClockList())){
|
||||
sysStaff.setTimeClock(sysStaff.getTimeClockList().stream().collect(Collectors.joining(",")));
|
||||
}
|
||||
// //新增员工信息到金蝶
|
||||
// if(StringUtils.isNotEmpty(sysStaff.getJobCode())){
|
||||
// sysStaff.setExtended(KingdeeRequestUtils.employeeSave(Collections.asMap("userName", sysStaff.getName(), "userCode", sysStaff.getCode(), "jobCode", sysStaff.getJobCode().split("_")[0],"deptCode", sysStaff.getJobCode().split("_")[1])));
|
||||
// }else if(StringUtils.isEmpty(sysStaff.getJobCode())){
|
||||
// sysStaff.setExtended(KingdeeRequestUtils.employeeSaveEmptyJob(Collections.asMap("userName", sysStaff.getName(), "userCode", sysStaff.getCode())));
|
||||
// }
|
||||
//新增员工信息到金蝶
|
||||
if(StringUtils.isNotEmpty(sysStaff.getJobCode())){
|
||||
sysStaff.setExtended(KingdeeRequestUtils.employeeSave(Collections.asMap("userName", sysStaff.getName(), "userCode", sysStaff.getCode(), "jobCode", sysStaff.getJobCode().split("_")[0],"deptCode", sysStaff.getJobCode().split("_")[1])));
|
||||
}else if(StringUtils.isEmpty(sysStaff.getJobCode())){
|
||||
sysStaff.setExtended(KingdeeRequestUtils.employeeSaveEmptyJob(Collections.asMap("userName", sysStaff.getName(), "userCode", sysStaff.getCode())));
|
||||
}
|
||||
|
||||
int i = getBaseMapper().insertSysStaff(sysStaff);
|
||||
if(i < 1){
|
||||
@ -221,7 +204,6 @@ public class SysStaffServiceImpl extends ServiceImpl<SysStaffMapper, SysStaff> i
|
||||
//重新做员工入职
|
||||
if(StringUtils.isEmpty(sysStaff.getDingUserId())){
|
||||
sysStaff.setDingUserId(result.getString("userid"));
|
||||
sysStaff.setDingUnionId(result.getString("unionid"));
|
||||
getBaseMapper().updateById(sysStaff);
|
||||
}
|
||||
//做员工重新入职
|
||||
@ -261,7 +243,6 @@ public class SysStaffServiceImpl extends ServiceImpl<SysStaffMapper, SysStaff> i
|
||||
sysStaff.setContractStart(sysStaff.getEmploymentDate());
|
||||
sysStaff.setContractEnd(DateUtils.addYears(sysStaff.getEmploymentDate(), 1));
|
||||
sysStaff.setDingUserId(result.getString("userid"));
|
||||
sysStaff.setDingUnionId(result.getString("unionid"));
|
||||
sysStaff.setStatus(Constants.JOB_STATIS_0);
|
||||
sysStaff.setCreateTime(DateUtils.getNowDate());
|
||||
sysStaff.setCreateBy("admin-钉钉推送");
|
||||
@ -300,17 +281,13 @@ public class SysStaffServiceImpl extends ServiceImpl<SysStaffMapper, SysStaff> i
|
||||
//不为空, 准备下发
|
||||
if(upload != null){
|
||||
List<String> dkj_list = new ArrayList<String>();
|
||||
dkj_list.addAll(ParamUtils.getRestaurantDevSn()); //食堂
|
||||
if(Collections.isNotEmpty(sysStaff.getTimeClockList())){
|
||||
dkj_list.add(com.evo.equipment.constant.Constants.EQ_DEVICE_CODE); //食堂
|
||||
// dkj_list.add(com.evo.equipment.constant.Constants.EQ_DEVICE_PUBLIC_CODE); //公共
|
||||
dkj_list.addAll(sysStaff.getTimeClockList());
|
||||
}
|
||||
// dkj_list.add(sysStaff.getTimeClockList().get(1));
|
||||
//下发照片
|
||||
SysDept sysDept = deptMapper.selectDeptById(sysStaff.getDeptId());
|
||||
try {
|
||||
eqSnDetailService.sendPhoto(dkj_list, Collections.asList(Collections.asMap("userId", String.valueOf(sysStaff.getUserId()), "name", sysStaff.getName(), "photoUrl", ParamUtils.getGlobalStaticUrl()+upload.getFileName(), "deptName", sysDept.getDeptName())));
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("员工新增成功, 但是照片下发失败了,请截图联系管理员: 直白原因: "+ e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -321,9 +298,9 @@ public class SysStaffServiceImpl extends ServiceImpl<SysStaffMapper, SysStaff> i
|
||||
JSONObject deptObject = JSONObject.parseObject(deptResult).getJSONObject("result");
|
||||
String deptName = deptObject.getString("name");
|
||||
dept = deptMapper.selectByName(deptName);
|
||||
if(dept != null){
|
||||
dept.setDingId(dingDeptId);
|
||||
deptMapper.updateById(dept);
|
||||
if(dept != null){
|
||||
return dept.getDeptId()+"_"+dept.getAncestors();
|
||||
}else{
|
||||
Long parentId = deptObject.getLong("parent_id");
|
||||
@ -376,10 +353,7 @@ public class SysStaffServiceImpl extends ServiceImpl<SysStaffMapper, SysStaff> i
|
||||
@Transactional
|
||||
public AjaxResult updateSysStaff(SysStaff sysStaff)
|
||||
{
|
||||
boolean repeat = checkNameRepeat(sysStaff.getUserId(), sysStaff.getName());
|
||||
if(repeat){
|
||||
return AjaxResult.error("姓名【"+sysStaff.getName()+"】已存在,所有员工(含离职)不可重名");
|
||||
}
|
||||
|
||||
if(StringUtils.isNotEmpty(sysStaff.getSource()) && sysStaff.getSource().equals(Constants.SOURCE_DING) && StringUtils.isEmpty(sysStaff.getSex())){
|
||||
//根据省份证确定性别和年龄
|
||||
sysStaff.setAge(Long.parseLong(new SimpleDateFormat("yyyy").format(new Date())) - Long.parseLong(sysStaff.getIdCard().substring(6,10)));
|
||||
@ -410,23 +384,11 @@ public class SysStaffServiceImpl extends ServiceImpl<SysStaffMapper, SysStaff> i
|
||||
if(StringUtils.isNotEmpty(sysStaff.getCode())){
|
||||
KingdeeRequestUtils.employeeDisabled(Collections.asMap("userCode","\""+sysStaff.getCode()+"\""));
|
||||
}
|
||||
|
||||
//如果走离职, 需要实时计算出工资
|
||||
//还原原始状态, 用于计算离职工资
|
||||
sysStaff.setStatus(oldStatus);
|
||||
rzSalaryDetailService.dimission(sysStaff);
|
||||
|
||||
try {
|
||||
//清理打卡机照片
|
||||
List<String> dkj_list = Collections.asList(ParamUtils.getRestaurantDevSn());
|
||||
if(Collections.isNotEmpty(sysStaff.getTimeClockList())){
|
||||
dkj_list.addAll(sysStaff.getTimeClockList());
|
||||
}
|
||||
eqSnDetailService.sendDelete(dkj_list, Collections.asList( String.valueOf(sysStaff.getUserId())));
|
||||
} catch (Exception e) {
|
||||
log.error("清理员工照片信息失败", e.getMessage());
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
||||
@ -442,54 +404,54 @@ public class SysStaffServiceImpl extends ServiceImpl<SysStaffMapper, SysStaff> i
|
||||
//根据员工ID查询原来的数据信息
|
||||
SysStaff old_staff = getBaseMapper().selectSysStaffByUserId(sysStaff.getUserId());
|
||||
//检查是否修改岗位
|
||||
// if(StringUtils.isEmpty(old_staff.getJobCode()) && StringUtils.isNotEmpty(sysStaff.getJobCode()) ||
|
||||
// StringUtils.isNotEmpty(old_staff.getJobCode()) && StringUtils.isEmpty(sysStaff.getJobCode()) ||
|
||||
// StringUtils.isNotEmpty(old_staff.getJobCode()) && StringUtils.isNotEmpty(sysStaff.getJobCode()) && !old_staff.getJobCode().equals(sysStaff.getJobCode())) {
|
||||
// String deptNum = "";
|
||||
// String positionNum = "";
|
||||
// if(StringUtils.isNotEmpty(sysStaff.getJobCode())){
|
||||
// deptNum = sysStaff.getJobCode().split("_")[1];
|
||||
// positionNum = sysStaff.getJobCode().split("_")[0];
|
||||
// }
|
||||
// String oldPositionNum = "";
|
||||
// if(StringUtils.isNotEmpty(old_staff.getJobCode())){
|
||||
// oldPositionNum = old_staff.getJobCode().split("_")[0];
|
||||
// }
|
||||
// String fstaffId = "";
|
||||
// String fid = null;
|
||||
// JSONObject extended = new JSONObject();
|
||||
// if(StringUtils.isNotEmpty(sysStaff.getExtended())){
|
||||
// extended = JSON.parseObject(sysStaff.getExtended());
|
||||
// fstaffId = extended.getString("FSTAFFID");
|
||||
// fid = extended.getString("FID");
|
||||
// }
|
||||
//
|
||||
//
|
||||
// //都为空, 不确定金蝶是否存在员工信息
|
||||
// if(StringUtils.isEmpty(fid) && StringUtils.isEmpty(fstaffId)){
|
||||
// //查询金蝶的表单
|
||||
// String result = KingdeeRequestUtils.executeBillQuery(Collections.asMap("userCode", sysStaff.getCode()), KingdeeParamsEnum.Employee.DOCUMENT_INQUIRY);
|
||||
// JSONArray resJS = JSON.parseArray(result);
|
||||
// if(resJS.size() > 0){
|
||||
// fid = resJS.getJSONArray(0).getString(0);
|
||||
// extended.put("FID", fid);
|
||||
// }
|
||||
// }
|
||||
// //如果fid还为空, 则证明金蝶不存在员工信息
|
||||
// if(StringUtils.isEmpty(fid)){
|
||||
// if(StringUtils.isNotEmpty(sysStaff.getJobCode())){
|
||||
// sysStaff.setExtended(KingdeeRequestUtils.employeeSave(Collections.asMap("userName", sysStaff.getName(), "userCode", sysStaff.getCode(), "jobCode", sysStaff.getJobCode().split("_")[0],"deptCode", sysStaff.getJobCode().split("_")[1])));
|
||||
// }else if(StringUtils.isEmpty(sysStaff.getJobCode())){
|
||||
// sysStaff.setExtended(KingdeeRequestUtils.employeeSaveEmptyJob(Collections.asMap("userName", sysStaff.getName(), "userCode", sysStaff.getCode())));
|
||||
// }
|
||||
// }else{
|
||||
// String result = KingdeeRequestUtils.updateJobInfo(Collections.asMap( "userCode", sysStaff.getCode(), "deptCode", deptNum, "jobCode", positionNum, "oldJobCode", oldPositionNum,"FSTAFFID", fstaffId));
|
||||
// if(StringUtils.isNotEmpty(result)){
|
||||
// extended.put("FSTAFFID",JSON.parseObject(result).getString("FSTAFFID"));
|
||||
// sysStaff.setExtended(extended.toString());
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
if(StringUtils.isEmpty(old_staff.getJobCode()) && StringUtils.isNotEmpty(sysStaff.getJobCode()) ||
|
||||
StringUtils.isNotEmpty(old_staff.getJobCode()) && StringUtils.isEmpty(sysStaff.getJobCode()) ||
|
||||
StringUtils.isNotEmpty(old_staff.getJobCode()) && StringUtils.isNotEmpty(sysStaff.getJobCode()) && !old_staff.getJobCode().equals(sysStaff.getJobCode())) {
|
||||
String deptNum = "";
|
||||
String positionNum = "";
|
||||
if(StringUtils.isNotEmpty(sysStaff.getJobCode())){
|
||||
deptNum = sysStaff.getJobCode().split("_")[1];
|
||||
positionNum = sysStaff.getJobCode().split("_")[0];
|
||||
}
|
||||
String oldPositionNum = "";
|
||||
if(StringUtils.isNotEmpty(old_staff.getJobCode())){
|
||||
oldPositionNum = old_staff.getJobCode().split("_")[0];
|
||||
}
|
||||
String fstaffId = "";
|
||||
String fid = null;
|
||||
JSONObject extended = new JSONObject();
|
||||
if(StringUtils.isNotEmpty(sysStaff.getExtended())){
|
||||
extended = JSON.parseObject(sysStaff.getExtended());
|
||||
fstaffId = extended.getString("FSTAFFID");
|
||||
fid = extended.getString("FID");
|
||||
}
|
||||
|
||||
|
||||
//都为空, 不确定金蝶是否存在员工信息
|
||||
if(StringUtils.isEmpty(fid) && StringUtils.isEmpty(fstaffId)){
|
||||
//查询金蝶的表单
|
||||
String result = KingdeeRequestUtils.executeBillQuery(Collections.asMap("userCode", sysStaff.getCode()), KingdeeParamsEnum.Employee.DOCUMENT_INQUIRY);
|
||||
JSONArray resJS = JSON.parseArray(result);
|
||||
if(resJS.size() > 0){
|
||||
fid = resJS.getJSONArray(0).getString(0);
|
||||
extended.put("FID", fid);
|
||||
}
|
||||
}
|
||||
//如果fid还为空, 则证明金蝶不存在员工信息
|
||||
if(StringUtils.isEmpty(fid)){
|
||||
if(StringUtils.isNotEmpty(sysStaff.getJobCode())){
|
||||
sysStaff.setExtended(KingdeeRequestUtils.employeeSave(Collections.asMap("userName", sysStaff.getName(), "userCode", sysStaff.getCode(), "jobCode", sysStaff.getJobCode().split("_")[0],"deptCode", sysStaff.getJobCode().split("_")[1])));
|
||||
}else if(StringUtils.isEmpty(sysStaff.getJobCode())){
|
||||
sysStaff.setExtended(KingdeeRequestUtils.employeeSaveEmptyJob(Collections.asMap("userName", sysStaff.getName(), "userCode", sysStaff.getCode())));
|
||||
}
|
||||
}else{
|
||||
String result = KingdeeRequestUtils.updateJobInfo(Collections.asMap( "userCode", sysStaff.getCode(), "deptCode", deptNum, "jobCode", positionNum, "oldJobCode", oldPositionNum,"FSTAFFID", fstaffId));
|
||||
if(StringUtils.isNotEmpty(result)){
|
||||
extended.put("FSTAFFID",JSON.parseObject(result).getString("FSTAFFID"));
|
||||
sysStaff.setExtended(extended.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
//判断员工更换公司
|
||||
if(!old_staff.getCompanyName().equals(sysStaff.getCompanyName())) {
|
||||
SysStaffDetail sysStaffDetail = sysStaffDetailMapper.selectSysStaffDetailByStaffId(sysStaff.getUserId());
|
||||
@ -497,11 +459,6 @@ public class SysStaffServiceImpl extends ServiceImpl<SysStaffMapper, SysStaff> i
|
||||
sysStaffDetail.setTotalWages(DataUtils.DEFAULT_VALUE);
|
||||
sysStaffDetail.setAggregatePersonalIncomeTax(DataUtils.DEFAULT_VALUE);
|
||||
sysStaffDetailMapper.updateById(sysStaffDetail);
|
||||
}
|
||||
//判断是否修改部门
|
||||
if(!old_staff.getDeptId().equals(sysStaff.getDeptId())) {
|
||||
//请假数据处理
|
||||
rzLeaveMapper.updateDeptIdByStaffId(sysStaff.getDeptId(), sysStaff.getUserId());
|
||||
}
|
||||
//如果是部门负责人, 修改部门领导信息
|
||||
if("是".equals(sysStaff.getIsLeader())){
|
||||
@ -528,7 +485,6 @@ public class SysStaffServiceImpl extends ServiceImpl<SysStaffMapper, SysStaff> i
|
||||
rzRestaurantStatisticsService.createRestaurantStatistics(sysStaff, DateUtils.getNowDate());
|
||||
//处理考勤机相关信息
|
||||
initCheckDevice(sysStaff);
|
||||
|
||||
// }
|
||||
return AjaxResult.success();
|
||||
}
|
||||
@ -959,13 +915,13 @@ public class SysStaffServiceImpl extends ServiceImpl<SysStaffMapper, SysStaff> i
|
||||
@Override
|
||||
public AjaxResult importSalesCommissions(List<RzSalaryVo> attendanceList) {
|
||||
// 获取销售部门信息
|
||||
// SysDept sysDept = deptMapper.selectOne(new LambdaQueryWrapper<SysDept>()
|
||||
// .eq(SysDept::getDelFlag, Constants.DELETE_FLAG_0)
|
||||
// .eq(SysDept::getDeptName, "销售部"));
|
||||
//
|
||||
// if (sysDept == null) {
|
||||
// return AjaxResult.error("销售部门未找到,请确认部门是否存在且未被删除!");
|
||||
// }
|
||||
SysDept sysDept = deptMapper.selectOne(new LambdaQueryWrapper<SysDept>()
|
||||
.eq(SysDept::getDelFlag, Constants.DELETE_FLAG_0)
|
||||
.eq(SysDept::getDeptName, "销售部"));
|
||||
|
||||
if (sysDept == null) {
|
||||
return AjaxResult.error("销售部门未找到,请确认部门是否存在且未被删除!");
|
||||
}
|
||||
|
||||
|
||||
sysStaffDetailMapper.resetSalesCommission();
|
||||
@ -976,7 +932,7 @@ public class SysStaffServiceImpl extends ServiceImpl<SysStaffMapper, SysStaff> i
|
||||
// 直接根据姓名和部门ID查询员工信息
|
||||
SysStaff sysStaff = getBaseMapper().selectOne(new LambdaQueryWrapper<SysStaff>()
|
||||
.eq(SysStaff::getName, rzSalaryVo.getName())
|
||||
.eq(SysStaff::getIdCard, rzSalaryVo.getIdCard())
|
||||
.eq(SysStaff::getDeptId, sysDept.getDeptId())
|
||||
.eq(SysStaff::getDelFlag, Constants.DELETE_FLAG_0));
|
||||
|
||||
if (sysStaff != null) {
|
||||
|
||||
@ -1,15 +1,9 @@
|
||||
package com.evo.task;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.evo.attendance.service.IRzAbnormalDetailService;
|
||||
import com.evo.attendance.service.IRzAttendanceService;
|
||||
import com.evo.attendance.service.IRzAttendanceStatisticalService;
|
||||
import com.evo.attendance.service.RzAttendanceDetailService;
|
||||
import com.evo.common.core.domain.AjaxResult;
|
||||
import com.evo.common.core.domain.entity.DeptMonthHistory;
|
||||
import com.evo.common.core.domain.entity.SysDept;
|
||||
import com.evo.common.utils.DateUtils;
|
||||
import com.evo.common.utils.ParamUtils;
|
||||
import com.evo.personnelMatters.domain.RzMealExpenses;
|
||||
@ -19,10 +13,7 @@ import com.evo.restaurant.domain.RzRestaurantStatistics;
|
||||
import com.evo.restaurant.service.IRzRestaurantImagesService;
|
||||
import com.evo.restaurant.service.IRzRestaurantStatisticsService;
|
||||
import com.evo.system.domain.SysStaff;
|
||||
import com.evo.system.service.DeptMonthHistoryService;
|
||||
import com.evo.system.service.ISysDeptService;
|
||||
import com.evo.system.service.ISysStaffService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@ -31,7 +22,6 @@ import java.text.ParseException;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class TaskController {
|
||||
|
||||
@ -51,10 +41,6 @@ public class TaskController {
|
||||
private RzAttendanceDetailService rzAttendanceDetailService;
|
||||
@Resource
|
||||
private RzMealExpensesService rzMealExpensesService;
|
||||
@Resource
|
||||
private ISysDeptService sysDeptService;
|
||||
@Resource
|
||||
private DeptMonthHistoryService deptMonthHistoryService;
|
||||
/**
|
||||
* 每月1号 0:20 自动生成考勤数据
|
||||
*/
|
||||
@ -94,18 +80,6 @@ public class TaskController {
|
||||
rzRestaurantStatisticsService.correct(rzRestaurantStatistics);
|
||||
}
|
||||
|
||||
/**
|
||||
* 每月1号 2:00 自动生成组织历史记录
|
||||
*/
|
||||
@Scheduled(cron = "0 0 2 1 * ?")
|
||||
public void autoCreateDeptHistory(){
|
||||
List<SysDept> deptList = sysDeptService.list(new LambdaQueryWrapper<SysDept>());
|
||||
DeptMonthHistory history = new DeptMonthHistory();
|
||||
history.setDeptHistory(JSONArray.toJSONString(deptList));
|
||||
history.setDateMonth(DateUtil.format(DateUtils.addMonths(new Date(), -1), "yyyy-MM"));
|
||||
deptMonthHistoryService.save(history);
|
||||
};
|
||||
|
||||
/**
|
||||
* 每天凌晨3点核算前一天的考勤情况
|
||||
*/
|
||||
@ -132,21 +106,12 @@ public class TaskController {
|
||||
abnormalDetailService.insertRzAbnormalDetail();
|
||||
}
|
||||
|
||||
/***
|
||||
* 每天9点推送前一天未打卡信息
|
||||
*/
|
||||
|
||||
@Scheduled(cron = "0 0 9 * * ?")
|
||||
public void autoAbnormalAttendance(){
|
||||
if(!ParamUtils.sendEveryDayCheckInWeiXin()){
|
||||
log.info("系统停止发送每天未打卡通知信息;");
|
||||
return;
|
||||
}
|
||||
rzAttendanceService.sendAbnormalAttendance();
|
||||
}
|
||||
|
||||
/***
|
||||
* 每天10点推送超过3填未打卡信息
|
||||
*/
|
||||
@Scheduled(cron = "0 0 10 * * ?")
|
||||
public void autoAttendanceDetail() throws ParseException {
|
||||
rzAttendanceDetailService.sendAttendanceDetail();
|
||||
|
||||
@ -5,7 +5,6 @@ import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.evo.common.config.Global;
|
||||
import com.evo.common.utils.Collections;
|
||||
import com.evo.common.utils.ParamUtils;
|
||||
import com.evo.wechat.TemplateMessageUtil;
|
||||
import com.evo.wechat.config.GZHProperties;
|
||||
import com.evo.wechat.dto.AbnormalAttendanceTemplate;
|
||||
@ -34,7 +33,7 @@ public class SendClientService {
|
||||
|
||||
public String sendAbnormalAttendance(String deptName, String userName, String info, Date date, String openId){
|
||||
//检查是否为生产环境, 非生产环境,无需发送
|
||||
if("druid".equals(Global.newInstance().getActive()) && ParamUtils.sendWeiXin()){
|
||||
if("druid".equals(Global.newInstance().getActive())){
|
||||
AbnormalAttendanceTemplate templateData = new AbnormalAttendanceTemplate();
|
||||
templateData.setThing1((JSONObject) JSON.toJSON(Collections.asMap("value", deptName)));
|
||||
templateData.setThing2((JSONObject)JSON.toJSON(Collections.asMap("value",userName)));//动态跟换车牌号
|
||||
|
||||
@ -7,7 +7,7 @@ spring:
|
||||
# 热部署开关
|
||||
redis:
|
||||
# 地址
|
||||
host: 192.168.5.232
|
||||
host: localhost
|
||||
# 端口,默认为6379
|
||||
port: 6379
|
||||
# 数据库索引
|
||||
@ -32,9 +32,9 @@ spring:
|
||||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
url: jdbc:mysql://192.168.5.232:3306/evo_cw_dev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
url: jdbc:mysql://192.168.5.23:3306/dev_evo_cw_new?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: hbyt123456
|
||||
password: yite
|
||||
#username: root
|
||||
#password: yj.chen@001
|
||||
# 从库数据源
|
||||
|
||||
@ -32,7 +32,7 @@ spring:
|
||||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
url: jdbc:mysql://localhost:3306/evo_cw_dev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
url: jdbc:mysql://localhost:3306/evo_cw_dev_ding?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: hbyt123456
|
||||
#username: root
|
||||
|
||||
@ -77,7 +77,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="month != null "> and DATE_FORMAT( month, '%Y%m' ) = DATE_FORMAT( #{month} , '%Y%m' )</if>
|
||||
<if test="deptId != null "> and dept_id = #{deptId}</if>
|
||||
</where>
|
||||
order by month desc
|
||||
</select>
|
||||
|
||||
<select id="selectRzSalaryDetailById" parameterType="Long" resultMap="RzSalaryDetailResult">
|
||||
@ -250,21 +249,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where id = #{id}
|
||||
</update>
|
||||
<!-- 根据员工ID查询员工上一次的交保险公司 -->
|
||||
<select id="selectRzSalaryDetailByStaffId" resultMap="RzSalaryDetailResult">
|
||||
<select id="selectRzSalaryDetailByStaffId" parameterType="Long" resultMap="RzSalaryDetailResult">
|
||||
<include refid="selectRzSalaryDetailVo"/>
|
||||
where del_flag = '0' and staff_id = #{staffId} and DATE_FORMAT( month, '%Y%m' ) = DATE_FORMAT( #{month} , '%Y%m' ) order by month desc limit 1
|
||||
where del_flag = '0' and staff_id = #{staffId} order by month desc limit 1
|
||||
</select>
|
||||
<!-- 根据月份查询员工统计月的工资 -->
|
||||
<select id="selectRzSalaryDetailByMonth" resultMap="RzSalaryDetailResult">
|
||||
<include refid="selectRzSalaryDetailVo"/>
|
||||
where del_flag = '0' and DATE_FORMAT( month, '%Y%m' ) = DATE_FORMAT( #{month} , '%Y%m' )
|
||||
</select>
|
||||
|
||||
<delete id="deleteRzSalaryDetailByMonth">
|
||||
delete from rz_salary_detail where DATE_FORMAT( month, '%Y%m' ) = DATE_FORMAT( #{month} , '%Y%m' )
|
||||
</delete>
|
||||
|
||||
|
||||
<!-- 根据部门查询员工工资情况 -->
|
||||
<select id="selectSalaryDetailByDeptId" resultMap="RzSalaryDetailResult">
|
||||
<include refid="selectRzSalaryDetailVo"/>
|
||||
|
||||
@ -27,7 +27,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
del_flag = '0'
|
||||
<if test="month != null "> and month = #{month}</if>
|
||||
</where>
|
||||
order by month desc
|
||||
</select>
|
||||
|
||||
<select id="selectRzSalaryStatisticsById" parameterType="Long" resultMap="RzSalaryStatisticsResult">
|
||||
|
||||
@ -121,7 +121,5 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where del_flag = '0' and user_id = #{userId} order by create_time desc limit 1
|
||||
</select>
|
||||
|
||||
<update id="updateDeptIdByStaffId" >
|
||||
update rz_leave set dept_id=#{deptId} where user_id = #{userId}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
||||
@ -20,7 +20,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectRzRestaurantDetailVo">
|
||||
select id, staff_id,name, date, time, sign, del_flag, device_sn, create_by, create_time, update_by, update_time from rz_restaurant_detail
|
||||
select id, staff_id,name, date, time, sign, del_flag, create_by, create_time, update_by, update_time from rz_restaurant_detail
|
||||
</sql>
|
||||
|
||||
<select id="selectRzRestaurantDetailList" parameterType="RzRestaurantDetail" resultMap="RzRestaurantDetailResult">
|
||||
@ -57,7 +57,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="time != null">time,</if>
|
||||
<if test="sign != null">sign,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="deviceSn != null">device_sn,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
@ -70,7 +69,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="time != null">#{time},</if>
|
||||
<if test="sign != null">#{sign},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="deviceSn != null">#{deviceSn},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
@ -96,7 +94,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
SELECT
|
||||
count(rd.id) as faceScanNum,
|
||||
rd.sign as productName,
|
||||
if(dd.dict_label is null or dd.dict_label='外包' or dd.dict_label='伊特劳务外包',"河北伊特",dd.dict_label)as companyName,
|
||||
if(dd.dict_label is null or dd.dict_label='外包',"河北伊特",dd.dict_label)as companyName,
|
||||
ddr.dict_value as unitPrice
|
||||
from rz_restaurant_detail rd
|
||||
left join sys_staff s on s.user_id = rd.staff_id
|
||||
@ -118,7 +116,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
and ss.del_flag = '0'
|
||||
and ssd.daily_wage > 0
|
||||
and ss.zs_Flag = '否'
|
||||
|
||||
and status != '-1'
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
@ -1,12 +0,0 @@
|
||||
<?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="com.evo.system.mapper.ExceptionNotificationMapper">
|
||||
|
||||
|
||||
|
||||
<select id="getExceptionNotification" parameterType="java.lang.Integer" resultType="com.evo.system.domain.ExceptionNotification">
|
||||
select * from exception_notification where notification_type = #{type} order by day desc
|
||||
</select>
|
||||
</mapper>
|
||||
@ -19,11 +19,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="isOverTime" column="is_over_time" />
|
||||
<result property="isShowFinancial" column="is_show_financial" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDeptVo">
|
||||
select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.dept_code, d.leader, d.phone,d.status, d.del_flag,d.is_over_time, d.is_show_financial, d.create_by, d.create_time, d.ding_id
|
||||
select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.leader, d.phone,d.status, d.del_flag,d.is_over_time, d.create_by, d.create_time, d.ding_id
|
||||
from sys_dept d
|
||||
</sql>
|
||||
|
||||
@ -42,29 +41,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="status != null and status != ''">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
<if test="isOverTime != null and isOverTime != ''">
|
||||
<if test="isOverTime != null and status != ''">
|
||||
AND is_over_time = #{isOverTime}
|
||||
</if>
|
||||
<if test="isShowFinancial != null and isShowFinancial != ''">
|
||||
AND is_show_financial = #{isShowFinancial}
|
||||
</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
order by d.parent_id
|
||||
</select>
|
||||
|
||||
<select id="selectNameByIds" parameterType="List" resultType="java.lang.String">
|
||||
select GROUP_CONCAT(dept_name) from sys_dept
|
||||
<where>
|
||||
<if test="deptIds != null">
|
||||
dept_id in
|
||||
<foreach collection="deptIds" item="deptId" open="(" separator="," close=")">
|
||||
#{deptId}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectDeptListByRoleId" resultType="Long">
|
||||
select d.dept_id
|
||||
from sys_dept d
|
||||
@ -77,7 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
|
||||
<select id="selectDeptById" parameterType="Long" resultMap="SysDeptResult">
|
||||
select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.dept_code, d.leader, d.phone, d.status,d.is_over_time,
|
||||
select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.leader, d.phone, d.status,d.is_over_time,
|
||||
(select dept_name from sys_dept where dept_id = d.parent_id) parent_name
|
||||
from sys_dept d
|
||||
where d.dept_id = #{deptId}
|
||||
@ -110,13 +94,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="deptId != null and deptId != 0">dept_id,</if>
|
||||
<if test="parentId != null and parentId != 0">parent_id,</if>
|
||||
<if test="deptName != null and deptName != ''">dept_name,</if>
|
||||
<if test="deptCode != null and deptCode != ''">dept_code,</if>
|
||||
<if test="ancestors != null and ancestors != ''">ancestors,</if>
|
||||
<if test="leader != null and leader != ''">leader,</if>
|
||||
<if test="phone != null and phone != ''">phone,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="isOverTime != null">is_over_time,</if>
|
||||
<if test="isShowFinancial != null">is_show_financial,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="dingId != null ">ding_id,</if>
|
||||
|
||||
@ -125,13 +107,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="deptId != null and deptId != 0">#{deptId},</if>
|
||||
<if test="parentId != null and parentId != 0">#{parentId},</if>
|
||||
<if test="deptName != null and deptName != ''">#{deptName},</if>
|
||||
<if test="deptCode != null and deptCode != ''">#{deptCode},</if>
|
||||
<if test="ancestors != null and ancestors != ''">#{ancestors},</if>
|
||||
<if test="leader != null and leader != ''">#{leader},</if>
|
||||
<if test="phone != null and phone != ''">#{phone},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="isOverTime != null">#{isOverTime},</if>
|
||||
<if test="isShowFinancial != null">#{isShowFinancial},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="dingId != null ">#{dingId},</if>
|
||||
sysdate()
|
||||
@ -143,13 +123,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<set>
|
||||
<if test="parentId != null and parentId != 0">parent_id = #{parentId},</if>
|
||||
<if test="deptName != null and deptName != ''">dept_name = #{deptName},</if>
|
||||
<if test="deptCode != null and deptCode != ''">dept_code = #{deptCode},</if>
|
||||
<if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if>
|
||||
<if test="leader != null">leader = #{leader},</if>
|
||||
<if test="phone != null">phone = #{phone},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="isOverTime != null">is_over_time = #{isOverTime},</if>
|
||||
<if test="isShowFinancial != null">is_show_financial = #{isShowFinancial},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
<if test="dingId != null ">ding_id = #{dingId},</if>
|
||||
update_time = sysdate()
|
||||
|
||||
@ -52,7 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="extended" column="extended" />
|
||||
<result property="dingUserId" column="ding_user_id" />
|
||||
<result property="source" column="source" />
|
||||
<result property="dingUnionId" column="ding_union_id" />
|
||||
<result property="dingUserId" column="ding_user_id" />
|
||||
|
||||
</resultMap>
|
||||
|
||||
@ -62,7 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
quit_date, contract_start, contract_end, contract_type, social_type, seniority, is_overtime_pay,
|
||||
zs_flag, secrecy, injury, insurance, introducer, clock_in, status,
|
||||
wages_ratio_date, remarks, del_flag, create_by, create_time, update_by,
|
||||
update_time, image_url,time_clock,subsidys, job_code, extended, openid, ding_user_id, ding_union_id, source
|
||||
update_time, image_url,time_clock,subsidys, job_code, extended, openid, ding_user_id, source
|
||||
from sys_staff
|
||||
</sql>
|
||||
|
||||
@ -92,18 +92,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectNameByUserIds" parameterType="List" resultType="java.lang.String">
|
||||
select GROUP_CONCAT(name) from sys_staff
|
||||
<where>
|
||||
<if test="userIds != null">
|
||||
user_id in
|
||||
<foreach collection="userIds" item="userId" open="(" separator="," close=")">
|
||||
#{userId}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSysStaffByDingUserId" parameterType="String" resultMap="SysStaffResult">
|
||||
<include refid="selectSysStaffVo"/>
|
||||
where ding_user_id = #{dingUserId}
|
||||
@ -166,7 +154,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="openid != null">openid,</if>
|
||||
<if test="source != null">source,</if>
|
||||
<if test="dingUserId != null">ding_user_id,</if>
|
||||
<if test="dingUnionId != null">ding_union_id,</if>
|
||||
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
@ -219,7 +206,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="openid != null">#{openid},</if>
|
||||
<if test="source != null">#{source},</if>
|
||||
<if test="dingUserId != null">#{dingUserId},</if>
|
||||
<if test="dingUnionId != null">#{dingUnionId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@ -274,7 +260,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="extended != null and extended != ''">extended=#{extended},</if>
|
||||
<if test="openid != null">openid=#{openid},</if>
|
||||
<if test="dingUserId != null">ding_user_id= #{dingUserId},</if>
|
||||
<if test="dingUnionId != null">ding_union_id= #{dingUnionId},</if>
|
||||
</trim>
|
||||
where user_id = #{userId}
|
||||
</update>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user