update
This commit is contained in:
@@ -24,7 +24,6 @@ import org.jeecg.modules.database.service.*;
|
||||
import org.jeecg.modules.system.entity.SysUser;
|
||||
import org.jeecg.modules.system.service.ISysUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import java.util.*;
|
||||
@@ -186,7 +185,7 @@ public class ExperimentController extends JeecgController<Experiment, IExperimen
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody Experiment experiment, HttpServletRequest request) {
|
||||
Experiment dbExp = experimentService.getById(experiment.getId());
|
||||
if (StringUtils.containsAny(dbExp.getStatus(), ExperimentStatus.COMPLETED, ExperimentStatus.REPORT_AUDITING)) {
|
||||
if (StringUtils.containsAny(dbExp.getStatus(), ExperimentStatus.COMPLETED)) {
|
||||
return Result.error("试验状态:[" + dbExp.getStatus() + "]不能进行修改!");
|
||||
}
|
||||
if (StringUtils.equals(dbExp.getStatus(), ExperimentStatus.STAGING)) {
|
||||
|
||||
@@ -25,7 +25,6 @@ import org.jeecg.modules.database.service.*;
|
||||
import org.jeecg.modules.system.entity.SysUser;
|
||||
import org.jeecg.modules.system.service.ISysUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import java.util.*;
|
||||
@@ -220,7 +219,7 @@ public class ExperimentReportController extends JeecgController<ExperimentReport
|
||||
* @param request
|
||||
* @param experimentReport
|
||||
*/
|
||||
|
||||
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, ExperimentReport experimentReport) {
|
||||
return super.exportXls(request, experimentReport, ExperimentReport.class, "试验报告");
|
||||
@@ -319,8 +318,8 @@ public class ExperimentReportController extends JeecgController<ExperimentReport
|
||||
if (oConvertUtils.isEmpty(username)) {
|
||||
return Result.error("用户未登录!");
|
||||
}
|
||||
String createBy = experimentReport.getCreateBy();
|
||||
if (!StringUtils.equals(createBy, username)) {
|
||||
Experiment experiment = experimentService.getById(experimentReport.getExperimentId());
|
||||
if (!StringUtils.equals(experimentReport.getCreateBy(), username) || !StringUtils.equals(experiment.getCreateBy(), username)) {
|
||||
return Result.error("您无权进行撤回!");
|
||||
}
|
||||
ExperimentReport report = experimentReportService.getById(experimentReport.getId());
|
||||
|
||||
@@ -271,6 +271,13 @@ public class ExperimentDocServiceImpl extends ServiceImpl<ExperimentDocMapper, E
|
||||
return StringUtils.contains(date, " ") ? StringUtils.substringBefore(date, " ") : date;
|
||||
}
|
||||
|
||||
private static String formatDate(Date date) {
|
||||
if (Objects.isNull(date)) {
|
||||
return "";
|
||||
}
|
||||
return DateUtils.formatDate(date, "yyyy-MM-dd");
|
||||
}
|
||||
|
||||
private Map<String, Object> assembleSybg(String experimentId) {
|
||||
Experiment experiment = experimentService.getById(experimentId);
|
||||
experimentService.fetchExperimentDetail(experiment);
|
||||
@@ -286,6 +293,7 @@ public class ExperimentDocServiceImpl extends ServiceImpl<ExperimentDocMapper, E
|
||||
.orElse(""));
|
||||
params.put("批准人员姓名", Optional.ofNullable(sysUserService.getById(latestReport.getConfirmer())).map(SysUser::getRealname)
|
||||
.orElse(""));
|
||||
params.put("报告生成日期", formatDate(latestReport.getCreateTime()));
|
||||
}
|
||||
params.put("试验报告名称", experiment.getName());
|
||||
params.put("试验编号", experiment.getExperimentNo());
|
||||
@@ -326,7 +334,7 @@ public class ExperimentDocServiceImpl extends ServiceImpl<ExperimentDocMapper, E
|
||||
}
|
||||
}
|
||||
|
||||
params.put("试验日期", experiment.getStartDate() + " ~ " + experiment.getEndDate());
|
||||
params.put("试验日期", formatDate(experiment.getStartDate()) + " ~ " + formatDate(experiment.getEndDate()));
|
||||
params.put("负责人名称", experiment.getSupervisorName());
|
||||
params.put("剂量管理员名称", "");
|
||||
String operatorName = experiment.getExperimentUserList().stream().map(v -> v.getUserName()).collect(Collectors.joining(","));
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user