update
This commit is contained in:
@@ -65,4 +65,11 @@ CHANGE `annealing_duration` `annealing_duration` text CHARACTER SET utf8mb4 COLL
|
||||
|
||||
ALTER TABLE `local_database`
|
||||
ADD COLUMN `sample_model` varchar(2048) NULL COMMENT '样品型号' ;
|
||||
|
||||
```
|
||||
|
||||
#20250503
|
||||
```sql
|
||||
ALTER TABLE `physical-boot`.`experiment_report`
|
||||
ADD COLUMN `last_status` varchar(32) NULL COMMENT '上一个状态' AFTER `confirmer`;
|
||||
```
|
||||
@@ -170,7 +170,7 @@ spring:
|
||||
# url: jdbc:mysql://127.0.0.1:3306/physical-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||
url: jdbc:mysql://47.102.126.67:23306/physical-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: 123456
|
||||
password: urwTocIA1f395t
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
# 多数据源配置
|
||||
#multi-datasource1:
|
||||
|
||||
@@ -185,8 +185,8 @@ public class ExperimentController extends JeecgController<Experiment, IExperimen
|
||||
}
|
||||
if (StringUtils.isNotBlank(experiment.getId())) {
|
||||
Experiment dbExp = experimentService.getById(experiment.getId());
|
||||
if (!StringUtils.equals(dbExp.getStatus(), ExperimentStatus.STAGING) || !StringUtils.equals(dbExp.getStatus(),
|
||||
ExperimentStatus.PRE_TEST)) {
|
||||
if (!(StringUtils.equals(dbExp.getStatus(), ExperimentStatus.STAGING) || StringUtils.equals(dbExp.getStatus(),
|
||||
ExperimentStatus.PRE_TEST))) {
|
||||
return Result.error("实验状态不正确!");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,8 @@ import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.system.util.JwtUtil;
|
||||
import org.jeecg.common.util.DateUtils;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.database.constant.*;
|
||||
import org.jeecg.modules.database.constant.ExperimentDocType;
|
||||
import org.jeecg.modules.database.constant.ExperimentReportStatus;
|
||||
import org.jeecg.modules.database.entity.*;
|
||||
import org.jeecg.modules.database.service.*;
|
||||
import org.jeecg.modules.system.entity.SysUser;
|
||||
@@ -106,9 +107,9 @@ public class ExperimentReportController extends JeecgController<ExperimentReport
|
||||
if (ObjUtil.isNull(experiment)) {
|
||||
return Result.error("试验数据不存在!");
|
||||
}
|
||||
if (!StringUtils.equals(experiment.getStatus(), ExperimentStatus.COMPLETED)) {
|
||||
return Result.error("试验状态不正确,请先完成试验!");
|
||||
}
|
||||
//if (!StringUtils.equals(experiment.getStatus(), ExperimentStatus.COMPLETED)) {
|
||||
// return Result.error("试验状态不正确,请先完成试验!");
|
||||
//}
|
||||
//ExperimentReport report = experimentReportService.getByExperimentId(experimentId);
|
||||
//if (ObjUtil.isNotNull(report)) {
|
||||
// return Result.error("试验报告已存在!");
|
||||
@@ -129,7 +130,7 @@ public class ExperimentReportController extends JeecgController<ExperimentReport
|
||||
@RequiresPermissions("database:experiment_report:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody ExperimentReport experimentReport, HttpServletRequest request) {
|
||||
String username = JwtUtil.getUserNameByToken(request);
|
||||
//String username = JwtUtil.getUserNameByToken(request);
|
||||
ExperimentReport report = experimentReportService.getById(experimentReport.getId());
|
||||
//if (!StringUtils.equals(report.getCreateBy(), username)) {
|
||||
// return Result.error("您无权进行编辑!");
|
||||
@@ -138,6 +139,9 @@ public class ExperimentReportController extends JeecgController<ExperimentReport
|
||||
if (!(StringUtils.equals(report.getStatus(), "INIT") || StringUtils.equals(report.getStatus(), "REJECT"))) {
|
||||
return Result.error("该报告状态无法进行编辑!");
|
||||
}
|
||||
if (StringUtils.equals(report.getStatus(), "REJECT") && StringUtils.isNotBlank(experimentReport.getLastStatus())) {
|
||||
experimentReport.setStatus(experimentReport.getLastStatus());
|
||||
}
|
||||
experimentReportService.updateById(experimentReport);
|
||||
experimentDocService.generate(report.getExperimentId(), ExperimentDocType.sybg.getType());
|
||||
return Result.OK("编辑成功!");
|
||||
@@ -269,6 +273,7 @@ public class ExperimentReportController extends JeecgController<ExperimentReport
|
||||
}
|
||||
if (!StringUtils.equals(requestStatus, ExperimentReportStatus.PROOFREAD_PASS)) {
|
||||
report.setStatus(ExperimentReportStatus.REJECT);
|
||||
report.setLastStatus(ExperimentReportStatus.INIT);
|
||||
}
|
||||
report.setProofreaderMemo(experimentReport.getMemo());
|
||||
report.setProofreaderTime(DateUtils.formatDate(new Date(), "yyyy-MM-dd HH:mm"));
|
||||
@@ -281,6 +286,8 @@ public class ExperimentReportController extends JeecgController<ExperimentReport
|
||||
}
|
||||
if (!StringUtils.equals(requestStatus, ExperimentReportStatus.AUDIT_PASS)) {
|
||||
report.setStatus(ExperimentReportStatus.REJECT);
|
||||
report.setLastStatus(ExperimentReportStatus.PROOFREAD_PASS);
|
||||
|
||||
}
|
||||
report.setAuditorMemo(experimentReport.getMemo());
|
||||
report.setAuditorTime(DateUtils.formatDate(new Date(), "yyyy-MM-dd HH:mm"));
|
||||
@@ -294,6 +301,7 @@ public class ExperimentReportController extends JeecgController<ExperimentReport
|
||||
}
|
||||
if (!StringUtils.equals(requestStatus, ExperimentReportStatus.PASSED)) {
|
||||
report.setStatus(ExperimentReportStatus.REJECT);
|
||||
report.setLastStatus(ExperimentReportStatus.AUDIT_PASS);
|
||||
}
|
||||
report.setConfirmerMemo(experimentReport.getMemo());
|
||||
report.setConfirmerTime(DateUtils.formatDate(new Date(), "yyyy-MM-dd HH:mm"));
|
||||
|
||||
@@ -99,6 +99,11 @@ public class ExperimentReport implements Serializable {
|
||||
"状态(申请中待校对:INIT,不合格:REJECT ,校对通过待审核:PROOFREAD_PASS,审核通过待批准:AUDIT_PASS,批准通过:PASSED)")
|
||||
private String status;
|
||||
|
||||
@Excel(name = "上一个状态", width = 15)
|
||||
@Schema(description ="上一个状态")
|
||||
private String lastStatus;
|
||||
|
||||
|
||||
@Excel(name = "审批意见", width = 15)
|
||||
@Schema(description = "审批意见")
|
||||
private String auditorMemo;
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
left join experiment_report r on r.experiment_id = e.id
|
||||
<where>
|
||||
( e.supervisor=#{loginUser.id} or e.create_by=#{loginUser.username}
|
||||
or r.auditor=#{loginUser.id} or r.proofreader=#{loginUser.id}
|
||||
or r.confirmer=#{loginUser.id} )
|
||||
or (r.auditor=#{loginUser.id} and r.status='PROOFREAD_PASS') or (r.proofreader=#{loginUser.id} and r.status='INIT')
|
||||
or (r.confirmer=#{loginUser.id} and r.status='AUDIT_PASS' ))
|
||||
<if test="experiment.name != null and experiment.name != ''">
|
||||
and e.name like concat('%', #{experiment.name}, '%')
|
||||
</if>
|
||||
@@ -48,7 +48,7 @@
|
||||
</if>
|
||||
<if test="experiment.statusList != null and experiment.statusList != ''">
|
||||
and e.status in
|
||||
<foreach item="item" collection="experiment.statusList" index="index" open="(" separator="," close=")">
|
||||
<foreach item="item" collection="experiment.statusList" index="index" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
Reference in New Issue
Block a user