|
|
|
@ -8,11 +8,13 @@ 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.reagent.dto.ApplicationForUseDTO; |
|
|
|
|
import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO; |
|
|
|
|
import digital.laboratory.platform.reagent.entity.ApplicationForUse; |
|
|
|
|
import digital.laboratory.platform.reagent.entity.ReagentConsumablesSet; |
|
|
|
|
import digital.laboratory.platform.reagent.service.ApplicationForUseService; |
|
|
|
|
import digital.laboratory.platform.reagent.service.ReagentConsumablesSetService; |
|
|
|
|
import digital.laboratory.platform.reagent.vo.ApplicationForUseVO; |
|
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
|
import org.springframework.security.access.prepost.PreAuthorize; |
|
|
|
|
import io.swagger.annotations.Api; |
|
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
@ -116,20 +118,22 @@ public class ApplicationForUseController { |
|
|
|
|
/** |
|
|
|
|
* 修改(试剂耗材领用申请表) |
|
|
|
|
* |
|
|
|
|
* @param id (试剂耗材领用申请表) |
|
|
|
|
* @param applicationForUseDTO (试剂耗材领用申请表) |
|
|
|
|
* @return R |
|
|
|
|
*/ |
|
|
|
|
@ApiOperation(value = "修改(试剂耗材领用申请表)", notes = "修改(试剂耗材领用申请表)") |
|
|
|
|
@SysLog("修改(试剂耗材领用申请表)") |
|
|
|
|
@PutMapping |
|
|
|
|
@PreAuthorize("@pms.hasPermission('reagent_application_for_use_edit')") |
|
|
|
|
public R<String> putUpdateById(String id, HttpServletRequest theHttpServletRequest) { |
|
|
|
|
public R<String> putUpdateById(@RequestBody ApplicationForUseDTO applicationForUseDTO, HttpServletRequest theHttpServletRequest) { |
|
|
|
|
|
|
|
|
|
Principal principal = theHttpServletRequest.getUserPrincipal(); |
|
|
|
|
|
|
|
|
|
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); |
|
|
|
|
|
|
|
|
|
ReagentConsumablesSet byId = reagentConsumablesSetService.getById(id); |
|
|
|
|
ReagentConsumablesSet byId = reagentConsumablesSetService.getById(applicationForUseDTO.getReagentConsumableSetId()); |
|
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(applicationForUseDTO,byId); |
|
|
|
|
|
|
|
|
|
if ( reagentConsumablesSetService.updateById(byId)){ |
|
|
|
|
return R.ok("修改成功"); |
|
|
|
@ -158,6 +162,27 @@ public class ApplicationForUseController { |
|
|
|
|
return R.ok("删除成功"); |
|
|
|
|
} else return R.failed("删除失败"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 通过id删除(试剂耗材领用申请表) |
|
|
|
|
* |
|
|
|
|
* @param id id |
|
|
|
|
* @return R |
|
|
|
|
*/ |
|
|
|
|
@ApiOperation(value = "通过id删除(试剂耗材领用申请表)明细", notes = "通过id删除(试剂耗材领用申请表)明细") |
|
|
|
|
@SysLog("通过id删除(试剂耗材领用申请表)明细") |
|
|
|
|
@DeleteMapping("/details") |
|
|
|
|
@PreAuthorize("@pms.hasPermission('reagent_application_for_use_del')") |
|
|
|
|
public R<String> deleteDetails(String id, HttpServletRequest theHttpServletRequest) { |
|
|
|
|
|
|
|
|
|
Principal principal = theHttpServletRequest.getUserPrincipal(); |
|
|
|
|
|
|
|
|
|
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); |
|
|
|
|
|
|
|
|
|
if (reagentConsumablesSetService.removeById(id)) { |
|
|
|
|
return R.ok("删除成功"); |
|
|
|
|
} else return R.failed("删除失败"); |
|
|
|
|
} |
|
|
|
|
/** |
|
|
|
|
* 提交试剂耗材领用申请表 |
|
|
|
|
* |
|
|
|
|