Commit c65a927d authored by 宋源硕's avatar 宋源硕

Merge branch 'songyuanshuo' into 'dev'

2024/11/14修改方法

See merge request !461
parents ae641b9f 94ddf347
......@@ -79,7 +79,7 @@ public class ReviewDetailsResult implements Serializable {
* 最后修改时间
*/
@ApiModelProperty("最后修改时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date lastModifyTime;
@ApiModelProperty("文件目录")
......@@ -96,5 +96,9 @@ public class ReviewDetailsResult implements Serializable {
@ApiModelProperty("文件列表")
List<ReviewEnterpriseArchiveFileVO> fileList;
@ApiModelProperty("符合项备注")
private String successRemark;
@ApiModelProperty("不符合项备注")
private String failRemark;
}
......@@ -36,6 +36,11 @@ public interface ReviewDetailsResultMapper extends BaseMapper<ReviewDetailsResul
List<ReviewDetailsResult> findByDetailsId(@Param("detailsId") Long detailsId);
List<UserNameResponse> findByResultList(@Param("resultList") List<ReviewDetailsResult> resultList);
/*
* 根据id修改
* */
void updateByIdNew(ReviewDetailsResult result);
}
......
......@@ -56,12 +56,28 @@ public class ReviewDetailsResultServiceImpl extends ServiceImpl<ReviewDetailsRes
result.setPassed(request.getPassed());
result.setUserId(loginUser.getUserId());
result.setUserName(loginUser.getNickName());
result.setLastModifyTime(new Date());
//result.setLastModifyTime(new Date());
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);
this.baseMapper.updateById(result);
reviewDetailsResultMapper.updateByIdNew(result);
//mybatis-plus的update方法有null值的话那个字段不会修改这里自己写了一个update
//this.baseMapper.updateById(result);
SaveFileRelation(result.getId(),request);
} else {
......@@ -72,9 +88,20 @@ public class ReviewDetailsResultServiceImpl extends ServiceImpl<ReviewDetailsRes
reviewDetailsResult.setPassed(request.getPassed());
reviewDetailsResult.setUserId(loginUser.getUserId());
reviewDetailsResult.setUserName(loginUser.getNickName());
reviewDetailsResult.setLastModifyTime(new Date());
reviewDetailsResult.setLastModifyTime(request.getUpdateTime());
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);
this.baseMapper.insert(reviewDetailsResult);
......
package com.ruoyi.web.request;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.domain.vo.ReviewEnterpriseArchiveFileVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
@ApiModel(value = "ReviewDetailsResultSaveRequest", description = "保存审查细则的审查结果")
......@@ -34,4 +36,12 @@ public class ReviewDetailsResultSaveRequest {
@ApiModelProperty("关联文件列表")
List<ReviewEnterpriseArchiveFileVO> fileList;
@ApiModelProperty("符合项备注")
private String successRemark;
@ApiModelProperty("不符合项备注")
private String failRemark;
@ApiModelProperty("修改时间")
private Date updateTime;
}
......@@ -25,8 +25,15 @@
scene,imagesUrl,review_details_id,
task_id from t_review_details_result
</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, 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 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