add(实验请求): 后端添加实验结果相关功能

- 在 ExperimentRequest模型中添加 experimentResult 字段
- 在控制器中添加编辑实验结果的路由
- 更新数据库映射文件,支持 experiment_result 列的读写
- 在ExperimentRequestRelationServiceImpl服务实现中添加对实验结果的处理逻辑
master
zch 1 month ago
parent db430b960c
commit 0e11b6f79a

@ -208,4 +208,14 @@ public class ExperimentRequestController extends BaseController
return prefix + "/editTools";
}
@GetMapping("/editResult/{objid}")
public String editResult(@PathVariable("objid") Long objid, ModelMap mmap)
{
ExperimentRequest experimentRequest = experimentRequestService.selectExperimentRequestById(objid);
experimentRequest.setStatus(5L);
mmap.put("experimentRequest", experimentRequest);
return prefix +"/editResult";
}
}

@ -65,6 +65,10 @@ public class ExperimentRequest extends BaseEntity
@Excel(name = "实验请求状态")
private Long status;
/** 实验结果 */
@Excel(name = "实验结果")
private String experimentResult;
public void setObjid(Long objid)
{
this.objid = objid;
@ -183,6 +187,14 @@ public class ExperimentRequest extends BaseEntity
return status;
}
public String getExperimentResult() {
return experimentResult;
}
public void setExperimentResult(String experimentResult) {
this.experimentResult = experimentResult;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@ -203,6 +215,7 @@ public class ExperimentRequest extends BaseEntity
.append("preparationTools", getPreparationTools())
.append("communicationContent", getCommunicationContent())
.append("status", getStatus())
.append("experimentResult", getExperimentResult())
.toString();
}
}

@ -65,6 +65,8 @@ public class ExperimentRequestRelationServiceImpl implements IExperimentRequestR
requestRelation.setContent(experimentRequest.getPreparationTools());
}else if (requestRelation.getStatus() == 4L){
requestRelation.setContent(experimentRequest.getCommunicationContent());
}else if (requestRelation.getStatus() == 5L){
requestRelation.setContent(experimentRequest.getExperimentResult());
}
}

@ -22,10 +22,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="preparationTools" column="preparation_tools" />
<result property="communicationContent" column="communication_content" />
<result property="status" column="status" />
<result property="experimentResult" column="experiment_result" />
</resultMap>
<sql id="selectExperimentRequestVo">
select objid, customer_name, project_name, creation_time, execution_time, device_name, experiment_desc, create_by, create_time, update_by, update_time, process_id, device2_name, experiment_content, preparation_tools, communication_content, status from experiment_request
select objid, customer_name, project_name, creation_time, execution_time, device_name, experiment_desc, create_by, create_time, update_by, update_time, process_id, device2_name, experiment_content, preparation_tools, communication_content,
status ,
experiment_result
from experiment_request
</sql>
<select id="selectExperimentRequestList" parameterType="ExperimentRequest" resultMap="ExperimentRequestResult">
@ -37,6 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="executionTime != null "> and execution_time = #{executionTime}</if>
<if test="deviceName != null and deviceName != ''"> and device_name like ('%' + #{deviceName} + '%')</if>
<if test="status != null "> and status = #{status}</if>
<if test="experimentResult != null"> and experiment_result = #{experimentResult} </if>
</where>
</select>
@ -65,6 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="preparationTools != null">preparation_tools,</if>
<if test="communicationContent != null">communication_content,</if>
<if test="status != null">status,</if>
<if test="experimentResult != null">experiment_result,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="objid != null">#{objid},</if>
@ -84,6 +90,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="preparationTools != null">#{preparationTools},</if>
<if test="communicationContent != null">#{communicationContent},</if>
<if test="status != null">#{status},</if>
<if test="experimentResult != null">#{experimentResult},</if>
</trim>
</insert>
@ -106,6 +113,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="preparationTools != null">preparation_tools = #{preparationTools},</if>
<if test="communicationContent != null">communication_content = #{communicationContent},</if>
<if test="status != null">status = #{status},</if>
<if test="experimentResult != null">experiment_result = #{experimentResult}</if>
</trim>
where objid = #{objid}
</update>

Loading…
Cancel
Save