|
|
@ -7,8 +7,10 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import digital.laboratory.platform.common.core.util.R; |
|
|
|
import digital.laboratory.platform.common.core.util.R; |
|
|
|
import digital.laboratory.platform.common.log.annotation.SysLog; |
|
|
|
import digital.laboratory.platform.common.log.annotation.SysLog; |
|
|
|
import digital.laboratory.platform.common.mybatis.security.service.DLPUser; |
|
|
|
import digital.laboratory.platform.common.mybatis.security.service.DLPUser; |
|
|
|
|
|
|
|
import digital.laboratory.platform.reagent.dto.StandardMaterialApprovalFormDTO; |
|
|
|
import digital.laboratory.platform.reagent.entity.StandardMaterialApprovalForm; |
|
|
|
import digital.laboratory.platform.reagent.entity.StandardMaterialApprovalForm; |
|
|
|
import digital.laboratory.platform.reagent.service.StandardMaterialApprovalFormService; |
|
|
|
import digital.laboratory.platform.reagent.service.StandardMaterialApprovalFormService; |
|
|
|
|
|
|
|
import digital.laboratory.platform.reagent.vo.StandardMaterialApprovalFormVO; |
|
|
|
import org.springframework.security.access.prepost.PreAuthorize; |
|
|
|
import org.springframework.security.access.prepost.PreAuthorize; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
@ -48,13 +50,13 @@ public class StandardMaterialApprovalFormController { |
|
|
|
* @return R |
|
|
|
* @return R |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@ApiOperation(value = "通过id查询", notes = "通过id查询") |
|
|
|
@ApiOperation(value = "通过id查询", notes = "通过id查询") |
|
|
|
@GetMapping("/{standardMaterialApprovalFormId}" ) |
|
|
|
@GetMapping( ) |
|
|
|
@PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_get')" ) |
|
|
|
// @PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_get')" )
|
|
|
|
public R<StandardMaterialApprovalForm> getById(@PathVariable("standardMaterialApprovalFormId" ) String standardMaterialApprovalFormId, HttpServletRequest theHttpServletRequest) { |
|
|
|
public R<StandardMaterialApprovalFormVO> getById(String standardMaterialApprovalFormId, HttpServletRequest theHttpServletRequest) { |
|
|
|
Principal principal = theHttpServletRequest.getUserPrincipal(); |
|
|
|
Principal principal = theHttpServletRequest.getUserPrincipal(); |
|
|
|
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); |
|
|
|
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); |
|
|
|
|
|
|
|
|
|
|
|
StandardMaterialApprovalForm standardMaterialApprovalForm = standardMaterialApprovalFormService.getById(standardMaterialApprovalFormId); |
|
|
|
StandardMaterialApprovalFormVO standardMaterialApprovalForm = standardMaterialApprovalFormService.getVO(standardMaterialApprovalFormId); |
|
|
|
return R.ok(standardMaterialApprovalForm); |
|
|
|
return R.ok(standardMaterialApprovalForm); |
|
|
|
//return R.ok(standardMaterialApprovalFormService.getById(standardMaterialApprovalFormId));
|
|
|
|
//return R.ok(standardMaterialApprovalFormService.getById(standardMaterialApprovalFormId));
|
|
|
|
} |
|
|
|
} |
|
|
@ -68,12 +70,11 @@ public class StandardMaterialApprovalFormController { |
|
|
|
@ApiOperation(value = "分页查询", notes = "分页查询") |
|
|
|
@ApiOperation(value = "分页查询", notes = "分页查询") |
|
|
|
@GetMapping("/page" ) |
|
|
|
@GetMapping("/page" ) |
|
|
|
@PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_get')" ) |
|
|
|
@PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_get')" ) |
|
|
|
public R<IPage<StandardMaterialApprovalForm>> getStandardMaterialApprovalFormPage(Page<StandardMaterialApprovalForm> page, StandardMaterialApprovalForm standardMaterialApprovalForm, HttpServletRequest theHttpServletRequest) { |
|
|
|
public R<IPage<StandardMaterialApprovalFormVO>> getStandardMaterialApprovalFormPage(Page<StandardMaterialApprovalForm> page, StandardMaterialApprovalForm standardMaterialApprovalForm, HttpServletRequest theHttpServletRequest) { |
|
|
|
Principal principal = theHttpServletRequest.getUserPrincipal(); |
|
|
|
Principal principal = theHttpServletRequest.getUserPrincipal(); |
|
|
|
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); |
|
|
|
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); |
|
|
|
|
|
|
|
|
|
|
|
IPage<StandardMaterialApprovalForm> standardMaterialApprovalFormSList = standardMaterialApprovalFormService.page(page, Wrappers.<StandardMaterialApprovalForm>query() |
|
|
|
IPage<StandardMaterialApprovalFormVO> standardMaterialApprovalFormSList = standardMaterialApprovalFormService.getVOPage(page, Wrappers.<StandardMaterialApprovalForm>query() |
|
|
|
.eq("create_by", dlpUser.getId()) |
|
|
|
|
|
|
|
.orderByDesc("create_time") |
|
|
|
.orderByDesc("create_time") |
|
|
|
); |
|
|
|
); |
|
|
|
return R.ok(standardMaterialApprovalFormSList); |
|
|
|
return R.ok(standardMaterialApprovalFormSList); |
|
|
@ -83,69 +84,50 @@ public class StandardMaterialApprovalFormController { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 新增(标准物质停用/报废销毁/恢复/降级使用审批表) |
|
|
|
* 新增(标准物质停用/报废销毁/恢复/降级使用审批表) |
|
|
|
* @param standardMaterialApprovalForm (标准物质停用/报废销毁/恢复/降级使用审批表) |
|
|
|
* @param standardMaterialApprovalFormDTO (标准物质停用/报废销毁/恢复/降级使用审批表) |
|
|
|
* @return R |
|
|
|
* @return R |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@ApiOperation(value = "新增(标准物质停用/报废销毁/恢复/降级使用审批表)", notes = "新增(标准物质停用/报废销毁/恢复/降级使用审批表)") |
|
|
|
@ApiOperation(value = "新增(标准物质停用/报废销毁/恢复/降级使用审批表)", notes = "新增(标准物质停用/报废销毁/恢复/降级使用审批表)") |
|
|
|
@SysLog("新增(标准物质停用/报废销毁/恢复/降级使用审批表)" ) |
|
|
|
@SysLog("新增(标准物质停用/报废销毁/恢复/降级使用审批表)" ) |
|
|
|
@PostMapping |
|
|
|
@PostMapping |
|
|
|
@PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_add')" ) |
|
|
|
// @PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_add')" )
|
|
|
|
public R<StandardMaterialApprovalForm> postAddObject(@RequestBody StandardMaterialApprovalForm standardMaterialApprovalForm, HttpServletRequest theHttpServletRequest) { |
|
|
|
public R<StandardMaterialApprovalForm> postAddObject(@RequestBody StandardMaterialApprovalFormDTO standardMaterialApprovalFormDTO, HttpServletRequest theHttpServletRequest) { |
|
|
|
Principal principal = theHttpServletRequest.getUserPrincipal(); |
|
|
|
Principal principal = theHttpServletRequest.getUserPrincipal(); |
|
|
|
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); |
|
|
|
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); |
|
|
|
|
|
|
|
|
|
|
|
standardMaterialApprovalForm.setStandardMaterialApprovalFormId(IdWorker.get32UUID().toUpperCase()); |
|
|
|
StandardMaterialApprovalForm standardMaterialApprovalForm = standardMaterialApprovalFormService.addById(standardMaterialApprovalFormDTO, dlpUser); |
|
|
|
if (standardMaterialApprovalFormService.save(standardMaterialApprovalForm)) { |
|
|
|
|
|
|
|
return R.ok(standardMaterialApprovalForm, "对象创建成功"); |
|
|
|
if (standardMaterialApprovalForm!=null) { |
|
|
|
|
|
|
|
return R.ok(standardMaterialApprovalForm, "保存成功"); |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
else { |
|
|
|
return R.failed(standardMaterialApprovalForm, "对象创建失败"); |
|
|
|
return R.failed(standardMaterialApprovalForm, "保存失败"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 修改(标准物质停用/报废销毁/恢复/降级使用审批表) |
|
|
|
* 修改(标准物质停用/报废销毁/恢复/降级使用审批表) |
|
|
|
* @param standardMaterialApprovalForm (标准物质停用/报废销毁/恢复/降级使用审批表) |
|
|
|
* @param standardMaterialApprovalFormDTO (标准物质停用/报废销毁/恢复/降级使用审批表) |
|
|
|
* @return R |
|
|
|
* @return R |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@ApiOperation(value = "修改(标准物质停用/报废销毁/恢复/降级使用审批表)", notes = "修改(标准物质停用/报废销毁/恢复/降级使用审批表)") |
|
|
|
@ApiOperation(value = "修改(标准物质停用/报废销毁/恢复/降级使用审批表)", notes = "修改(标准物质停用/报废销毁/恢复/降级使用审批表)") |
|
|
|
@SysLog("修改(标准物质停用/报废销毁/恢复/降级使用审批表)" ) |
|
|
|
@SysLog("修改(标准物质停用/报废销毁/恢复/降级使用审批表)" ) |
|
|
|
@PutMapping |
|
|
|
@PutMapping |
|
|
|
@PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_edit')" ) |
|
|
|
@PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_edit')" ) |
|
|
|
public R<StandardMaterialApprovalForm> putUpdateById(@RequestBody StandardMaterialApprovalForm standardMaterialApprovalForm, HttpServletRequest theHttpServletRequest) { |
|
|
|
public R<StandardMaterialApprovalForm> putUpdateById(@RequestBody StandardMaterialApprovalFormDTO standardMaterialApprovalFormDTO, HttpServletRequest theHttpServletRequest) { |
|
|
|
Principal principal = theHttpServletRequest.getUserPrincipal(); |
|
|
|
Principal principal = theHttpServletRequest.getUserPrincipal(); |
|
|
|
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); |
|
|
|
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); |
|
|
|
|
|
|
|
|
|
|
|
if (standardMaterialApprovalFormService.updateById(standardMaterialApprovalForm)) { |
|
|
|
StandardMaterialApprovalForm standardMaterialApprovalForm = standardMaterialApprovalFormService.editById(standardMaterialApprovalFormDTO); |
|
|
|
return R.ok(standardMaterialApprovalForm, "保存对象成功"); |
|
|
|
|
|
|
|
|
|
|
|
if (standardMaterialApprovalForm!=null) { |
|
|
|
|
|
|
|
return R.ok(standardMaterialApprovalForm, "修改成功"); |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
else { |
|
|
|
return R.failed(standardMaterialApprovalForm, "保存对象失败"); |
|
|
|
return R.failed(standardMaterialApprovalForm, "修改失败"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 通过id删除(标准物质停用/报废销毁/恢复/降级使用审批表) |
|
|
|
|
|
|
|
* @param standardMaterialApprovalFormId id |
|
|
|
|
|
|
|
* @return R |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@ApiOperation(value = "通过id删除(标准物质停用/报废销毁/恢复/降级使用审批表)", notes = "通过id删除(标准物质停用/报废销毁/恢复/降级使用审批表)") |
|
|
|
|
|
|
|
@SysLog("通过id删除(标准物质停用/报废销毁/恢复/降级使用审批表)" ) |
|
|
|
|
|
|
|
@DeleteMapping("/{standardMaterialApprovalFormId}" ) |
|
|
|
|
|
|
|
@PreAuthorize("@pms.hasPermission('reagent_standard_material_approval_form_del')" ) |
|
|
|
|
|
|
|
public R<StandardMaterialApprovalForm> deleteById(@PathVariable String standardMaterialApprovalFormId, HttpServletRequest theHttpServletRequest) { |
|
|
|
|
|
|
|
Principal principal = theHttpServletRequest.getUserPrincipal(); |
|
|
|
|
|
|
|
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
StandardMaterialApprovalForm oldStandardMaterialApprovalForm = standardMaterialApprovalFormService.getById(standardMaterialApprovalFormId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (standardMaterialApprovalFormService.removeById(standardMaterialApprovalFormId)) { |
|
|
|
|
|
|
|
return R.ok(oldStandardMaterialApprovalForm, "对象删除成功"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
return R.failed(oldStandardMaterialApprovalForm, "对象删除失败"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|