|
@@ -1,12 +1,13 @@
|
|
|
package com.zhongshu.card.server.core.service.projectAbout;
|
|
package com.zhongshu.card.server.core.service.projectAbout;
|
|
|
|
|
|
|
|
import com.github.microservice.net.ResultContent;
|
|
import com.github.microservice.net.ResultContent;
|
|
|
-import com.zhongshu.card.client.model.projectAbout.*;
|
|
|
|
|
|
|
+import com.zhongshu.card.client.model.projectAbout.projectCommon.ProjectCommonConfigModel;
|
|
|
|
|
+import com.zhongshu.card.client.model.projectAbout.projectCommon.ProjectCommonConfigParam;
|
|
|
|
|
+import com.zhongshu.card.client.model.projectAbout.projectCommon.ProjectCommonSuperParam;
|
|
|
import com.zhongshu.card.server.core.dao.org.OrganizationDao;
|
|
import com.zhongshu.card.server.core.dao.org.OrganizationDao;
|
|
|
import com.zhongshu.card.server.core.dao.projectAbout.ProjectCommonConfigDao;
|
|
import com.zhongshu.card.server.core.dao.projectAbout.ProjectCommonConfigDao;
|
|
|
import com.zhongshu.card.server.core.domain.org.Organization;
|
|
import com.zhongshu.card.server.core.domain.org.Organization;
|
|
|
import com.zhongshu.card.server.core.domain.projectAbout.ProjectCommonConfig;
|
|
import com.zhongshu.card.server.core.domain.projectAbout.ProjectCommonConfig;
|
|
|
-import com.zhongshu.card.server.core.domain.projectAbout.ProjectIotInfo;
|
|
|
|
|
import com.zhongshu.card.server.core.service.base.SuperService;
|
|
import com.zhongshu.card.server.core.service.base.SuperService;
|
|
|
import com.zhongshu.card.server.core.util.BeanUtils;
|
|
import com.zhongshu.card.server.core.util.BeanUtils;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -63,12 +64,27 @@ public class ProjectCommonConfigService extends SuperService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * 保存配置信息
|
|
|
|
|
|
|
+ * 得到项目
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param projectOid
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ public ResultContent<ProjectCommonConfigModel> getInfo(String projectOid) {
|
|
|
|
|
+ ProjectCommonConfig entity = commonConfigDao.findTopByProjectOid(projectOid);
|
|
|
|
|
+ ProjectCommonConfigModel model = null;
|
|
|
|
|
+ if (ObjectUtils.isNotEmpty(entity)) {
|
|
|
|
|
+ model = toModel(entity);
|
|
|
|
|
+ }
|
|
|
|
|
+ return ResultContent.buildSuccess(model);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 保存通用配置信息
|
|
|
*
|
|
*
|
|
|
* @param param
|
|
* @param param
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
- public ResultContent saveAgreementInfo(ProjectAgreementConfigParam param) {
|
|
|
|
|
|
|
+ public ResultContent saveCommonConfigInfo(ProjectCommonSuperParam param) {
|
|
|
String projectOid = param.getProjectOid();
|
|
String projectOid = param.getProjectOid();
|
|
|
Organization projectInfo = organizationDao.findTopByOid(projectOid);
|
|
Organization projectInfo = organizationDao.findTopByOid(projectOid);
|
|
|
if (ObjectUtils.isEmpty(projectInfo)) {
|
|
if (ObjectUtils.isEmpty(projectInfo)) {
|
|
@@ -83,6 +99,7 @@ public class ProjectCommonConfigService extends SuperService {
|
|
|
initUpdateEntity(entity);
|
|
initUpdateEntity(entity);
|
|
|
}
|
|
}
|
|
|
BeanUtils.copyProperties(param, entity);
|
|
BeanUtils.copyProperties(param, entity);
|
|
|
|
|
+
|
|
|
entity.setProjectInfo(projectInfo);
|
|
entity.setProjectInfo(projectInfo);
|
|
|
entity.setProjectName(projectInfo.getName());
|
|
entity.setProjectName(projectInfo.getName());
|
|
|
entity.setProjectCode(projectInfo.getCode());
|
|
entity.setProjectCode(projectInfo.getCode());
|
|
@@ -94,25 +111,15 @@ public class ProjectCommonConfigService extends SuperService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * 得到项目
|
|
|
|
|
|
|
+ * 通用得到配置信息
|
|
|
*
|
|
*
|
|
|
* @param projectOid
|
|
* @param projectOid
|
|
|
|
|
+ * @param model
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
- public ResultContent<ProjectCommonConfigModel> getInfo(String projectOid) {
|
|
|
|
|
- ProjectCommonConfig entity = commonConfigDao.findTopByProjectOid(projectOid);
|
|
|
|
|
- ProjectCommonConfigModel model = null;
|
|
|
|
|
- if (ObjectUtils.isNotEmpty(entity)) {
|
|
|
|
|
- model = toModel(entity);
|
|
|
|
|
- }
|
|
|
|
|
- return ResultContent.buildSuccess(model);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public ResultContent<ProjectAgreementConfigParam> getAgreementInfo(String projectOid) {
|
|
|
|
|
|
|
+ public ResultContent getCommonConfigInfo(String projectOid, ProjectCommonSuperParam model) {
|
|
|
ProjectCommonConfig entity = commonConfigDao.findTopByProjectOid(projectOid);
|
|
ProjectCommonConfig entity = commonConfigDao.findTopByProjectOid(projectOid);
|
|
|
- ProjectAgreementConfigParam model = null;
|
|
|
|
|
- if (ObjectUtils.isNotEmpty(entity)) {
|
|
|
|
|
- model = new ProjectAgreementConfigParam();
|
|
|
|
|
|
|
+ if (ObjectUtils.isNotEmpty(entity) && ObjectUtils.isNotEmpty(model)) {
|
|
|
org.springframework.beans.BeanUtils.copyProperties(entity, model);
|
|
org.springframework.beans.BeanUtils.copyProperties(entity, model);
|
|
|
}
|
|
}
|
|
|
return ResultContent.buildSuccess(model);
|
|
return ResultContent.buildSuccess(model);
|