Commit 94ddf347 authored by yuanshuo's avatar yuanshuo

2024/11/14修改方法

1.修改体系审查和车型审查的getById方法返回的响应实体类,将lastModifyTime返回格式精确到日,并添加两个字段successRemark和failRemark。
2.修改/review/details/result/save的请求参数,lastModifyTime、successRemark,failRemark字段的获取方式。
parent baf471a4
...@@ -79,7 +79,7 @@ public class ReviewDetailsResult implements Serializable { ...@@ -79,7 +79,7 @@ public class ReviewDetailsResult implements Serializable {
* 最后修改时间 * 最后修改时间
*/ */
@ApiModelProperty("最后修改时间") @ApiModelProperty("最后修改时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm") @JsonFormat(pattern = "yyyy-MM-dd")
private Date lastModifyTime; private Date lastModifyTime;
@ApiModelProperty("文件目录") @ApiModelProperty("文件目录")
...@@ -96,5 +96,9 @@ public class ReviewDetailsResult implements Serializable { ...@@ -96,5 +96,9 @@ public class ReviewDetailsResult implements Serializable {
@ApiModelProperty("文件列表") @ApiModelProperty("文件列表")
List<ReviewEnterpriseArchiveFileVO> fileList; List<ReviewEnterpriseArchiveFileVO> fileList;
@ApiModelProperty("符合项备注")
private String successRemark;
@ApiModelProperty("不符合项备注")
private String failRemark;
} }
...@@ -36,6 +36,11 @@ public interface ReviewDetailsResultMapper extends BaseMapper<ReviewDetailsResul ...@@ -36,6 +36,11 @@ public interface ReviewDetailsResultMapper extends BaseMapper<ReviewDetailsResul
List<ReviewDetailsResult> findByDetailsId(@Param("detailsId") Long detailsId); List<ReviewDetailsResult> findByDetailsId(@Param("detailsId") Long detailsId);
List<UserNameResponse> findByResultList(@Param("resultList") List<ReviewDetailsResult> resultList); List<UserNameResponse> findByResultList(@Param("resultList") List<ReviewDetailsResult> resultList);
/*
* 根据id修改
* */
void updateByIdNew(ReviewDetailsResult result);
} }
......
...@@ -56,12 +56,28 @@ public class ReviewDetailsResultServiceImpl extends ServiceImpl<ReviewDetailsRes ...@@ -56,12 +56,28 @@ public class ReviewDetailsResultServiceImpl extends ServiceImpl<ReviewDetailsRes
result.setPassed(request.getPassed()); result.setPassed(request.getPassed());
result.setUserId(loginUser.getUserId()); result.setUserId(loginUser.getUserId());
result.setUserName(loginUser.getNickName()); result.setUserName(loginUser.getNickName());
result.setLastModifyTime(new Date()); //result.setLastModifyTime(new Date());
result.setComment(request.getComment()); result.setComment(request.getComment());
/*if (request.getPassed() == 1){
result.setSuccessRemark(request.getSuccessRemark());
}else if(request.getPassed() == 0){
result.setFailRemark(request.getFailRemark());
}*/
if (request.getSuccessRemark() != null){
result.setSuccessRemark(request.getSuccessRemark());
}
if (request.getFailRemark() != null){
result.setFailRemark(request.getFailRemark());
}
//这里单独加了一个时间,如果用户想要修改时间,那么前端就会传来一个updateTime字段 如果不为null那么就设置时间然后修改数据库
if (request.getUpdateTime()!=null){
result.setLastModifyTime(request.getUpdateTime());
}
Save(result,request); Save(result,request);
this.baseMapper.updateById(result); reviewDetailsResultMapper.updateByIdNew(result);
//mybatis-plus的update方法有null值的话那个字段不会修改这里自己写了一个update
//this.baseMapper.updateById(result);
SaveFileRelation(result.getId(),request); SaveFileRelation(result.getId(),request);
} else { } else {
...@@ -72,9 +88,20 @@ public class ReviewDetailsResultServiceImpl extends ServiceImpl<ReviewDetailsRes ...@@ -72,9 +88,20 @@ public class ReviewDetailsResultServiceImpl extends ServiceImpl<ReviewDetailsRes
reviewDetailsResult.setPassed(request.getPassed()); reviewDetailsResult.setPassed(request.getPassed());
reviewDetailsResult.setUserId(loginUser.getUserId()); reviewDetailsResult.setUserId(loginUser.getUserId());
reviewDetailsResult.setUserName(loginUser.getNickName()); reviewDetailsResult.setUserName(loginUser.getNickName());
reviewDetailsResult.setLastModifyTime(new Date()); reviewDetailsResult.setLastModifyTime(request.getUpdateTime());
reviewDetailsResult.setComment(request.getComment()); reviewDetailsResult.setComment(request.getComment());
/*if (request.getPassed() == 1){
reviewDetailsResult.setSuccessRemark(request.getSuccessRemark());
}else if(request.getPassed() == 0){
reviewDetailsResult.setFailRemark(request.getFailRemark());
}*/
if (request.getSuccessRemark() != null){
reviewDetailsResult.setSuccessRemark(request.getSuccessRemark());
}
if (request.getFailRemark() != null){
reviewDetailsResult.setFailRemark(request.getFailRemark());
}
Save(reviewDetailsResult,request); Save(reviewDetailsResult,request);
this.baseMapper.insert(reviewDetailsResult); this.baseMapper.insert(reviewDetailsResult);
......
package com.ruoyi.web.request; package com.ruoyi.web.request;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.domain.vo.ReviewEnterpriseArchiveFileVO; import com.ruoyi.domain.vo.ReviewEnterpriseArchiveFileVO;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.Date;
import java.util.List; import java.util.List;
@ApiModel(value = "ReviewDetailsResultSaveRequest", description = "保存审查细则的审查结果") @ApiModel(value = "ReviewDetailsResultSaveRequest", description = "保存审查细则的审查结果")
...@@ -34,4 +36,12 @@ public class ReviewDetailsResultSaveRequest { ...@@ -34,4 +36,12 @@ public class ReviewDetailsResultSaveRequest {
@ApiModelProperty("关联文件列表") @ApiModelProperty("关联文件列表")
List<ReviewEnterpriseArchiveFileVO> fileList; List<ReviewEnterpriseArchiveFileVO> fileList;
@ApiModelProperty("符合项备注")
private String successRemark;
@ApiModelProperty("不符合项备注")
private String failRemark;
@ApiModelProperty("修改时间")
private Date updateTime;
} }
...@@ -25,8 +25,15 @@ ...@@ -25,8 +25,15 @@
scene,imagesUrl,review_details_id, scene,imagesUrl,review_details_id,
task_id from t_review_details_result task_id from t_review_details_result
</sql> </sql>
<update id="updateByIdNew">
update t_review_details_result set passed=#{passed},comment=#{comment},images_url=#{imagesUrl},
user_id=#{userId},user_name=#{userName},last_modify_time = #{lastModifyTime},
catalogue=#{catalogue},review_enterprise_archive_id=#{reviewEnterpriseArchiveId},
file_name=#{fileName},success_remark=#{successRemark},fail_remark=#{failRemark}
where id=#{id}
</update>
<select id="findByTaskId" resultType="com.ruoyi.domain.ReviewDetailsResult"> <select id="findByTaskId" resultType="com.ruoyi.domain.ReviewDetailsResult">
SELECT id, passed, comment, images_url, review_details_id, task_id, user_id, user_name, last_modify_time, catalogue, review_enterprise_archive_id, file_name FROM t_review_details_result WHERE task_id = #{taskId} SELECT id, passed, comment, images_url, review_details_id, task_id, user_id, user_name, last_modify_time, catalogue, review_enterprise_archive_id, file_name,success_remark,fail_remark FROM t_review_details_result WHERE task_id = #{taskId}
</select> </select>
<select id="findByTaskIdAndDetailsId" resultType="com.ruoyi.domain.ReviewDetailsResult"> <select id="findByTaskIdAndDetailsId" resultType="com.ruoyi.domain.ReviewDetailsResult">
......
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