2024-04-14 21:05:01 +08:00

109 lines
2.9 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.zhgd.xmgl.async;
import com.zhgd.xmgl.call.JiLianDaCall;
import com.zhgd.xmgl.modules.project.entity.ProjectEnterprise;
import com.zhgd.xmgl.modules.worker.entity.DepartmentInfo;
import com.zhgd.xmgl.modules.worker.entity.EnterpriseInfo;
import com.zhgd.xmgl.modules.worker.entity.TeamInfo;
import com.zhgd.xmgl.modules.worker.entity.WorkerInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
@Slf4j
@Component
public class AsyncJiLianDa {
@Autowired
private JiLianDaCall jiLianDaCall;
/**
* 添加企业
*
* @param enterpriseInfo
*/
@Async("sendWorkerExecutor")
public void saveEnterpriseInfo(EnterpriseInfo enterpriseInfo) {
try {
jiLianDaCall.saveEnterpriseInfo(enterpriseInfo);
} catch (Exception e) {
log.error("error", e);
}
}
/**
* 解除企业绑定
*
* @param projectEnterprise
*/
@Async("sendWorkerExecutor")
public void removeEnterpriseInfo(ProjectEnterprise projectEnterprise) {
try {
jiLianDaCall.removeEnterpriseInfo(projectEnterprise);
} catch (Exception e) {
log.error("error", e);
}
}
/**
* 添加班组
*/
@Async("sendWorkerExecutor")
public void saveTeamInfo(TeamInfo teamInfo) {
try {
jiLianDaCall.saveTeamInfo(teamInfo);
} catch (Exception e) {
log.error("error", e);
}
}
/**
* 删除班组
*/
@Async("sendWorkerExecutor")
public void removeTeamInfo(TeamInfo teamInfo) {
try {
jiLianDaCall.removeTeamInfo(teamInfo);
} catch (Exception e) {
log.error("error", e);
}
}
@Async("sendWorkerExecutor")
public void saveWorkerInfo(WorkerInfo workerInfo) {
try {
jiLianDaCall.saveWorkerInfo(workerInfo);
} catch (Exception e) {
log.error("error", e);
}
}
@Async("sendWorkerExecutor")
public void removeWorkerInfo(WorkerInfo workerInfo) {
try {
jiLianDaCall.removeWorkerInfo(workerInfo);
} catch (Exception e) {
log.error("error", e);
}
}
@Async("sendWorkerExecutor")
public void saveDepartmentInfo(DepartmentInfo departmentInfo) {
try {
jiLianDaCall.saveDepartmentInfo(departmentInfo);
} catch (Exception e) {
log.error("error", e);
}
}
@Async("sendWorkerExecutor")
public void removeDepartmentInfo(DepartmentInfo departmentInfo) {
try {
jiLianDaCall.removeDepartmentInfo(departmentInfo);
} catch (Exception e) {
log.error("error", e);
}
}
}