数据同步定时器全打开提交

This commit is contained in:
fl 2024-12-05 10:46:34 +08:00
parent 99d51e7f16
commit cb3e7f9941
8 changed files with 37 additions and 15 deletions

View File

@ -52,7 +52,11 @@ public class AttGroupController extends BaseController {
@Log(title = "考勤设置->考勤规则设置->考勤组新增", businessType = BusinessType.INSERT)
public AjaxResult add(@RequestBody AttGroupBean bean) {
try{
return toAjax(attGroupService.insertAttGroup(bean));
int i = attGroupService.insertAttGroup(bean);
if(i==-1){
return error("考勤组没有人员或选择的组织下没有人员");
}
return toAjax(i);
}catch (Exception e){
log.error(e.toString(),e);
}
@ -81,7 +85,11 @@ public class AttGroupController extends BaseController {
@Log(title = "考勤设置->考勤规则设置->考勤组修改", businessType = BusinessType.UPDATE)
public AjaxResult edit(@RequestBody AttGroupBean bean) {
try{
return toAjax(attGroupService.updateAttGroup(bean));
int i = attGroupService.updateAttGroup(bean);
if(i==-1){
return error("考勤组没有人员或选择的组织下没有人员");
}
return toAjax(i);
}catch (Exception e){
log.error(e.toString(),e);
}

View File

@ -57,11 +57,14 @@ public class AttGroupServiceImpl implements AttGroupService {
public int insertAttGroup(AttGroupBean bean) {
int result = 0;
bean.setCreateUserId(SecurityUtils.getLoginUser().getSysUser().getUserId());
//只有部门的将部门变成部门下所有人(去除掉其他考勤组选的人)
List<AttGroupCheckOrgBean> checkOrgAllList = dealWithOrgUser(bean, null);
if(checkOrgAllList.isEmpty()){
return -1;
}
//新增考勤组表
int i = attGroupDao.insertAttGroup(bean);
if (i > 0) {
//只有部门的将部门变成部门下所有人(去除掉其他考勤组选的人)
List<AttGroupCheckOrgBean> checkOrgAllList = dealWithOrgUser(bean, null);
//新增考勤组设置表
int j = attGroupDao.insertAttGroupSetting(bean);
//新增考勤组绑定人员表
@ -92,16 +95,19 @@ public class AttGroupServiceImpl implements AttGroupService {
public int updateAttGroup(AttGroupBean bean) {
int result = 0;
bean.setUpdateUserId(SecurityUtils.getLoginUser().getSysUser().getUserId());
List<AttGroupCheckOrgBean> checkOrgAllList = dealWithOrgUser(bean, null);
if(checkOrgAllList.isEmpty()){
return -1;
}
//新增考勤组表
int i = attGroupDao.updateAttGroup(bean);
if (i > 0) {
List<AttGroupCheckOrgBean> attGroupCheckOrgBeans = dealWithOrgUser(bean, bean.getGroupId());
//新增考勤组设置表
int j = attGroupDao.updateAttGroupSetting(bean);
//删除考勤组绑定人员
attGroupDao.deleteAttGroupRelationPerson(bean.getGroupId());
//新增考勤组绑定人员表
int x = attGroupDao.insertAttGroupPerson(attGroupCheckOrgBeans);
int x = attGroupDao.insertAttGroupPerson(checkOrgAllList);
if (j > 0 && (x == bean.getCheckOrgList().size())) {
result = 1;
}

View File

@ -54,6 +54,11 @@ public class AttTasks {
@Resource(name = "attGroupDao")
private AttGroupDao attGroupDao;
private static final int BATCH_SIZE = 10; // 每批次处理的日期数量
private static final int THREAD_POOL_SIZE = 5; // 线程池大小
private volatile boolean executed = false; // 标志位表示任务是否已经执行过
// @Scheduled(cron = "0 0/10 * * * ?")
@Scheduled(fixedDelay = 60000 * 10)
@Async
@ -63,10 +68,6 @@ public class AttTasks {
pushAttData(today,1);
log.info("--------考勤定时器完毕------");
}
private static final int BATCH_SIZE = 10; // 每批次处理的日期数量
private static final int THREAD_POOL_SIZE = 5; // 线程池大小
private volatile boolean executed = false; // 标志位表示任务是否已经执行过
/**
* 历史考勤数据
*/

View File

@ -261,7 +261,7 @@ public class WechatTasks {
* 休假出差数据同步定时器
*/
// @Scheduled(cron = "0 0/10 * * * ?")
@Scheduled(fixedDelay = 60000 * 10)
@Scheduled(initialDelay = 10000,fixedDelay = 60000 * 10)
@Async
public void getAttTasks() {
log.info("--------休假出差数据同步定时器开启------");

View File

@ -29,6 +29,9 @@
<if test="userId != null and userId != '' ">
and oc.user_id = #{userId}
</if>
<if test="userName != null and userName != '' ">
and locate(#{userName},su.user_name)
</if>
<if test="startTime != null and startTime != '' ">
and oc.create_time between #{startTime} and #{endTime}
</if>

View File

@ -132,6 +132,7 @@
<select id="getOrgInfoByUserId" resultType="com.bonus.system.basic.domain.SysOrg">
SELECT
distinct
user_id,
org_id AS id,
org_name,
@ -146,6 +147,7 @@
WHERE
ag.is_active = '1'
AND ag.user_id = #{userId}
limit 1
</select>
<select id="getWebLeaveList" resultType="com.bonus.system.evection.entity.EvectionBean">
SELECT
@ -163,6 +165,7 @@
</select>
<select id="getOrgInfoByUserName" resultType="com.bonus.system.basic.domain.SysOrg">
SELECT
distinct
ag.user_id,
ag.org_id AS id,
so.org_name,
@ -176,6 +179,7 @@
LEFT JOIN sys_user su ON su.user_id = ag.user_id AND su.is_active = '1'
WHERE
su.user_name = #{userName}
limit 1
</select>

View File

@ -1,2 +1,4 @@
1.换环境 gz_att_prod
2.gz_cloud_test -> gz_cloud
1.maven 换环境 gz_att_prod
2.AttSourceDataMapper.xml 中 gz_cloud_test -> gz_cloud
3.com.bonus.system.att.utils.IpAndPathConfig 修改对应环境
4.com.bonus.system.att.tasks AttTasks 与 WechatTasks 定时器开启

View File

@ -1,2 +0,0 @@
系统部署注意事项
1.勾选prod环境