|
|
|
@ -1,6 +1,7 @@ |
|
|
|
|
package digital.laboratory.platform.reagent.controller; |
|
|
|
|
|
|
|
|
|
import cn.hutool.core.date.DateTime; |
|
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
|
|
|
@ -10,12 +11,14 @@ import com.fasterxml.jackson.annotation.JsonFormat; |
|
|
|
|
import digital.laboratory.platform.common.core.util.R; |
|
|
|
|
import digital.laboratory.platform.common.log.annotation.SysLog; |
|
|
|
|
import digital.laboratory.platform.common.mybatis.security.service.DLPUser; |
|
|
|
|
import digital.laboratory.platform.common.oss.service.OssFile; |
|
|
|
|
import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO; |
|
|
|
|
import digital.laboratory.platform.reagent.dto.StandardMaterialApprovalFormDTO; |
|
|
|
|
import digital.laboratory.platform.reagent.entity.ReferenceMaterial; |
|
|
|
|
import digital.laboratory.platform.reagent.entity.StandardMaterialApprovalForm; |
|
|
|
|
import digital.laboratory.platform.reagent.service.ReferenceMaterialService; |
|
|
|
|
import digital.laboratory.platform.reagent.service.StandardMaterialApprovalFormService; |
|
|
|
|
import digital.laboratory.platform.reagent.vo.PeriodVerificationImplementationVO; |
|
|
|
|
import digital.laboratory.platform.reagent.vo.StandardMaterialApprovalFormVO; |
|
|
|
|
import org.springframework.format.annotation.DateTimeFormat; |
|
|
|
|
import org.springframework.security.access.prepost.PreAuthorize; |
|
|
|
@ -29,190 +32,222 @@ import javax.servlet.http.HttpServletRequest; |
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
|
import java.io.IOException; |
|
|
|
|
import java.security.Principal; |
|
|
|
|
import java.time.LocalDate; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* (标准物质停用/报废销毁/恢复/降级使用审批表) |
|
|
|
|
* |
|
|
|
|
* @author Zhang Xiaolong created at 2023-03-10 |
|
|
|
|
* @describe (标准物质停用/报废销毁/恢复/降级使用审批表) 前端控制器 |
|
|
|
|
* |
|
|
|
|
* @describe (标准物质停用 / 报废销毁 / 恢复 / 降级使用审批表) 前端控制器 |
|
|
|
|
* <p> |
|
|
|
|
* 这是与表示层的接口, 不应该接业务逻辑写在这里, 业务逻辑应该写在 service 中 |
|
|
|
|
* 这里写什么: |
|
|
|
|
* 为前端提供数据, 接受前端的数据 |
|
|
|
|
* 为前端提供的数据, 从 service 取得后, 可以做一些适当的加工, 这种加工不是业务层面的, 只能是数据格式上, 为方便前端处理 |
|
|
|
|
* 接受前端的数据, 每一个函数的参数可以先做一些整理后, 再调用 service 中的函数。这里对参数的整理, 应该只是格式上的, 而不能是业务上的 |
|
|
|
|
* 为前端提供数据, 接受前端的数据 |
|
|
|
|
* 为前端提供的数据, 从 service 取得后, 可以做一些适当的加工, 这种加工不是业务层面的, 只能是数据格式上, 为方便前端处理 |
|
|
|
|
* 接受前端的数据, 每一个函数的参数可以先做一些整理后, 再调用 service 中的函数。这里对参数的整理, 应该只是格式上的, 而不能是业务上的 |
|
|
|
|
* 数据层在 mapper 中, 数据层不涉及业务, 只管技术上的 对象<->表 之间的转换 |
|
|
|
|
*/ |
|
|
|
|
@RestController |
|
|
|
|
@RequiredArgsConstructor |
|
|
|
|
@RequestMapping("/standard_material_approval_form" ) |
|
|
|
|
@RequestMapping("/standard_material_approval_form") |
|
|
|
|
@Api(value = "standard_material_approval_form", tags = "(标准物质停用/报废销毁/恢复/降级使用审批表)管理") |
|
|
|
|
public class StandardMaterialApprovalFormController { |
|
|
|
|
|
|
|
|
|
private final StandardMaterialApprovalFormService standardMaterialApprovalFormService; |
|
|
|
|
private final StandardMaterialApprovalFormService standardMaterialApprovalFormService; |
|
|
|
|
|
|
|
|
|
private final ReferenceMaterialService referenceMaterialService; |
|
|
|
|
|
|
|
|
|
private final ReferenceMaterialService referenceMaterialService; |
|
|
|
|
private final OssFile ossFile; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 通过id查询(标准物质停用/报废销毁/恢复/降级使用审批表) |
|
|
|
|
* @param id |
|
|
|
|
* @return R |
|
|
|
|
*/ |
|
|
|
|
@ApiOperation(value = "通过id查询", notes = "通过id查询") |
|
|
|
|
@GetMapping( ) |
|
|
|
|
/** |
|
|
|
|
* 通过id查询(标准物质停用/报废销毁/恢复/降级使用审批表) |
|
|
|
|
* |
|
|
|
|
* @param id |
|
|
|
|
* @return R |
|
|
|
|
*/ |
|
|
|
|
@ApiOperation(value = "通过id查询", notes = "通过id查询") |
|
|
|
|
@GetMapping() |
|
|
|
|
// @PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_get')" )
|
|
|
|
|
public R<StandardMaterialApprovalFormVO> getById(String id, HttpServletRequest theHttpServletRequest) { |
|
|
|
|
Principal principal = theHttpServletRequest.getUserPrincipal(); |
|
|
|
|
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); |
|
|
|
|
public R<StandardMaterialApprovalFormVO> getById(String id, HttpServletRequest theHttpServletRequest) { |
|
|
|
|
Principal principal = theHttpServletRequest.getUserPrincipal(); |
|
|
|
|
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); |
|
|
|
|
|
|
|
|
|
StandardMaterialApprovalFormVO standardMaterialApprovalForm = standardMaterialApprovalFormService.getVO(id); |
|
|
|
|
return R.ok(standardMaterialApprovalForm); |
|
|
|
|
//return R.ok(standardMaterialApprovalFormService.getById(standardMaterialApprovalFormId));
|
|
|
|
|
} |
|
|
|
|
return R.ok(standardMaterialApprovalForm); |
|
|
|
|
//return R.ok(standardMaterialApprovalFormService.getById(standardMaterialApprovalFormId));
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
/** |
|
|
|
|
* 分页查询 |
|
|
|
|
* @param page 分页对象 |
|
|
|
|
* @param referenceMaterialName (标准物质停用/报废销毁/恢复/降级使用审批表) |
|
|
|
|
* |
|
|
|
|
* @param page 分页对象 |
|
|
|
|
* @param referenceMaterialName (标准物质停用/报废销毁/恢复/降级使用审批表) |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@ApiOperation(value = "分页查询", notes = "分页查询") |
|
|
|
|
@GetMapping("/page" ) |
|
|
|
|
@GetMapping("/page") |
|
|
|
|
// @PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_page)" )
|
|
|
|
|
public R<IPage<StandardMaterialApprovalFormVO>> getStandardMaterialApprovalFormPage(Page<StandardMaterialApprovalForm> page, String referenceMaterialName, @JsonFormat(pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd") DateTime startTime, |
|
|
|
|
@DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") DateTime endTime,HttpServletRequest theHttpServletRequest) { |
|
|
|
|
Principal principal = theHttpServletRequest.getUserPrincipal(); |
|
|
|
|
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); |
|
|
|
|
|
|
|
|
|
QueryWrapper<StandardMaterialApprovalForm> standardMaterialApprovalFormQueryWrapper = new QueryWrapper<>(); |
|
|
|
|
|
|
|
|
|
if (referenceMaterialName!=null){ |
|
|
|
|
|
|
|
|
|
standardMaterialApprovalFormQueryWrapper.eq("reference_material_name",referenceMaterialName); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (startTime!=null&&endTime!=null){ |
|
|
|
|
|
|
|
|
|
standardMaterialApprovalFormQueryWrapper.ge("create_time",startTime).le("create_time",endTime); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
IPage<StandardMaterialApprovalFormVO> standardMaterialApprovalFormSList = standardMaterialApprovalFormService.getVOPage(page, standardMaterialApprovalFormQueryWrapper |
|
|
|
|
.orderByDesc("create_time") |
|
|
|
|
); |
|
|
|
|
return R.ok(standardMaterialApprovalFormSList); |
|
|
|
|
public R<IPage<StandardMaterialApprovalFormVO>> getStandardMaterialApprovalFormPage(Page<StandardMaterialApprovalForm> page, String referenceMaterialName, @JsonFormat(pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate startTime, |
|
|
|
|
@DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate endTime, HttpServletRequest theHttpServletRequest) { |
|
|
|
|
Principal principal = theHttpServletRequest.getUserPrincipal(); |
|
|
|
|
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); |
|
|
|
|
|
|
|
|
|
IPage<StandardMaterialApprovalFormVO> standardMaterialApprovalFormSList = standardMaterialApprovalFormService.getVOPage(page, Wrappers.<StandardMaterialApprovalForm>query() |
|
|
|
|
.like(StrUtil.isNotBlank(referenceMaterialName), "reference_material_name", referenceMaterialName) |
|
|
|
|
.ge(startTime != null, "create_time", startTime) |
|
|
|
|
.le(endTime != null, "create_time", endTime) |
|
|
|
|
|
|
|
|
|
); |
|
|
|
|
return R.ok(standardMaterialApprovalFormSList); |
|
|
|
|
// return R.ok(standardMaterialApprovalFormService.page(page, Wrappers.query(standardMaterialApprovalForm)));
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 新增(标准物质停用/报废销毁/恢复/降级使用审批表) |
|
|
|
|
* |
|
|
|
|
* @param standardMaterialApprovalFormDTO (标准物质停用/报废销毁/恢复/降级使用审批表) |
|
|
|
|
* @return R |
|
|
|
|
*/ |
|
|
|
|
@ApiOperation(value = "新增(标准物质停用/报废销毁/恢复/降级使用审批表)", notes = "新增(标准物质停用/报废销毁/恢复/降级使用审批表)") |
|
|
|
|
@SysLog("新增(标准物质停用/报废销毁/恢复/降级使用审批表)" ) |
|
|
|
|
@SysLog("新增(标准物质停用/报废销毁/恢复/降级使用审批表)") |
|
|
|
|
@PostMapping |
|
|
|
|
// @PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_add')" )
|
|
|
|
|
public R<StandardMaterialApprovalForm> postAddObject(@RequestBody StandardMaterialApprovalFormDTO standardMaterialApprovalFormDTO, HttpServletRequest theHttpServletRequest) { |
|
|
|
|
Principal principal = theHttpServletRequest.getUserPrincipal(); |
|
|
|
|
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); |
|
|
|
|
Principal principal = theHttpServletRequest.getUserPrincipal(); |
|
|
|
|
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); |
|
|
|
|
|
|
|
|
|
StandardMaterialApprovalForm standardMaterialApprovalForm = standardMaterialApprovalFormService.commitById(standardMaterialApprovalFormDTO, dlpUser); |
|
|
|
|
|
|
|
|
|
if (standardMaterialApprovalForm != null) { |
|
|
|
|
return R.ok(standardMaterialApprovalForm, "保存成功"); |
|
|
|
|
} else { |
|
|
|
|
return R.failed(standardMaterialApprovalForm, "保存失败"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 一级审核(标准物质停用/报废销毁/恢复/降级使用审批表) |
|
|
|
|
* |
|
|
|
|
* @param auditAndApproveDTO (标准物质停用/报废销毁/恢复/降级使用审批表) |
|
|
|
|
* @return R |
|
|
|
|
*/ |
|
|
|
|
@ApiOperation(value = "一级审核(标准物质停用/报废销毁/恢复/降级使用审批表)", notes = "一级审核(标准物质停用/报废销毁/恢复/降级使用审批表)") |
|
|
|
|
@SysLog("一级审核(标准物质停用/报废销毁/恢复/降级使用审批表)") |
|
|
|
|
@PutMapping("/auditPrimary") |
|
|
|
|
@PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_auditPrimary')") |
|
|
|
|
public R<StandardMaterialApprovalForm> auditPrimary(@RequestBody AuditAndApproveDTO auditAndApproveDTO, HttpServletRequest theHttpServletRequest) { |
|
|
|
|
Principal principal = theHttpServletRequest.getUserPrincipal(); |
|
|
|
|
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); |
|
|
|
|
|
|
|
|
|
StandardMaterialApprovalForm standardMaterialApprovalForm = standardMaterialApprovalFormService.auditPrimary(auditAndApproveDTO, dlpUser); |
|
|
|
|
|
|
|
|
|
if (standardMaterialApprovalForm != null) { |
|
|
|
|
return R.ok(standardMaterialApprovalForm, "审核成功"); |
|
|
|
|
} else { |
|
|
|
|
return R.failed(standardMaterialApprovalForm, "审核失败"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
StandardMaterialApprovalForm standardMaterialApprovalForm = standardMaterialApprovalFormService.commitById(standardMaterialApprovalFormDTO, dlpUser); |
|
|
|
|
/** |
|
|
|
|
* 二级审核(标准物质停用/报废销毁/恢复/降级使用审批表) |
|
|
|
|
* |
|
|
|
|
* @param auditAndApproveDTO (标准物质停用/报废销毁/恢复/降级使用审批表) |
|
|
|
|
* @return R |
|
|
|
|
*/ |
|
|
|
|
@ApiOperation(value = "二级审核(标准物质停用/报废销毁/恢复/降级使用审批表)", notes = "二级审核(标准物质停用/报废销毁/恢复/降级使用审批表)") |
|
|
|
|
@SysLog("一级审核(标准物质停用/报废销毁/恢复/降级使用审批表)") |
|
|
|
|
@PutMapping("/auditSecondary") |
|
|
|
|
@PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_auditSecondary')") |
|
|
|
|
public R<StandardMaterialApprovalForm> auditSecondary(@RequestBody AuditAndApproveDTO auditAndApproveDTO, HttpServletRequest theHttpServletRequest) { |
|
|
|
|
Principal principal = theHttpServletRequest.getUserPrincipal(); |
|
|
|
|
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); |
|
|
|
|
|
|
|
|
|
StandardMaterialApprovalForm standardMaterialApprovalForm = standardMaterialApprovalFormService.auditSecondary(auditAndApproveDTO, dlpUser); |
|
|
|
|
|
|
|
|
|
if (standardMaterialApprovalForm != null) { |
|
|
|
|
return R.ok(standardMaterialApprovalForm, "审核成功"); |
|
|
|
|
} else { |
|
|
|
|
return R.failed(standardMaterialApprovalForm, "审核失败"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (standardMaterialApprovalForm!=null) { |
|
|
|
|
return R.ok(standardMaterialApprovalForm, "保存成功"); |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
return R.failed(standardMaterialApprovalForm, "保存失败"); |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
* 审批(标准物质停用/报废销毁/恢复/降级使用审批表) |
|
|
|
|
* |
|
|
|
|
* @param auditAndApproveDTO (标准物质停用/报废销毁/恢复/降级使用审批表) |
|
|
|
|
* @return R |
|
|
|
|
*/ |
|
|
|
|
@ApiOperation(value = "审批(标准物质停用/报废销毁/恢复/降级使用审批表)", notes = "审批(标准物质停用/报废销毁/恢复/降级使用审批表)") |
|
|
|
|
@SysLog("审批(标准物质停用/报废销毁/恢复/降级使用审批表)") |
|
|
|
|
@PutMapping("/approve") |
|
|
|
|
@PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_approve')") |
|
|
|
|
public R<StandardMaterialApprovalForm> approveById(@RequestBody AuditAndApproveDTO auditAndApproveDTO, HttpServletRequest theHttpServletRequest) { |
|
|
|
|
Principal principal = theHttpServletRequest.getUserPrincipal(); |
|
|
|
|
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); |
|
|
|
|
|
|
|
|
|
StandardMaterialApprovalForm standardMaterialApprovalForm = standardMaterialApprovalFormService.approveById(auditAndApproveDTO, dlpUser); |
|
|
|
|
|
|
|
|
|
if (standardMaterialApprovalForm != null) { |
|
|
|
|
return R.ok(standardMaterialApprovalForm, "审批成功"); |
|
|
|
|
} else { |
|
|
|
|
return R.failed(standardMaterialApprovalForm, "审批失败"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 一级审核(标准物质停用/报废销毁/恢复/降级使用审批表) |
|
|
|
|
* @param auditAndApproveDTO (标准物质停用/报废销毁/恢复/降级使用审批表) |
|
|
|
|
* @return R |
|
|
|
|
*/ |
|
|
|
|
@ApiOperation(value = "一级审核(标准物质停用/报废销毁/恢复/降级使用审批表)", notes = "一级审核(标准物质停用/报废销毁/恢复/降级使用审批表)") |
|
|
|
|
@SysLog("一级审核(标准物质停用/报废销毁/恢复/降级使用审批表)" ) |
|
|
|
|
@PutMapping("/auditPrimary") |
|
|
|
|
@PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_auditPrimary')" ) |
|
|
|
|
public R<StandardMaterialApprovalForm> auditPrimary(@RequestBody AuditAndApproveDTO auditAndApproveDTO, HttpServletRequest theHttpServletRequest) { |
|
|
|
|
Principal principal = theHttpServletRequest.getUserPrincipal(); |
|
|
|
|
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); |
|
|
|
|
|
|
|
|
|
StandardMaterialApprovalForm standardMaterialApprovalForm = standardMaterialApprovalFormService.auditPrimary(auditAndApproveDTO,dlpUser); |
|
|
|
|
|
|
|
|
|
if (standardMaterialApprovalForm!=null) { |
|
|
|
|
return R.ok(standardMaterialApprovalForm, "审核成功"); |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
return R.failed(standardMaterialApprovalForm, "审核失败"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 二级审核(标准物质停用/报废销毁/恢复/降级使用审批表) |
|
|
|
|
* @param auditAndApproveDTO (标准物质停用/报废销毁/恢复/降级使用审批表) |
|
|
|
|
* @return R |
|
|
|
|
*/ |
|
|
|
|
@ApiOperation(value = "二级审核(标准物质停用/报废销毁/恢复/降级使用审批表)", notes = "二级审核(标准物质停用/报废销毁/恢复/降级使用审批表)") |
|
|
|
|
@SysLog("一级审核(标准物质停用/报废销毁/恢复/降级使用审批表)" ) |
|
|
|
|
@PutMapping("/auditSecondary") |
|
|
|
|
@PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_auditSecondary')" ) |
|
|
|
|
public R<StandardMaterialApprovalForm> auditSecondary(@RequestBody AuditAndApproveDTO auditAndApproveDTO, HttpServletRequest theHttpServletRequest) { |
|
|
|
|
Principal principal = theHttpServletRequest.getUserPrincipal(); |
|
|
|
|
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); |
|
|
|
|
|
|
|
|
|
StandardMaterialApprovalForm standardMaterialApprovalForm = standardMaterialApprovalFormService.auditSecondary(auditAndApproveDTO,dlpUser); |
|
|
|
|
|
|
|
|
|
if (standardMaterialApprovalForm!=null) { |
|
|
|
|
return R.ok(standardMaterialApprovalForm, "审核成功"); |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
return R.failed(standardMaterialApprovalForm, "审核失败"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 审批(标准物质停用/报废销毁/恢复/降级使用审批表) |
|
|
|
|
* @param auditAndApproveDTO (标准物质停用/报废销毁/恢复/降级使用审批表) |
|
|
|
|
* @return R |
|
|
|
|
*/ |
|
|
|
|
@ApiOperation(value = "审批(标准物质停用/报废销毁/恢复/降级使用审批表)", notes = "审批(标准物质停用/报废销毁/恢复/降级使用审批表)") |
|
|
|
|
@SysLog("审批(标准物质停用/报废销毁/恢复/降级使用审批表)" ) |
|
|
|
|
@PutMapping("/approve") |
|
|
|
|
@PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_approve')" ) |
|
|
|
|
public R<StandardMaterialApprovalForm> approveById(@RequestBody AuditAndApproveDTO auditAndApproveDTO, HttpServletRequest theHttpServletRequest) { |
|
|
|
|
Principal principal = theHttpServletRequest.getUserPrincipal(); |
|
|
|
|
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); |
|
|
|
|
|
|
|
|
|
StandardMaterialApprovalForm standardMaterialApprovalForm = standardMaterialApprovalFormService.approveById(auditAndApproveDTO,dlpUser); |
|
|
|
|
|
|
|
|
|
if (standardMaterialApprovalForm!=null) { |
|
|
|
|
return R.ok(standardMaterialApprovalForm, "审批成功"); |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
return R.failed(standardMaterialApprovalForm, "审批失败"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "标准物质停用", notes = "标准物质停用") |
|
|
|
|
@SysLog("标准物质停用" ) |
|
|
|
|
@PostMapping("/deactivate") |
|
|
|
|
@ApiOperation(value = "标准物质停用", notes = "标准物质停用") |
|
|
|
|
@SysLog("标准物质停用") |
|
|
|
|
@PostMapping("/deactivate") |
|
|
|
|
// @PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_deactivate')" )
|
|
|
|
|
public R<String > editById(String id, HttpServletRequest theHttpServletRequest) { |
|
|
|
|
Principal principal = theHttpServletRequest.getUserPrincipal(); |
|
|
|
|
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); |
|
|
|
|
public R<String> editById(String id, HttpServletRequest theHttpServletRequest) { |
|
|
|
|
Principal principal = theHttpServletRequest.getUserPrincipal(); |
|
|
|
|
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); |
|
|
|
|
|
|
|
|
|
ReferenceMaterial byId = referenceMaterialService.getById(id); |
|
|
|
|
ReferenceMaterial byId = referenceMaterialService.getById(id); |
|
|
|
|
|
|
|
|
|
byId.setStatus(-1); |
|
|
|
|
byId.setStatus(-1); |
|
|
|
|
|
|
|
|
|
if (referenceMaterialService.updateById(byId)) { |
|
|
|
|
return R.ok("停用成功"); |
|
|
|
|
} else { |
|
|
|
|
return R.failed("停用失败"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (referenceMaterialService.updateById(byId)) { |
|
|
|
|
return R.ok("停用成功"); |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
return R.failed( "停用失败"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
/**-------标准物质停用报废销毁恢复降级使用审批表打印*/ |
|
|
|
|
/** |
|
|
|
|
* 标准物质停用报废销毁恢复降级使用审批表打印 |
|
|
|
|
* |
|
|
|
|
* @param id |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@ApiOperation(value = "标准物质停用报废销毁恢复降级使用审批表打印", notes = "标准物质停用报废销毁恢复降级使用审批表打印") |
|
|
|
|
@SysLog("标准物质停用报废销毁恢复降级使用审批表打印") |
|
|
|
|
@PostMapping("/print") |
|
|
|
|
// @PreAuthorize("@pms.hasPermission('EntrustmentEdit')")
|
|
|
|
|
public void bizGetPDFInventory(String id, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) { |
|
|
|
|
System.out.println("bizApplyWord................."); |
|
|
|
|
Principal principal = theHttpServletRequest.getUserPrincipal(); |
|
|
|
|
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); |
|
|
|
|
|
|
|
|
|
StandardMaterialApprovalFormVO standardMaterialApprovalFormVO = standardMaterialApprovalFormService.getVO(id); |
|
|
|
|
|
|
|
|
|
if (standardMaterialApprovalFormVO == null) { |
|
|
|
|
throw new RuntimeException("未查询到相关信息"); |
|
|
|
|
} |
|
|
|
|
String applyFileName = "标准物质停用报废销毁恢复降级使用审批表" + id; |
|
|
|
|
; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String pdfFilePath = "document" + "/" + "standardMaterialApprovalForm" + "/" + id + "/" + applyFileName + ".pdf"; |
|
|
|
|
try { |
|
|
|
|
//直接调用pdf方法
|
|
|
|
|
standardMaterialApprovalFormService.standardMaterialApprovalFormTablePDF(standardMaterialApprovalFormVO, theHttpServletRequest, httpServletResponse); |
|
|
|
|
ossFile.fileGet(pdfFilePath, httpServletResponse.getOutputStream()); |
|
|
|
|
httpServletResponse.setContentType(applyFileName); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
System.out.println(String.format("minioFile objectExist() Exception. %s", e.getLocalizedMessage())); |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|