94 lines
2.6 KiB
Java
Raw Normal View History

2023-09-13 14:16:46 +08:00
package com.zhgd.xmgl.call;
import cn.hutool.core.util.StrUtil;
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 com.zhgd.xmgl.util.ThirdPartRequestUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
@Component
@Slf4j
public class JiLianDaCall {
@Value("${jld_push_url:}")
String jldPushUrl;
@Autowired
ThirdPartRequestUtil thirdPartRequestUtil;
private boolean ifSend() {
return StrUtil.isNotBlank(jldPushUrl);
}
/**
* 保存企业
*
* @param enterpriseInfo
*/
public void saveEnterpriseInfo(EnterpriseInfo enterpriseInfo) {
if (!ifSend()) {
return;
}
2023-12-02 11:10:52 +08:00
thirdPartRequestUtil.postJson(jldPushUrl + "/saveEnterpriseInfo", enterpriseInfo);
2023-09-13 14:16:46 +08:00
}
/**
* 删除企业
*
* @param projectEnterprise
*/
public void removeEnterpriseInfo(ProjectEnterprise projectEnterprise) {
if (!ifSend()) {
return;
}
2023-12-02 11:10:52 +08:00
thirdPartRequestUtil.postJson(jldPushUrl + "/removeEnterpriseInfo", projectEnterprise);
2023-09-13 14:16:46 +08:00
}
public void saveTeamInfo(TeamInfo teamInfo) {
if (!ifSend()) {
return;
}
2023-12-02 11:10:52 +08:00
thirdPartRequestUtil.postJson(jldPushUrl + "/saveTeamInfo", teamInfo);
2023-09-13 14:16:46 +08:00
}
public void removeTeamInfo(TeamInfo teamInfo) {
if (!ifSend()) {
return;
}
2023-12-02 11:10:52 +08:00
thirdPartRequestUtil.postJson(jldPushUrl + "/removeTeamInfo", teamInfo);
2023-09-13 14:16:46 +08:00
}
public void saveWorkerInfo(WorkerInfo workerInfo) {
if (!ifSend()) {
return;
}
2023-12-02 11:10:52 +08:00
thirdPartRequestUtil.postJson(jldPushUrl + "/saveWorkerInfo", workerInfo);
2023-09-13 14:16:46 +08:00
}
public void removeWorkerInfo(WorkerInfo workerInfo) {
if (!ifSend()) {
return;
}
2023-12-02 11:10:52 +08:00
thirdPartRequestUtil.postJson(jldPushUrl + "/removeWorkerInfo", workerInfo);
2023-09-13 14:16:46 +08:00
}
public void saveDepartmentInfo(DepartmentInfo departmentInfo) {
if (!ifSend()) {
return;
}
2023-12-02 11:10:52 +08:00
thirdPartRequestUtil.postJson(jldPushUrl + "/saveDepartmentInfo", departmentInfo);
2023-09-13 14:16:46 +08:00
}
public void removeDepartmentInfo(DepartmentInfo departmentInfo) {
if (!ifSend()) {
return;
}
2023-12-02 11:10:52 +08:00
thirdPartRequestUtil.postJson(jldPushUrl + "/removeDepartmentInfo", departmentInfo);
2023-09-13 14:16:46 +08:00
}
}