|
|
@@ -8,9 +8,11 @@ import com.github.microservice.models.project.ProjectConfigQueryParam;
|
|
|
import com.github.microservice.models.project.ProjectConfigResultModel;
|
|
|
import com.github.microservice.net.ResultContent;
|
|
|
import com.zhongshu.card.server.core.dao.org.OrganizationDao;
|
|
|
+import com.zhongshu.card.server.core.domain.org.Organization;
|
|
|
import com.zhongshu.card.server.core.service.openAPI.OpenApiRequestService;
|
|
|
import com.zhongshu.card.server.core.service.payment.ExpenseFlowServiceImpl;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.commons.lang3.ObjectUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
@@ -63,17 +65,25 @@ public class ProjectConfigService {
|
|
|
public void sendProjectConfig(String projectInfoCode) {
|
|
|
IotSendParam param = new IotSendParam();
|
|
|
param.setIdentifier(IotIdentifierConfig.projectConfig);
|
|
|
+ param.setProjectInfoCode(projectInfoCode);
|
|
|
String projectOid = "";
|
|
|
+
|
|
|
ProjectConfigResultModel model = new ProjectConfigResultModel();
|
|
|
model.setProjectInfoCode(projectInfoCode);
|
|
|
-
|
|
|
+ Organization organization = organizationDao.findTopByCode(projectInfoCode);
|
|
|
+ if (ObjectUtils.isNotEmpty(organization)) {
|
|
|
+ projectOid = organization.getOid();
|
|
|
+ model.setSuccess();
|
|
|
+ } else {
|
|
|
+ model.setFailed("项目信息不存在");
|
|
|
+ }
|
|
|
JSONObject data = JSONUtil.parseObj(model);
|
|
|
param.setData(data);
|
|
|
ResultContent resultContent = openApiRequestService.sendIotMessage(param, projectOid);
|
|
|
if (resultContent.isSuccess()) {
|
|
|
log.info("项目配置信息下发成功");
|
|
|
} else {
|
|
|
- log.error("项目配置信息下发失败");
|
|
|
+ log.error("项目配置信息下发失败 {}", resultContent.getMsg());
|
|
|
}
|
|
|
}
|
|
|
|