Commit b758e1f1 authored by sml's avatar sml

代码提交

parent 2d72b7b0
package com.jz.dmp.modules.controller.projconfig.bean; package com.jz.dmp.modules.controller.projconfig.bean;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.jz.dmp.modules.model.DmpProjectConfigEngine; import com.jz.dmp.modules.model.DmpProjectConfigEngine;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**项目配置计算引擎关系表Dto /**项目配置计算引擎关系表Dto
* @author ybz * @author ybz
* *
*/ */
@ApiModel(value = "项目配置计算引擎关系表Dto", description = "项目配置计算引擎关系表Dto") @ApiModel(value = "项目配置计算引擎关系表Dto", description = "项目配置计算引擎关系表Dto")
@JsonIgnoreProperties(value = {"handler"})
public class DmpProjectConfigEngineDto extends DmpProjectConfigEngine { public class DmpProjectConfigEngineDto extends DmpProjectConfigEngine {
@ApiModelProperty(value = "选择的引擎")
private DmpComputEngineDto dmpComputEngineDto;
public DmpComputEngineDto getDmpComputEngineDto() {
return dmpComputEngineDto;
}
public void setDmpComputEngineDto(DmpComputEngineDto dmpComputEngineDto) {
this.dmpComputEngineDto = dmpComputEngineDto;
}
} }
package com.jz.dmp.modules.controller.projconfig.bean; package com.jz.dmp.modules.controller.projconfig.bean;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.jz.dmp.modules.model.DmpProjectConfigEngine;
import com.jz.dmp.modules.model.DmpProjectConfigInfo; import com.jz.dmp.modules.model.DmpProjectConfigInfo;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -25,6 +28,9 @@ public class DmpProjectConfigInfoDto extends DmpProjectConfigInfo { ...@@ -25,6 +28,9 @@ public class DmpProjectConfigInfoDto extends DmpProjectConfigInfo {
*/ */
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "选择的计算引擎")
private List<DmpProjectConfigEngineDto> dmpProjectConfigEngineDtos;
@ApiModelProperty(value = "公共配置") @ApiModelProperty(value = "公共配置")
private DmpPublicConfigInfoDto dmpPublicConfigInfoDto; private DmpPublicConfigInfoDto dmpPublicConfigInfoDto;
...@@ -35,4 +41,13 @@ public class DmpProjectConfigInfoDto extends DmpProjectConfigInfo { ...@@ -35,4 +41,13 @@ public class DmpProjectConfigInfoDto extends DmpProjectConfigInfo {
public void setDmpPublicConfigInfoDto(DmpPublicConfigInfoDto dmpPublicConfigInfoDto) { public void setDmpPublicConfigInfoDto(DmpPublicConfigInfoDto dmpPublicConfigInfoDto) {
this.dmpPublicConfigInfoDto = dmpPublicConfigInfoDto; this.dmpPublicConfigInfoDto = dmpPublicConfigInfoDto;
} }
public List<DmpProjectConfigEngineDto> getDmpProjectConfigEngineDtos() {
return dmpProjectConfigEngineDtos;
}
public void setDmpProjectConfigEngineDtos(List<DmpProjectConfigEngineDto> dmpProjectConfigEngineDtos) {
this.dmpProjectConfigEngineDtos = dmpProjectConfigEngineDtos;
}
} }
...@@ -5,6 +5,7 @@ import java.util.List; ...@@ -5,6 +5,7 @@ import java.util.List;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import com.jz.dmp.modules.model.DmpComputEngine; import com.jz.dmp.modules.model.DmpComputEngine;
import com.jz.dmp.modules.model.DmpComputEngineParam;
public class MyDmpComputEngineConverter { public class MyDmpComputEngineConverter {
......
...@@ -78,6 +78,9 @@ public class DmpProjectConfigEngine implements Serializable{ ...@@ -78,6 +78,9 @@ public class DmpProjectConfigEngine implements Serializable{
@ApiModelProperty(value = "选择引擎私有配置参数") @ApiModelProperty(value = "选择引擎私有配置参数")
private List<DmpProjectEngineParam> dmpProjectEngineParams; private List<DmpProjectEngineParam> dmpProjectEngineParams;
@ApiModelProperty(value = "选择的引擎")
private DmpComputEngine dmpComputEngine;
public Integer getConfigEngineId() { public Integer getConfigEngineId() {
return configEngineId; return configEngineId;
...@@ -158,5 +161,13 @@ public class DmpProjectConfigEngine implements Serializable{ ...@@ -158,5 +161,13 @@ public class DmpProjectConfigEngine implements Serializable{
public void setDmpProjectEngineParams(List<DmpProjectEngineParam> dmpProjectEngineParams) { public void setDmpProjectEngineParams(List<DmpProjectEngineParam> dmpProjectEngineParams) {
this.dmpProjectEngineParams = dmpProjectEngineParams; this.dmpProjectEngineParams = dmpProjectEngineParams;
} }
public DmpComputEngine getDmpComputEngine() {
return dmpComputEngine;
}
public void setDmpComputEngine(DmpComputEngine dmpComputEngine) {
this.dmpComputEngine = dmpComputEngine;
}
} }
...@@ -25,6 +25,7 @@ import com.jz.common.bean.PageInfoResponse; ...@@ -25,6 +25,7 @@ import com.jz.common.bean.PageInfoResponse;
import com.jz.common.constant.StatuConstant; import com.jz.common.constant.StatuConstant;
import com.jz.common.persistence.BaseService; import com.jz.common.persistence.BaseService;
import com.jz.dmp.modules.controller.bean.MyDmpProjectConfigEngineConverter; import com.jz.dmp.modules.controller.bean.MyDmpProjectConfigEngineConverter;
import com.jz.dmp.modules.controller.projconfig.bean.DmpComputEngineDto;
import com.jz.dmp.modules.controller.projconfig.bean.DmpProjectConfigEngineDto; import com.jz.dmp.modules.controller.projconfig.bean.DmpProjectConfigEngineDto;
import com.jz.dmp.modules.controller.projconfig.bean.DmpProjectConfigEngineRequest; import com.jz.dmp.modules.controller.projconfig.bean.DmpProjectConfigEngineRequest;
import com.jz.dmp.modules.controller.projconfig.bean.DmpProjectConfigInfoBatch; import com.jz.dmp.modules.controller.projconfig.bean.DmpProjectConfigInfoBatch;
...@@ -34,9 +35,11 @@ import com.jz.dmp.modules.controller.projconfig.bean.DmpProjectEngineParamDto; ...@@ -34,9 +35,11 @@ import com.jz.dmp.modules.controller.projconfig.bean.DmpProjectEngineParamDto;
import com.jz.dmp.modules.controller.projconfig.bean.DmpPublicConfigInfoDto; import com.jz.dmp.modules.controller.projconfig.bean.DmpPublicConfigInfoDto;
import com.jz.dmp.modules.controller.projconfig.bean.DmpPublicConfigInfoRequest; import com.jz.dmp.modules.controller.projconfig.bean.DmpPublicConfigInfoRequest;
import com.jz.dmp.modules.controller.projconfig.bean.MyDmpComputEngineConverter; import com.jz.dmp.modules.controller.projconfig.bean.MyDmpComputEngineConverter;
import com.jz.dmp.modules.dao.projconfig.DmpComputEngineMapper;
import com.jz.dmp.modules.dao.projconfig.DmpProjectConfigEngineMapper; import com.jz.dmp.modules.dao.projconfig.DmpProjectConfigEngineMapper;
import com.jz.dmp.modules.dao.projconfig.DmpProjectConfigInfoMapper; import com.jz.dmp.modules.dao.projconfig.DmpProjectConfigInfoMapper;
import com.jz.dmp.modules.dao.projconfig.DmpProjectEngineParamMapper; import com.jz.dmp.modules.dao.projconfig.DmpProjectEngineParamMapper;
import com.jz.dmp.modules.model.DmpComputEngine;
import com.jz.dmp.modules.model.DmpProjectConfigEngine; import com.jz.dmp.modules.model.DmpProjectConfigEngine;
import com.jz.dmp.modules.model.DmpProjectConfigInfo; import com.jz.dmp.modules.model.DmpProjectConfigInfo;
import com.jz.dmp.modules.model.DmpProjectEngineParam; import com.jz.dmp.modules.model.DmpProjectEngineParam;
...@@ -63,6 +66,9 @@ public class DmpProjectConfigInfoServiceImpl extends BaseService implements DmpP ...@@ -63,6 +66,9 @@ public class DmpProjectConfigInfoServiceImpl extends BaseService implements DmpP
@Autowired @Autowired
private DmpPublicConfigInfoService dmpPublicConfigInfoService; private DmpPublicConfigInfoService dmpPublicConfigInfoService;
@Autowired
private DmpComputEngineMapper dmpComputEngineMapper;
/* /*
* (non-Javadoc) * (non-Javadoc)
...@@ -311,6 +317,12 @@ public class DmpProjectConfigInfoServiceImpl extends BaseService implements DmpP ...@@ -311,6 +317,12 @@ public class DmpProjectConfigInfoServiceImpl extends BaseService implements DmpP
List<DmpProjectConfigEngine> dmpProjConfigEngines = dmpProjectConfigInfo.getDmpProjectConfigEngines(); List<DmpProjectConfigEngine> dmpProjConfigEngines = dmpProjectConfigInfo.getDmpProjectConfigEngines();
//设置configId(项目配置信息主键)
dmpProjConfigEngines = dmpProjConfigEngines.stream().map(x->{
x.setConfigId(dmpProjectConfigInfo.getProjectConfigId());
return x;
}).collect(Collectors.toList());
//新增 //新增
List<DmpProjectConfigEngine> dmpProjConfigEnginesNew = dmpProjConfigEngines.stream() List<DmpProjectConfigEngine> dmpProjConfigEnginesNew = dmpProjConfigEngines.stream()
.filter(x->{ .filter(x->{
...@@ -321,6 +333,7 @@ public class DmpProjectConfigInfoServiceImpl extends BaseService implements DmpP ...@@ -321,6 +333,7 @@ public class DmpProjectConfigInfoServiceImpl extends BaseService implements DmpP
}).map(y->{ }).map(y->{
y.setCreateUserId(getHttpRequestUserId(httpRequest)); y.setCreateUserId(getHttpRequestUserId(httpRequest));
y.setCreateTime(new Date()); y.setCreateTime(new Date());
y.setDataStatus("1");
return y; return y;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
dmpProjectConfigEngineMapper.insertBatch(dmpProjConfigEnginesNew); dmpProjectConfigEngineMapper.insertBatch(dmpProjConfigEnginesNew);
...@@ -360,9 +373,16 @@ public class DmpProjectConfigInfoServiceImpl extends BaseService implements DmpP ...@@ -360,9 +373,16 @@ public class DmpProjectConfigInfoServiceImpl extends BaseService implements DmpP
List<DmpProjectEngineParam> dmpProjectEngineParams = dmpProjConfigEngines.stream() List<DmpProjectEngineParam> dmpProjectEngineParams = dmpProjConfigEngines.stream()
.flatMap(x->{ .flatMap(x->{
return x.getDmpProjectEngineParams().stream(); return x.getDmpProjectEngineParams().stream().map(z->{
z.setConfigEngineId(x.getConfigEngineId());
return z;
});
}).map(y->{
y.setCreateUserId(getHttpRequestUserId(httpRequest));
y.setCreateTime(new Date());
y.setDataStatus("1");
return y;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
dmpProjectEngineParamMapper.insertBatch(dmpProjectEngineParams);
//新增 //新增
List<DmpProjectEngineParam> dmpProjectEngineParamsNew = dmpProjectEngineParams.stream() List<DmpProjectEngineParam> dmpProjectEngineParamsNew = dmpProjectEngineParams.stream()
...@@ -703,8 +723,11 @@ public class DmpProjectConfigInfoServiceImpl extends BaseService implements DmpP ...@@ -703,8 +723,11 @@ public class DmpProjectConfigInfoServiceImpl extends BaseService implements DmpP
Map<String, Object> param2 = new HashMap<String, Object>(); Map<String, Object> param2 = new HashMap<String, Object>();
param2.put("configId", dto.getProjectConfigId()); param2.put("configId", dto.getProjectConfigId());
List<DmpProjectConfigEngineDto> dmpProjectConfigEngineDtos = dmpProjectConfigEngineMapper.findList(param2); List<DmpProjectConfigEngineDto> dmpProjectConfigEngineDtos = dmpProjectConfigEngineMapper.findList(param2);
List<DmpProjectConfigEngine> dmpProjectConfigEngines = MyDmpProjectConfigEngineConverter.INSTANCE().dto2domain(dmpProjectConfigEngineDtos); for (DmpProjectConfigEngineDto dmpProjectConfigEngineDto : dmpProjectConfigEngineDtos) {
dto.setDmpProjectConfigEngines(dmpProjectConfigEngines); DmpComputEngineDto dmpComputEngineDto = dmpComputEngineMapper.findById(dmpProjectConfigEngineDto.getEngineId());
dmpProjectConfigEngineDto.setDmpComputEngineDto(dmpComputEngineDto);
}
dto.setDmpProjectConfigEngineDtos(dmpProjectConfigEngineDtos);
baseBeanResponse.setCode(StatuConstant.SUCCESS_CODE); baseBeanResponse.setCode(StatuConstant.SUCCESS_CODE);
baseBeanResponse.setMessage("查询成功"); baseBeanResponse.setMessage("查询成功");
......
...@@ -351,6 +351,14 @@ public class DmpPublicConfigInfoServiceImpl extends BaseService implements DmpPu ...@@ -351,6 +351,14 @@ public class DmpPublicConfigInfoServiceImpl extends BaseService implements DmpPu
} }
List<DmpPublicConfigInfoDto> list = dmpPublicConfigInfoMapper.findList(param); List<DmpPublicConfigInfoDto> list = dmpPublicConfigInfoMapper.findList(param);
if (!CollectionUtils.isEmpty(list)) {
Map<String, Object> param2 = new HashMap<String, Object>();
List<DmpComputEngineDto> dmpComputEngineDtos = dmpComputEngineMapper.findList(param2);
for (DmpPublicConfigInfoDto dmpPublicConfigInfoDto : list) {
dmpPublicConfigInfoDto.setDmpComputEngineDtos(dmpComputEngineDtos);
}
}
baseBeanResponse.setCode(StatuConstant.SUCCESS_CODE); baseBeanResponse.setCode(StatuConstant.SUCCESS_CODE);
baseBeanResponse.setMessage("查询成功"); baseBeanResponse.setMessage("查询成功");
......
...@@ -345,7 +345,7 @@ ...@@ -345,7 +345,7 @@
</select> </select>
<!-- 主键查询计算引擎表 --> <!-- 主键查询计算引擎表 -->
<select id="findById" resultMap="BaseDtoResultMap" parameterType="java.lang.String"> <select id="findById" resultMap="BaseDtoResultMap">
select select
<include refid="BaseDto_Column_List" /> <include refid="BaseDto_Column_List" />
from dmp_comput_engine from dmp_comput_engine
......
...@@ -177,7 +177,7 @@ ...@@ -177,7 +177,7 @@
</insert> </insert>
<!-- 批量新增项目配置计算引擎关系表 --> <!-- 批量新增项目配置计算引擎关系表 -->
<insert id="insertBatch" parameterType="com.jz.dmp.modules.model.DmpProjectConfigEngine"> <insert id="insertBatch" parameterType="com.jz.dmp.modules.model.DmpProjectConfigEngine" useGeneratedKeys="true" keyProperty="configEngineId">
insert into dmp_project_config_engine ( insert into dmp_project_config_engine (
config_engine_id, config_id, engine_id, remark, data_status, config_engine_id, config_id, engine_id, remark, data_status,
create_user_id, create_time, update_user_id, update_time create_user_id, create_time, update_user_id, update_time
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment