Commit b758e1f1 authored by sml's avatar sml

代码提交

parent 2d72b7b0
package com.jz.dmp.modules.controller.projconfig.bean;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.jz.dmp.modules.model.DmpProjectConfigEngine;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**项目配置计算引擎关系表Dto
* @author ybz
*
*/
@ApiModel(value = "项目配置计算引擎关系表Dto", description = "项目配置计算引擎关系表Dto")
@JsonIgnoreProperties(value = {"handler"})
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;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.jz.dmp.modules.model.DmpProjectConfigEngine;
import com.jz.dmp.modules.model.DmpProjectConfigInfo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......@@ -25,6 +28,9 @@ public class DmpProjectConfigInfoDto extends DmpProjectConfigInfo {
*/
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "选择的计算引擎")
private List<DmpProjectConfigEngineDto> dmpProjectConfigEngineDtos;
@ApiModelProperty(value = "公共配置")
private DmpPublicConfigInfoDto dmpPublicConfigInfoDto;
......@@ -35,4 +41,13 @@ public class DmpProjectConfigInfoDto extends DmpProjectConfigInfo {
public void setDmpPublicConfigInfoDto(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;
import org.springframework.beans.BeanUtils;
import com.jz.dmp.modules.model.DmpComputEngine;
import com.jz.dmp.modules.model.DmpComputEngineParam;
public class MyDmpComputEngineConverter {
......
......@@ -79,6 +79,9 @@ public class DmpProjectConfigEngine implements Serializable{
@ApiModelProperty(value = "选择引擎私有配置参数")
private List<DmpProjectEngineParam> dmpProjectEngineParams;
@ApiModelProperty(value = "选择的引擎")
private DmpComputEngine dmpComputEngine;
public Integer getConfigEngineId() {
return configEngineId;
}
......@@ -159,4 +162,12 @@ public class DmpProjectConfigEngine implements Serializable{
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;
import com.jz.common.constant.StatuConstant;
import com.jz.common.persistence.BaseService;
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.DmpProjectConfigEngineRequest;
import com.jz.dmp.modules.controller.projconfig.bean.DmpProjectConfigInfoBatch;
......@@ -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.DmpPublicConfigInfoRequest;
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.DmpProjectConfigInfoMapper;
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.DmpProjectConfigInfo;
import com.jz.dmp.modules.model.DmpProjectEngineParam;
......@@ -64,6 +67,9 @@ public class DmpProjectConfigInfoServiceImpl extends BaseService implements DmpP
@Autowired
private DmpPublicConfigInfoService dmpPublicConfigInfoService;
@Autowired
private DmpComputEngineMapper dmpComputEngineMapper;
/*
* (non-Javadoc)
*
......@@ -311,6 +317,12 @@ public class DmpProjectConfigInfoServiceImpl extends BaseService implements DmpP
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()
.filter(x->{
......@@ -321,6 +333,7 @@ public class DmpProjectConfigInfoServiceImpl extends BaseService implements DmpP
}).map(y->{
y.setCreateUserId(getHttpRequestUserId(httpRequest));
y.setCreateTime(new Date());
y.setDataStatus("1");
return y;
}).collect(Collectors.toList());
dmpProjectConfigEngineMapper.insertBatch(dmpProjConfigEnginesNew);
......@@ -360,9 +373,16 @@ public class DmpProjectConfigInfoServiceImpl extends BaseService implements DmpP
List<DmpProjectEngineParam> dmpProjectEngineParams = dmpProjConfigEngines.stream()
.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());
dmpProjectEngineParamMapper.insertBatch(dmpProjectEngineParams);
//新增
List<DmpProjectEngineParam> dmpProjectEngineParamsNew = dmpProjectEngineParams.stream()
......@@ -703,8 +723,11 @@ public class DmpProjectConfigInfoServiceImpl extends BaseService implements DmpP
Map<String, Object> param2 = new HashMap<String, Object>();
param2.put("configId", dto.getProjectConfigId());
List<DmpProjectConfigEngineDto> dmpProjectConfigEngineDtos = dmpProjectConfigEngineMapper.findList(param2);
List<DmpProjectConfigEngine> dmpProjectConfigEngines = MyDmpProjectConfigEngineConverter.INSTANCE().dto2domain(dmpProjectConfigEngineDtos);
dto.setDmpProjectConfigEngines(dmpProjectConfigEngines);
for (DmpProjectConfigEngineDto dmpProjectConfigEngineDto : dmpProjectConfigEngineDtos) {
DmpComputEngineDto dmpComputEngineDto = dmpComputEngineMapper.findById(dmpProjectConfigEngineDto.getEngineId());
dmpProjectConfigEngineDto.setDmpComputEngineDto(dmpComputEngineDto);
}
dto.setDmpProjectConfigEngineDtos(dmpProjectConfigEngineDtos);
baseBeanResponse.setCode(StatuConstant.SUCCESS_CODE);
baseBeanResponse.setMessage("查询成功");
......
......@@ -351,6 +351,14 @@ public class DmpPublicConfigInfoServiceImpl extends BaseService implements DmpPu
}
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.setMessage("查询成功");
......
......@@ -345,7 +345,7 @@
</select>
<!-- 主键查询计算引擎表 -->
<select id="findById" resultMap="BaseDtoResultMap" parameterType="java.lang.String">
<select id="findById" resultMap="BaseDtoResultMap">
select
<include refid="BaseDto_Column_List" />
from dmp_comput_engine
......
......@@ -177,7 +177,7 @@
</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 (
config_engine_id, config_id, engine_id, remark, data_status,
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