deleteById(@PathVariable String blacklistId, HttpServletRequest theHttpServletRequest) {
- Principal principal = theHttpServletRequest.getUserPrincipal();
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
-
- Blacklist oldBlacklist = blacklistService.getById(blacklistId);
-
- if (blacklistService.removeById(blacklistId)) {
- return R.ok(oldBlacklist, "对象删除成功");
- }
- else {
- return R.failed(oldBlacklist, "对象删除失败");
- }
-
- }
-
-}
diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/CabinetFormController.java b/src/main/java/digital/laboratory/platform/reagent/controller/CabinetFormController.java
index 4d9775d..fcb00d1 100644
--- a/src/main/java/digital/laboratory/platform/reagent/controller/CabinetFormController.java
+++ b/src/main/java/digital/laboratory/platform/reagent/controller/CabinetFormController.java
@@ -9,6 +9,7 @@ import digital.laboratory.platform.common.log.annotation.SysLog;
import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
import digital.laboratory.platform.reagent.entity.CabinetForm;
import digital.laboratory.platform.reagent.service.CabinetFormService;
+import digital.laboratory.platform.reagent.vo.CabinetFormVO;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -22,129 +23,140 @@ import java.io.IOException;
import java.security.Principal;
/**
- *
- *
* @author Zhang Xiaolong created at 2023-03-22
- * @describe 前端控制器
- *
+ * @describe 前端控制器
+ *
* 这是与表示层的接口, 不应该接业务逻辑写在这里, 业务逻辑应该写在 service 中
* 这里写什么:
- * 为前端提供数据, 接受前端的数据
- * 为前端提供的数据, 从 service 取得后, 可以做一些适当的加工, 这种加工不是业务层面的, 只能是数据格式上, 为方便前端处理
- * 接受前端的数据, 每一个函数的参数可以先做一些整理后, 再调用 service 中的函数。这里对参数的整理, 应该只是格式上的, 而不能是业务上的
+ * 为前端提供数据, 接受前端的数据
+ * 为前端提供的数据, 从 service 取得后, 可以做一些适当的加工, 这种加工不是业务层面的, 只能是数据格式上, 为方便前端处理
+ * 接受前端的数据, 每一个函数的参数可以先做一些整理后, 再调用 service 中的函数。这里对参数的整理, 应该只是格式上的, 而不能是业务上的
* 数据层在 mapper 中, 数据层不涉及业务, 只管技术上的 对象<->表 之间的转换
*/
@RestController
@RequiredArgsConstructor
-@RequestMapping("/cabinet_form" )
-@Api(value = "cabinet_form", tags = "管理")
+@RequestMapping("/cabinet_form")
+@Api(value = "cabinet_form", tags = "柜子管理")
public class CabinetFormController {
- private final CabinetFormService cabinetFormService;
-
- /**
- * 通过id查询
- * @param cabinetFormId id
- * @return R
- */
- @ApiOperation(value = "通过id查询", notes = "通过id查询")
- @GetMapping("/{cabinetFormId}" )
- @PreAuthorize("@pms.hasPermission('reagent_cabinet_form_get')" )
- public R getById(@PathVariable("cabinetFormId" ) String cabinetFormId, HttpServletRequest theHttpServletRequest) {
- Principal principal = theHttpServletRequest.getUserPrincipal();
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
-
- CabinetForm cabinetForm = cabinetFormService.getById(cabinetFormId);
- return R.ok(cabinetForm);
- //return R.ok(cabinetFormService.getById(cabinetFormId));
- }
-
- /**
+ private final CabinetFormService cabinetFormService;
+
+ /**
+ * 通过id查询
+ *
+ * @param cabinetFormId id
+ * @return R
+ */
+ @ApiOperation(value = "通过id查询柜子信息", notes = "通过id查询柜子信息")
+ @GetMapping()
+// @PreAuthorize("@pms.hasPermission('reagent_cabinet_form_get')" )
+
+ public R getById(String cabinetFormId, HttpServletRequest theHttpServletRequest) {
+
+ Principal principal = theHttpServletRequest.getUserPrincipal();
+
+ DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
+
+ CabinetFormVO formById = cabinetFormService.getFormById(cabinetFormId);
+
+ return R.ok(formById);
+
+ }
+
+ /**
* 分页查询
- * @param page 分页对象
- * @param cabinetForm
+ *
+ * @param page 分页对象
+ * @param cabinetForm
* @return
*/
@ApiOperation(value = "分页查询", notes = "分页查询")
- @GetMapping("/page" )
- @PreAuthorize("@pms.hasPermission('reagent_cabinet_form_get')" )
+ @GetMapping("/page")
+ @PreAuthorize("@pms.hasPermission('reagent_cabinet_form_get')")
public R> getCabinetFormPage(Page page, CabinetForm cabinetForm, HttpServletRequest theHttpServletRequest) {
- Principal principal = theHttpServletRequest.getUserPrincipal();
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
-
- IPage cabinetFormSList = cabinetFormService.page(page, Wrappers.query()
- .eq("create_by", dlpUser.getId())
- .orderByDesc("create_time")
- );
- return R.ok(cabinetFormSList);
-// return R.ok(cabinetFormService.page(page, Wrappers.query(cabinetForm)));
+
+ Principal principal = theHttpServletRequest.getUserPrincipal();
+
+ DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
+
+ IPage cabinetFormSList = cabinetFormService.page(page, Wrappers.query()
+ .orderByDesc("create_time")
+ );
+ return R.ok(cabinetFormSList);
}
/**
* 新增
- * @param cabinetForm
+ *
+ * @param cabinetForm
* @return R
*/
- @ApiOperation(value = "新增", notes = "新增")
- @SysLog("新增" )
+ @ApiOperation(value = "新增柜子信息", notes = "新增柜子信息")
+ @SysLog("新增柜子信息")
@PostMapping
- @PreAuthorize("@pms.hasPermission('reagent_cabinet_form_add')" )
+// @PreAuthorize("@pms.hasPermission('reagent_cabinet_form_add')" )
public R postAddObject(@RequestBody CabinetForm cabinetForm, HttpServletRequest theHttpServletRequest) {
- Principal principal = theHttpServletRequest.getUserPrincipal();
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
-
- cabinetForm.setCabinetFormId(IdWorker.get32UUID().toUpperCase());
- if (cabinetFormService.save(cabinetForm)) {
- return R.ok(cabinetForm, "对象创建成功");
- }
- else {
- return R.failed(cabinetForm, "对象创建失败");
- }
+
+ Principal principal = theHttpServletRequest.getUserPrincipal();
+
+ DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
+
+ CabinetForm form = cabinetFormService.addById(cabinetForm);
+
+ if (form != null) {
+ return R.ok(cabinetForm, "保存成功");
+ } else {
+ return R.failed(cabinetForm, "保存失败");
+ }
}
/**
* 修改
- * @param cabinetForm
+ *
+ * @param cabinetForm
* @return R
*/
- @ApiOperation(value = "修改", notes = "修改")
- @SysLog("修改" )
+ @ApiOperation(value = "修改柜子信息", notes = "新增柜子信息")
+ @SysLog("新增柜子信息")
@PutMapping
- @PreAuthorize("@pms.hasPermission('reagent_cabinet_form_edit')" )
+ @PreAuthorize("@pms.hasPermission('reagent_cabinet_form_edit')")
public R putUpdateById(@RequestBody CabinetForm cabinetForm, HttpServletRequest theHttpServletRequest) {
- Principal principal = theHttpServletRequest.getUserPrincipal();
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
-
- if (cabinetFormService.updateById(cabinetForm)) {
- return R.ok(cabinetForm, "保存对象成功");
- }
- else {
- return R.failed(cabinetForm, "保存对象失败");
- }
+
+ Principal principal = theHttpServletRequest.getUserPrincipal();
+
+ DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
+
+ CabinetForm form = cabinetFormService.editById(cabinetForm);
+
+ if (form != null) {
+ return R.ok(cabinetForm, "保存成功");
+ } else {
+ return R.failed(cabinetForm, "保存失败");
+ }
}
/**
* 通过id删除
+ *
* @param cabinetFormId id
* @return R
*/
- @ApiOperation(value = "通过id删除", notes = "通过id删除")
- @SysLog("通过id删除" )
- @DeleteMapping("/{cabinetFormId}" )
- @PreAuthorize("@pms.hasPermission('reagent_cabinet_form_del')" )
- public R deleteById(@PathVariable String cabinetFormId, HttpServletRequest theHttpServletRequest) {
- Principal principal = theHttpServletRequest.getUserPrincipal();
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
-
- CabinetForm oldCabinetForm = cabinetFormService.getById(cabinetFormId);
-
- if (cabinetFormService.removeById(cabinetFormId)) {
- return R.ok(oldCabinetForm, "对象删除成功");
- }
- else {
- return R.failed(oldCabinetForm, "对象删除失败");
- }
+ @ApiOperation(value = "通过id删除柜子信息", notes = "通过id删除柜子信息")
+ @SysLog("通过id删除柜子信息")
+ @DeleteMapping("/{cabinetFormId}")
+ @PreAuthorize("@pms.hasPermission('reagent_cabinet_form_del')")
+ public R deleteById(@PathVariable String cabinetFormId, HttpServletRequest theHttpServletRequest) {
+
+ Principal principal = theHttpServletRequest.getUserPrincipal();
+
+ DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
+
+ if (cabinetFormService.delById(cabinetFormId)) {
+ return R.ok("删除成功");
+ } else {
+ return R.failed("删除失败");
+ }
}
diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/CatalogueDetailsController.java b/src/main/java/digital/laboratory/platform/reagent/controller/CatalogueDetailsController.java
deleted file mode 100644
index cd593fb..0000000
--- a/src/main/java/digital/laboratory/platform/reagent/controller/CatalogueDetailsController.java
+++ /dev/null
@@ -1,151 +0,0 @@
-package digital.laboratory.platform.reagent.controller;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.core.toolkit.IdWorker;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-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.entity.CatalogueDetails;
-import digital.laboratory.platform.reagent.service.CatalogueDetailsService;
-import org.springframework.security.access.prepost.PreAuthorize;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import lombok.RequiredArgsConstructor;
-import org.springframework.security.oauth2.provider.OAuth2Authentication;
-import org.springframework.web.bind.annotation.*;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.security.Principal;
-
-/**
- * (采购目录明细)
- *
- * @author Zhang Xiaolong created at 2023-03-10
- * @describe (采购目录明细) 前端控制器
- *
- * 这是与表示层的接口, 不应该接业务逻辑写在这里, 业务逻辑应该写在 service 中
- * 这里写什么:
- * 为前端提供数据, 接受前端的数据
- * 为前端提供的数据, 从 service 取得后, 可以做一些适当的加工, 这种加工不是业务层面的, 只能是数据格式上, 为方便前端处理
- * 接受前端的数据, 每一个函数的参数可以先做一些整理后, 再调用 service 中的函数。这里对参数的整理, 应该只是格式上的, 而不能是业务上的
- * 数据层在 mapper 中, 数据层不涉及业务, 只管技术上的 对象<->表 之间的转换
- */
-@RestController
-@RequiredArgsConstructor
-@RequestMapping("/catalogue_details" )
-@Api(value = "catalogue_details", tags = "(采购目录明细)管理")
-public class CatalogueDetailsController {
-
- private final CatalogueDetailsService catalogueDetailsService;
-
- /**
- * 通过id查询(采购目录明细)
- * @param catalogueDetailsId id
- * @return R
- */
- @ApiOperation(value = "通过id查询", notes = "通过id查询")
- @GetMapping("/{catalogueDetailsId}" )
- @PreAuthorize("@pms.hasPermission('reagent_catalogue_details_get')" )
- public R getById(@PathVariable("catalogueDetailsId" ) String catalogueDetailsId, HttpServletRequest theHttpServletRequest) {
- Principal principal = theHttpServletRequest.getUserPrincipal();
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
-
- CatalogueDetails catalogueDetails = catalogueDetailsService.getById(catalogueDetailsId);
- return R.ok(catalogueDetails);
- //return R.ok(catalogueDetailsService.getById(catalogueDetailsId));
- }
-
- /**
- * 分页查询
- * @param page 分页对象
- * @param catalogueDetails (采购目录明细)
- * @return
- */
- @ApiOperation(value = "分页查询", notes = "分页查询")
- @GetMapping("/page" )
- @PreAuthorize("@pms.hasPermission('reagent_catalogue_details_get')" )
- public R> getCatalogueDetailsPage(Page page, CatalogueDetails catalogueDetails, HttpServletRequest theHttpServletRequest) {
- Principal principal = theHttpServletRequest.getUserPrincipal();
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
-
- IPage catalogueDetailsSList = catalogueDetailsService.page(page, Wrappers.query()
- .eq("create_by", dlpUser.getId())
- .orderByDesc("create_time")
- );
- return R.ok(catalogueDetailsSList);
-// return R.ok(catalogueDetailsService.page(page, Wrappers.query(catalogueDetails)));
- }
-
-
- /**
- * 新增(采购目录明细)
- * @param catalogueDetails (采购目录明细)
- * @return R
- */
- @ApiOperation(value = "新增(采购目录明细)", notes = "新增(采购目录明细)")
- @SysLog("新增(采购目录明细)" )
- @PostMapping
- @PreAuthorize("@pms.hasPermission('reagent_catalogue_details_add')" )
- public R postAddObject(@RequestBody CatalogueDetails catalogueDetails, HttpServletRequest theHttpServletRequest) {
- Principal principal = theHttpServletRequest.getUserPrincipal();
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
-
- catalogueDetails.setCatalogueDetailsId(IdWorker.get32UUID().toUpperCase());
- if (catalogueDetailsService.save(catalogueDetails)) {
- return R.ok(catalogueDetails, "对象创建成功");
- }
- else {
- return R.failed(catalogueDetails, "对象创建失败");
- }
- }
-
- /**
- * 修改(采购目录明细)
- * @param catalogueDetails (采购目录明细)
- * @return R
- */
- @ApiOperation(value = "修改(采购目录明细)", notes = "修改(采购目录明细)")
- @SysLog("修改(采购目录明细)" )
- @PutMapping
- @PreAuthorize("@pms.hasPermission('reagent_catalogue_details_edit')" )
- public R putUpdateById(@RequestBody CatalogueDetails catalogueDetails, HttpServletRequest theHttpServletRequest) {
- Principal principal = theHttpServletRequest.getUserPrincipal();
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
-
- if (catalogueDetailsService.updateById(catalogueDetails)) {
- return R.ok(catalogueDetails, "保存对象成功");
- }
- else {
- return R.failed(catalogueDetails, "保存对象失败");
- }
- }
-
- /**
- * 通过id删除(采购目录明细)
- * @param catalogueDetailsId id
- * @return R
- */
- @ApiOperation(value = "通过id删除(采购目录明细)", notes = "通过id删除(采购目录明细)")
- @SysLog("通过id删除(采购目录明细)" )
- @DeleteMapping("/{catalogueDetailsId}" )
- @PreAuthorize("@pms.hasPermission('reagent_catalogue_details_del')" )
- public R deleteById(@PathVariable String catalogueDetailsId, HttpServletRequest theHttpServletRequest) {
- Principal principal = theHttpServletRequest.getUserPrincipal();
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
-
- CatalogueDetails oldCatalogueDetails = catalogueDetailsService.getById(catalogueDetailsId);
-
- if (catalogueDetailsService.removeById(catalogueDetailsId)) {
- return R.ok(oldCatalogueDetails, "对象删除成功");
- }
- else {
- return R.failed(oldCatalogueDetails, "对象删除失败");
- }
-
- }
-
-}
diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/CentralizedRequestController.java b/src/main/java/digital/laboratory/platform/reagent/controller/CentralizedRequestController.java
index ebad411..b2daa19 100644
--- a/src/main/java/digital/laboratory/platform/reagent/controller/CentralizedRequestController.java
+++ b/src/main/java/digital/laboratory/platform/reagent/controller/CentralizedRequestController.java
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+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;
@@ -24,6 +25,7 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.security.Principal;
+import java.sql.Date;
import java.util.List;
/**
@@ -58,9 +60,9 @@ public class CentralizedRequestController {
* @return R
*/
@ApiOperation(value = "通过id查询集中采购申请", notes = "通过id查询集中采购申请")
- @GetMapping("/{centralizedRequestId}")
+ @GetMapping()
// @PreAuthorize("@pms.hasPermission('reagent_centralized_request_get')")
- public R getById(@PathVariable("centralizedRequestId") String centralizedRequestId, HttpServletRequest theHttpServletRequest) {
+ public R getById(String centralizedRequestId, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
@@ -85,17 +87,17 @@ public class CentralizedRequestController {
@ApiOperation(value = "分页查询", notes = "分页查询")
@GetMapping("/page")
// @PreAuthorize("@pms.hasPermission('CentralizedPurchaseRequestList')")
- public R> getCentralizedRequestPage(Page page,String orgName, CentralizedRequest centralizedRequest, HttpServletRequest theHttpServletRequest) {
+ public R> getCentralizedRequestPage(Page page, String orgName, CentralizedRequest centralizedRequest, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
- if (orgName!=null){
+ if (orgName != null) {
IPage centralizedRequestVOPage = centralizedRequestService.getCentralizedRequestVOPage(page, Wrappers.query()
.eq("create_by", dlpUser.getId()).orderByDesc("create_time")
- .eq("orgName",orgName));
+ .eq("orgName", orgName));
return R.ok(centralizedRequestVOPage);
}
@@ -111,29 +113,21 @@ public class CentralizedRequestController {
/**
* 分页查询
*
- * @param orgName 分页对象
- * @param orgName 集中采购申请
* @return
*/
@ApiOperation(value = "采购计划整合集中采购申请分页查询", notes = "采购计划整合集中采购申请分页查询")
@GetMapping("/list")
-// @PreAuthorize("@pms.hasPermission('CentralizedPurchaseRequestList')")
- public R> getCentralizedRequestVOPage(String orgName,HttpServletRequest theHttpServletRequest) {
+// @PreAuthorize("@pms.hasPermission('centralized_request_list_plan')")
+ public R> getCentralizedRequestVOPage(@JsonFormat(pattern = "yyyy-MM-dd") Date startTime, @JsonFormat(pattern = "yyyy-MM-dd") Date endTime, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
- if (orgName!=null){
-
-
- List centralizedRequestVOList = centralizedRequestService.getOrgVOList(Wrappers.query().orderByDesc("create_time"),orgName);
+ List centralizedRequestVOList = centralizedRequestService.getVOList(Wrappers.query()
+ .ge("create_time", startTime)
+ .le("create_time", endTime).orderByDesc("create_time"));
- return R.ok(centralizedRequestVOList);
- }
-
- List centralizedRequestVOList = centralizedRequestService.getCentralizedRequestVOList(Wrappers.query()
- .orderByDesc("create_time"));
return R.ok(centralizedRequestVOList);
@@ -179,7 +173,7 @@ public class CentralizedRequestController {
DetailsOfCentralized detailsOfCentralized = centralizedRequestService.addDetailsById(centralizedRequestDto);
- if (detailsOfCentralized!=null) {
+ if (detailsOfCentralized != null) {
return R.ok(detailsOfCentralized, "添加成功");
} else {
return R.failed(detailsOfCentralized, "添加失败");
@@ -245,9 +239,9 @@ public class CentralizedRequestController {
*/
@ApiOperation(value = "通过id删除集中采购申请", notes = "通过id删除集中采购申请")
@SysLog("通过id删除集中采购申请")
- @DeleteMapping("/{centralizedRequestId}")
+ @DeleteMapping()
// @PreAuthorize("@pms.hasPermission('reagent_centralized_request_del')")
- public R deleteById(@PathVariable String centralizedRequestId, HttpServletRequest theHttpServletRequest) {
+ public R deleteById(String centralizedRequestId, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
@@ -267,9 +261,9 @@ public class CentralizedRequestController {
*/
@ApiOperation(value = "通过id删除集中采购申请明细", notes = "通过id删除集中采购申请明细")
@SysLog("通过id删除(集中采购申请)")
- @DeleteMapping("/details/{detailsOfCentralizedId}")
+ @DeleteMapping("/details")
// @PreAuthorize("@pms.hasPermission('reagent_details_of_centralized_del')")
- public R deleteDetailsById(@PathVariable String detailsOfCentralizedId, HttpServletRequest theHttpServletRequest) {
+ public R deleteDetailsById(String detailsOfCentralizedId, HttpServletRequest theHttpServletRequest) {
DetailsOfCentralized oldDetailsOfCentralized = detailsOfCentralizedService.getById(detailsOfCentralizedId);
diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/CheckContentController.java b/src/main/java/digital/laboratory/platform/reagent/controller/CheckContentController.java
deleted file mode 100644
index afad97b..0000000
--- a/src/main/java/digital/laboratory/platform/reagent/controller/CheckContentController.java
+++ /dev/null
@@ -1,151 +0,0 @@
-package digital.laboratory.platform.reagent.controller;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.core.toolkit.IdWorker;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-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.entity.CheckContent;
-import digital.laboratory.platform.reagent.service.CheckContentService;
-import org.springframework.security.access.prepost.PreAuthorize;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import lombok.RequiredArgsConstructor;
-import org.springframework.security.oauth2.provider.OAuth2Authentication;
-import org.springframework.web.bind.annotation.*;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.security.Principal;
-
-/**
- * (检查内容)
- *
- * @author Zhang Xiaolong created at 2023-03-10
- * @describe (检查内容) 前端控制器
- *
- * 这是与表示层的接口, 不应该接业务逻辑写在这里, 业务逻辑应该写在 service 中
- * 这里写什么:
- * 为前端提供数据, 接受前端的数据
- * 为前端提供的数据, 从 service 取得后, 可以做一些适当的加工, 这种加工不是业务层面的, 只能是数据格式上, 为方便前端处理
- * 接受前端的数据, 每一个函数的参数可以先做一些整理后, 再调用 service 中的函数。这里对参数的整理, 应该只是格式上的, 而不能是业务上的
- * 数据层在 mapper 中, 数据层不涉及业务, 只管技术上的 对象<->表 之间的转换
- */
-@RestController
-@RequiredArgsConstructor
-@RequestMapping("/check_content" )
-@Api(value = "check_content", tags = "(检查内容)管理")
-public class CheckContentController {
-
- private final CheckContentService checkContentService;
-
- /**
- * 通过id查询(检查内容)
- * @param checkContentId id
- * @return R
- */
- @ApiOperation(value = "通过id查询", notes = "通过id查询")
- @GetMapping("/{checkContentId}" )
- @PreAuthorize("@pms.hasPermission('reagent_check_content_get')" )
- public R getById(@PathVariable("checkContentId" ) String checkContentId, HttpServletRequest theHttpServletRequest) {
- Principal principal = theHttpServletRequest.getUserPrincipal();
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
-
- CheckContent checkContent = checkContentService.getById(checkContentId);
- return R.ok(checkContent);
- //return R.ok(checkContentService.getById(checkContentId));
- }
-
- /**
- * 分页查询
- * @param page 分页对象
- * @param checkContent (检查内容)
- * @return
- */
- @ApiOperation(value = "分页查询", notes = "分页查询")
- @GetMapping("/page" )
- @PreAuthorize("@pms.hasPermission('reagent_check_content_get')" )
- public R> getCheckContentPage(Page page, CheckContent checkContent, HttpServletRequest theHttpServletRequest) {
- Principal principal = theHttpServletRequest.getUserPrincipal();
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
-
- IPage checkContentSList = checkContentService.page(page, Wrappers.query()
- .eq("create_by", dlpUser.getId())
- .orderByDesc("create_time")
- );
- return R.ok(checkContentSList);
-// return R.ok(checkContentService.page(page, Wrappers.query(checkContent)));
- }
-
-
- /**
- * 新增(检查内容)
- * @param checkContent (检查内容)
- * @return R
- */
- @ApiOperation(value = "新增(检查内容)", notes = "新增(检查内容)")
- @SysLog("新增(检查内容)" )
- @PostMapping
- @PreAuthorize("@pms.hasPermission('reagent_check_content_add')" )
- public R postAddObject(@RequestBody CheckContent checkContent, HttpServletRequest theHttpServletRequest) {
- Principal principal = theHttpServletRequest.getUserPrincipal();
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
-
- checkContent.setCheckContentId(IdWorker.get32UUID().toUpperCase());
- if (checkContentService.save(checkContent)) {
- return R.ok(checkContent, "对象创建成功");
- }
- else {
- return R.failed(checkContent, "对象创建失败");
- }
- }
-
- /**
- * 修改(检查内容)
- * @param checkContent (检查内容)
- * @return R
- */
- @ApiOperation(value = "修改(检查内容)", notes = "修改(检查内容)")
- @SysLog("修改(检查内容)" )
- @PutMapping
- @PreAuthorize("@pms.hasPermission('reagent_check_content_edit')" )
- public R putUpdateById(@RequestBody CheckContent checkContent, HttpServletRequest theHttpServletRequest) {
- Principal principal = theHttpServletRequest.getUserPrincipal();
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
-
- if (checkContentService.updateById(checkContent)) {
- return R.ok(checkContent, "保存对象成功");
- }
- else {
- return R.failed(checkContent, "保存对象失败");
- }
- }
-
- /**
- * 通过id删除(检查内容)
- * @param checkContentId id
- * @return R
- */
- @ApiOperation(value = "通过id删除(检查内容)", notes = "通过id删除(检查内容)")
- @SysLog("通过id删除(检查内容)" )
- @DeleteMapping("/{checkContentId}" )
- @PreAuthorize("@pms.hasPermission('reagent_check_content_del')" )
- public R deleteById(@PathVariable String checkContentId, HttpServletRequest theHttpServletRequest) {
- Principal principal = theHttpServletRequest.getUserPrincipal();
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
-
- CheckContent oldCheckContent = checkContentService.getById(checkContentId);
-
- if (checkContentService.removeById(checkContentId)) {
- return R.ok(oldCheckContent, "对象删除成功");
- }
- else {
- return R.failed(oldCheckContent, "对象删除失败");
- }
-
- }
-
-}
diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/CheckScheduleController.java b/src/main/java/digital/laboratory/platform/reagent/controller/CheckScheduleController.java
index 17fd477..eaf394b 100644
--- a/src/main/java/digital/laboratory/platform/reagent/controller/CheckScheduleController.java
+++ b/src/main/java/digital/laboratory/platform/reagent/controller/CheckScheduleController.java
@@ -1,5 +1,6 @@
package digital.laboratory.platform.reagent.controller;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@@ -40,7 +41,7 @@ import java.util.List;
@RestController
@RequiredArgsConstructor
@RequestMapping("/check_schedule")
-@Api(value = "check_schedule", tags = "管理")
+@Api(value = "check_schedule", tags = "期间核查计划制定管理")
public class CheckScheduleController {
private final CheckScheduleService checkScheduleService;
@@ -51,10 +52,10 @@ public class CheckScheduleController {
* @param checkScheduleId id
* @return R
*/
- @ApiOperation(value = "通过id查询", notes = "通过id查询")
- @GetMapping("/{checkScheduleId}")
+ @ApiOperation(value = "通过id查询新增标准物质期间核查计划和确认表", notes = "通过id查询新增标准物质期间核查计划和确认表")
+ @GetMapping()
// @PreAuthorize("@pms.hasPermission('reagent_check_schedule_get')" )
- public R getById(@PathVariable("checkScheduleId") String checkScheduleId, HttpServletRequest theHttpServletRequest) {
+ public R getById(String checkScheduleId, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
@@ -70,38 +71,42 @@ public class CheckScheduleController {
* @param checkSchedule
* @return
*/
- @ApiOperation(value = "分页查询", notes = "分页查询")
+ @ApiOperation(value = "分页查询新增标准物质期间核查计划和确认表", notes = "分页查询新增标准物质期间核查计划和确认表")
@GetMapping("/page")
// @PreAuthorize("@pms.hasPermission('reagent_check_schedule_get')" )
- public R> getCheckSchedulePage(Page page, CheckSchedule checkSchedule, HttpServletRequest theHttpServletRequest) {
+ public R> getCheckSchedulePage(Page page, CheckSchedule checkSchedule,String status, String number,HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
- IPage checkScheduleSList = checkScheduleService.getCheckScheduleVOPage(page, Wrappers.query()
- .eq("create_by", dlpUser.getId())
- .orderByDesc("create_time")
- );
- return R.ok(checkScheduleSList);
-// return R.ok(checkScheduleService.page(page, Wrappers.query(checkSchedule)));
- }
+ QueryWrapper checkScheduleQueryWrapper = new QueryWrapper<>();
+ if (!status.equals("")){
+ checkScheduleQueryWrapper.eq("status",status);
+ }
+ if (!number.equals("")){
+ checkScheduleQueryWrapper.eq("number",number);
+ }
+ IPage checkScheduleVOPage = checkScheduleService.getCheckScheduleVOPage(page, checkScheduleQueryWrapper
+ .orderByAsc("create_time"));
+ return R.ok(checkScheduleVOPage);
+ }
/**
* 新增
*
* @param periodVerificationPlanDTOS
* @return R
*/
- @ApiOperation(value = "新增", notes = "新增")
+ @ApiOperation(value = "新增标准物质期间核查计划和确认表", notes = "新增标准物质期间核查计划和确认表")
@SysLog("新增")
@PostMapping
// @PreAuthorize("@pms.hasPermission('reagent_check_schedule_add')" )
- public R postAddObject(@RequestBody List periodVerificationPlanDTOS, HttpServletRequest theHttpServletRequest) {
+ public R postAddObject(@RequestBody List periodVerificationPlanDTOS, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
- CheckSchedule checkSchedule = checkScheduleService.addPlan(periodVerificationPlanDTOS, dlpUser);
+ CheckScheduleVO checkSchedule = checkScheduleService.addPlan(periodVerificationPlanDTOS, dlpUser);
if (checkSchedule != null) {
return R.ok(checkSchedule, "计划创建成功");
@@ -116,7 +121,7 @@ public class CheckScheduleController {
* @param periodVerificationPlanDTOS
* @return R
*/
- @ApiOperation(value = "修改", notes = "修改")
+ @ApiOperation(value = "修改标准物质期间核查计划和确认表", notes = "修改标准物质期间核查计划和确认表")
@SysLog("修改")
@PutMapping
// @PreAuthorize("@pms.hasPermission('reagent_check_schedule_edit')" )
@@ -137,7 +142,7 @@ public class CheckScheduleController {
* @param periodVerificationPlanDTOS
* @return R
*/
- @ApiOperation(value = "提交计划", notes = "提交计划")
+ @ApiOperation(value = "提交计划标准物质期间核查计划和确认表", notes = "提交计划标准物质期间核查计划和确认表")
@SysLog("提交计划")
@PostMapping("/commit")
// @PreAuthorize("@pms.hasPermission('reagent_check_schedule_edit')" )
@@ -145,45 +150,20 @@ public class CheckScheduleController {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
- CheckSchedule checkSchedule = checkScheduleService.commitPlan(periodVerificationPlanDTOS,dlpUser);
+ CheckSchedule checkSchedule = checkScheduleService.commitPlan(periodVerificationPlanDTOS, dlpUser);
if (checkSchedule != null) {
return R.ok(checkSchedule, "提交成功");
} else return R.failed("提交失败");
}
-
-// /**
-// * 通过id删除
-// *
-// * @param periodVerificationPlanDTOS id
-// * @return R
-// */
-// @ApiOperation(value = "通过id删除", notes = "通过id删除")
-// @SysLog("通过id删除")
-// @PostMapping("/commit")
-//// @PreAuthorize("@pms.hasPermission('reagent_check_schedule_del')" )
-// public R deleteById(@RequestBody List periodVerificationPlanDTOS, HttpServletRequest theHttpServletRequest) {
-// Principal principal = theHttpServletRequest.getUserPrincipal();
-// DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
-//
-// CheckSchedule checkSchedule = checkScheduleService.commitPlan(periodVerificationPlanDTOS, dlpUser);
-//
-// if (checkSchedule != null) {
-// return R.ok(checkSchedule, "提交成功");
-// } else {
-// return R.failed("提交失败");
-// }
-//
-// }
-
/**
* 审核
*
* @param auditAndApproveDTO
* @return R
*/
- @ApiOperation(value = "审核", notes = "审核")
+ @ApiOperation(value = "审核标准物质期间核查计划和确认表", notes = "审核标准物质期间核查计划和确认表")
@SysLog("修改")
@PutMapping("/audit")
// @PreAuthorize("@pms.hasPermission('reagent_check_schedule_edit')" )
diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/ComplianceCheckController.java b/src/main/java/digital/laboratory/platform/reagent/controller/ComplianceCheckController.java
index 522b83b..9274e80 100644
--- a/src/main/java/digital/laboratory/platform/reagent/controller/ComplianceCheckController.java
+++ b/src/main/java/digital/laboratory/platform/reagent/controller/ComplianceCheckController.java
@@ -54,9 +54,9 @@ public class ComplianceCheckController {
* @return R
*/
@ApiOperation(value = "通过id查询", notes = "通过id查询")
- @GetMapping("/{complianceCheckId}")
+ @GetMapping()
// @PreAuthorize("@pms.hasPermission('reagent_compliance_check_get')" )
- public R getById(@PathVariable("complianceCheckId") String complianceCheckId, HttpServletRequest theHttpServletRequest) {
+ public R getById( String complianceCheckId, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
@@ -74,42 +74,41 @@ public class ComplianceCheckController {
*/
@ApiOperation(value = "分页查询", notes = "分页查询")
@GetMapping("/page")
-// @PreAuthorize("@pms.hasPermission('reagent_compliance_check_get')")
+// @PreAuthorize("@pms.hasPermission('reagent_compliance_check_page)")
public R> getComplianceCheckPage(Page page, ComplianceCheck complianceCheck, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
IPage complianceCheckSList = complianceCheckService.getComplianceCheckVOPage(page, Wrappers.query()
- .eq("create_by", dlpUser.getId())
- .orderByDesc("create_time")
+ .orderByAsc("create_time")
);
return R.ok(complianceCheckSList);
// return R.ok(complianceCheckService.page(page, Wrappers.query(complianceCheck)));
}
- /**
- * 新增符合性检查记录表(试剂耗材)
- *
- * @param complianceCheckDTO (符合性检查记录表)
- * @return R
- */
- @ApiOperation(value = "新增符合性检查记录表(试剂耗材)", notes = "新增符合性检查记录表(试剂耗材)")
- @SysLog("新增(符合性检查记录表)")
- @PostMapping
-// @PreAuthorize("@pms.hasPermission('reagent_compliance_check_add')")
- public R postAddObject(@RequestBody ComplianceCheckDTO complianceCheckDTO, HttpServletRequest theHttpServletRequest) {
- Principal principal = theHttpServletRequest.getUserPrincipal();
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
-
- ComplianceCheck complianceCheck = complianceCheckService.addCheck(complianceCheckDTO, dlpUser);
-
- if (complianceCheck != null) {
- return R.ok(complianceCheck, "保存成功");
- } else {
- return R.failed(complianceCheck, "保存失败");
- }
- }
+// /**
+// * 新增符合性检查记录表(试剂耗材)
+// *
+// * @param complianceCheckDTO (符合性检查记录表)
+// * @return R
+// */
+// @ApiOperation(value = "新增符合性检查记录表(试剂耗材)", notes = "新增符合性检查记录表(试剂耗材)")
+// @SysLog("新增(符合性检查记录表)")
+// @PostMapping
+//// @PreAuthorize("@pms.hasPermission('reagent_compliance_check_add')")
+// public R postAddObject(@RequestBody ComplianceCheckDTO complianceCheckDTO, HttpServletRequest theHttpServletRequest) {
+// Principal principal = theHttpServletRequest.getUserPrincipal();
+// DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
+//
+// ComplianceCheck complianceCheck = complianceCheckService.addCheck(complianceCheckDTO, dlpUser);
+//
+// if (complianceCheck != null) {
+// return R.ok(complianceCheck, "保存成功");
+// } else {
+// return R.failed(complianceCheck, "保存失败");
+// }
+// }
/**
* 手动新增符合性检查记录表(试剂耗材)
*
@@ -142,9 +141,9 @@ public class ComplianceCheckController {
*/
@ApiOperation(value = "通过id删除(符合性检查记录表)", notes = "通过id删除(符合性检查记录表)")
@SysLog("通过id删除(符合性检查记录表)")
- @DeleteMapping("/{complianceCheckId}")
+ @DeleteMapping()
// @PreAuthorize("@pms.hasPermission('reagent_compliance_check_del')" )
- public R deleteById(@PathVariable String complianceCheckId, HttpServletRequest theHttpServletRequest) {
+ public R deleteById( String complianceCheckId, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
@@ -167,7 +166,7 @@ public class ComplianceCheckController {
@ApiOperation(value = "编辑符合性检查记录表", notes = "编辑符合性检查记录表")
@SysLog("编辑符合性检查记录表")
@PutMapping("/edit")
-// @PreAuthorize("@pms.hasPermission('reagent_compliance_check_del')" )
+// @PreAuthorize("@pms.hasPermission('reagent_compliance_check_edit)" )
public R editCheckById(@RequestBody ComplianceCheckDTO complianceCheckDTO, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
@@ -191,12 +190,12 @@ public class ComplianceCheckController {
@ApiOperation(value = "录入符合性检查方案", notes = "录入符合性检查方案")
@SysLog("编辑符合性检查记录表")
@PutMapping("/addScheme")
-// @PreAuthorize("@pms.hasPermission('reagent_compliance_check_del')" )
+// @PreAuthorize("@pms.hasPermission('reagent_compliance_check_input')" )
public R addScheme(@RequestBody ComplianceCheckDTO complianceCheckDTO, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
- ComplianceCheck complianceCheck = complianceCheckService.addScheme(complianceCheckDTO);
+ ComplianceCheck complianceCheck = complianceCheckService.addScheme(complianceCheckDTO,dlpUser);
if (complianceCheck != null) {
return R.ok("保存成功");
@@ -214,8 +213,8 @@ public class ComplianceCheckController {
*/
@ApiOperation(value = "提交符合性检查记录表", notes = "提交符合性检查记录表")
@SysLog("提交符合性检查记录表")
- @PutMapping("/commit/{complianceCheckId}")
-// @PreAuthorize("@pms.hasPermission('reagent_compliance_check_del')" )
+ @PutMapping("/commit")
+// @PreAuthorize("@pms.hasPermission('reagent_compliance_check_commit)" )
public R commitCheck(@RequestBody ComplianceCheckDTO complianceCheckDTO, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
@@ -239,7 +238,7 @@ public class ComplianceCheckController {
@ApiOperation(value = "一级审核符合性检查记录表", notes = "一级审核符合性检查记录表")
@SysLog("一级审核符合性检查记录表")
@PutMapping("/primaryAudit")
-// @PreAuthorize("@pms.hasPermission('reagent_compliance_check_del')" )
+// @PreAuthorize("@pms.hasPermission('reagent_compliance_check_primaryAudit')" )
public R primaryAuditCheck(@RequestBody AuditAndApproveDTO auditAndApproveDTO, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
@@ -262,7 +261,7 @@ public class ComplianceCheckController {
@ApiOperation(value = "二级审核符合性检查记录表", notes = "二级审核符合性检查记录表")
@SysLog("二级审核符合性检查记录表")
@PutMapping("/secondaryAudit")
-// @PreAuthorize("@pms.hasPermission('reagent_compliance_check_del')" )
+// @PreAuthorize("@pms.hasPermission('reagent_compliance_check_secondaryAudit)" )
public R secondaryAuditCheck(@RequestBody AuditAndApproveDTO auditAndApproveDTO, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/DecentralizeDetailsController.java b/src/main/java/digital/laboratory/platform/reagent/controller/DecentralizeDetailsController.java
deleted file mode 100644
index 1d38dea..0000000
--- a/src/main/java/digital/laboratory/platform/reagent/controller/DecentralizeDetailsController.java
+++ /dev/null
@@ -1,151 +0,0 @@
-package digital.laboratory.platform.reagent.controller;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.core.toolkit.IdWorker;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-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.entity.DecentralizeDetails;
-import digital.laboratory.platform.reagent.service.DecentralizeDetailsService;
-import org.springframework.security.access.prepost.PreAuthorize;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import lombok.RequiredArgsConstructor;
-import org.springframework.security.oauth2.provider.OAuth2Authentication;
-import org.springframework.web.bind.annotation.*;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.security.Principal;
-
-/**
- * 分散采购申请明细
- *
- * @author Zhang Xiaolong created at 2023-03-10
- * @describe 分散采购申请明细 前端控制器
- *
- * 这是与表示层的接口, 不应该接业务逻辑写在这里, 业务逻辑应该写在 service 中
- * 这里写什么:
- * 为前端提供数据, 接受前端的数据
- * 为前端提供的数据, 从 service 取得后, 可以做一些适当的加工, 这种加工不是业务层面的, 只能是数据格式上, 为方便前端处理
- * 接受前端的数据, 每一个函数的参数可以先做一些整理后, 再调用 service 中的函数。这里对参数的整理, 应该只是格式上的, 而不能是业务上的
- * 数据层在 mapper 中, 数据层不涉及业务, 只管技术上的 对象<->表 之间的转换
- */
-@RestController
-@RequiredArgsConstructor
-@RequestMapping("/decentralize_details" )
-@Api(value = "decentralize_details", tags = "分散采购申请明细管理")
-public class DecentralizeDetailsController {
-
- private final DecentralizeDetailsService decentralizeDetailsService;
-
- /**
- * 通过id查询分散采购申请明细
- * @param decentralizeDetailsId id
- * @return R
- */
- @ApiOperation(value = "通过id查询", notes = "通过id查询")
- @GetMapping("/{decentralizeDetailsId}" )
- @PreAuthorize("@pms.hasPermission('reagent_decentralize_details_get')" )
- public R getById(@PathVariable("decentralizeDetailsId" ) String decentralizeDetailsId, HttpServletRequest theHttpServletRequest) {
- Principal principal = theHttpServletRequest.getUserPrincipal();
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
-
- DecentralizeDetails decentralizeDetails = decentralizeDetailsService.getById(decentralizeDetailsId);
- return R.ok(decentralizeDetails);
- //return R.ok(decentralizeDetailsService.getById(decentralizeDetailsId));
- }
-
- /**
- * 分页查询
- * @param page 分页对象
- * @param decentralizeDetails 分散采购申请明细
- * @return
- */
- @ApiOperation(value = "分页查询", notes = "分页查询")
- @GetMapping("/page" )
- @PreAuthorize("@pms.hasPermission('reagent_decentralize_details_get')" )
- public R> getDecentralizeDetailsPage(Page page, DecentralizeDetails decentralizeDetails, HttpServletRequest theHttpServletRequest) {
- Principal principal = theHttpServletRequest.getUserPrincipal();
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
-
- IPage decentralizeDetailsSList = decentralizeDetailsService.page(page, Wrappers.query()
- .eq("create_by", dlpUser.getId())
- .orderByDesc("create_time")
- );
- return R.ok(decentralizeDetailsSList);
-// return R.ok(decentralizeDetailsService.page(page, Wrappers.query(decentralizeDetails)));
- }
-
-
- /**
- * 新增分散采购申请明细
- * @param decentralizeDetails 分散采购申请明细
- * @return R
- */
- @ApiOperation(value = "新增分散采购申请明细", notes = "新增分散采购申请明细")
- @SysLog("新增分散采购申请明细" )
- @PostMapping
- @PreAuthorize("@pms.hasPermission('reagent_decentralize_details_add')" )
- public R postAddObject(@RequestBody DecentralizeDetails decentralizeDetails, HttpServletRequest theHttpServletRequest) {
- Principal principal = theHttpServletRequest.getUserPrincipal();
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
-
- decentralizeDetails.setDecentralizeDetailsId(IdWorker.get32UUID().toUpperCase());
- if (decentralizeDetailsService.save(decentralizeDetails)) {
- return R.ok(decentralizeDetails, "对象创建成功");
- }
- else {
- return R.failed(decentralizeDetails, "对象创建失败");
- }
- }
-
- /**
- * 修改分散采购申请明细
- * @param decentralizeDetails 分散采购申请明细
- * @return R
- */
- @ApiOperation(value = "修改分散采购申请明细", notes = "修改分散采购申请明细")
- @SysLog("修改分散采购申请明细" )
- @PutMapping
- @PreAuthorize("@pms.hasPermission('reagent_decentralize_details_edit')" )
- public R putUpdateById(@RequestBody DecentralizeDetails decentralizeDetails, HttpServletRequest theHttpServletRequest) {
- Principal principal = theHttpServletRequest.getUserPrincipal();
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
-
- if (decentralizeDetailsService.updateById(decentralizeDetails)) {
- return R.ok(decentralizeDetails, "保存对象成功");
- }
- else {
- return R.failed(decentralizeDetails, "保存对象失败");
- }
- }
-
- /**
- * 通过id删除分散采购申请明细
- * @param decentralizeDetailsId id
- * @return R
- */
- @ApiOperation(value = "通过id删除分散采购申请明细", notes = "通过id删除分散采购申请明细")
- @SysLog("通过id删除分散采购申请明细" )
- @DeleteMapping("/{decentralizeDetailsId}" )
- @PreAuthorize("@pms.hasPermission('reagent_decentralize_details_del')" )
- public R deleteById(@PathVariable String decentralizeDetailsId, HttpServletRequest theHttpServletRequest) {
- Principal principal = theHttpServletRequest.getUserPrincipal();
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
-
- DecentralizeDetails oldDecentralizeDetails = decentralizeDetailsService.getById(decentralizeDetailsId);
-
- if (decentralizeDetailsService.removeById(decentralizeDetailsId)) {
- return R.ok(oldDecentralizeDetails, "对象删除成功");
- }
- else {
- return R.failed(oldDecentralizeDetails, "对象删除失败");
- }
-
- }
-
-}
diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/DecentralizedRequestController.java b/src/main/java/digital/laboratory/platform/reagent/controller/DecentralizedRequestController.java
index 52b9f15..9e204a3 100644
--- a/src/main/java/digital/laboratory/platform/reagent/controller/DecentralizedRequestController.java
+++ b/src/main/java/digital/laboratory/platform/reagent/controller/DecentralizedRequestController.java
@@ -1,24 +1,28 @@
package digital.laboratory.platform.reagent.controller;
+import com.alibaba.nacos.shaded.org.checkerframework.checker.units.qual.A;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.AuditAndApproveDTO;
-import digital.laboratory.platform.reagent.dto.AuditDecentralizedRequestDTO;
import digital.laboratory.platform.reagent.dto.DecentralizedRequestDTO;
+import digital.laboratory.platform.reagent.dto.PurchaseListDTO;
import digital.laboratory.platform.reagent.entity.DecentralizeDetails;
import digital.laboratory.platform.reagent.entity.DecentralizedRequest;
+import digital.laboratory.platform.reagent.entity.PurchaseList;
import digital.laboratory.platform.reagent.service.DecentralizeDetailsService;
import digital.laboratory.platform.reagent.service.DecentralizedRequestService;
+import digital.laboratory.platform.reagent.service.PurchaseListService;
import digital.laboratory.platform.reagent.vo.DecentralizedRequestVO;
import org.springframework.beans.factory.annotation.Autowired;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
-import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.oauth2.provider.OAuth2Authentication;
import org.springframework.web.bind.annotation.*;
@@ -50,6 +54,9 @@ public class DecentralizedRequestController {
@Autowired
private final DecentralizeDetailsService decentralizeDetailsService;
+ @Autowired
+ private PurchaseListService purchaseListService;
+
/**
* 通过id查询(分散采购申请)
*
@@ -57,9 +64,9 @@ public class DecentralizedRequestController {
* @return R
*/
@ApiOperation(value = "通过id查询分散采购申请", notes = "通过id查询分散采购申请")
- @GetMapping("/{decentralizedRequestId}")
+ @GetMapping()
// @PreAuthorize("@pms.hasPermission('reagent_decentralized_request_get')")
- public R getById(@PathVariable("decentralizedRequestId") String decentralizedRequestId, HttpServletRequest theHttpServletRequest) {
+ public R getById(String decentralizedRequestId, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
@@ -78,11 +85,11 @@ public class DecentralizedRequestController {
@ApiOperation(value = "分页查询", notes = "分页查询")
@GetMapping("/page")
// @PreAuthorize("@pms.hasPermission('reagent_decentralized_request_get')")
- public R> getDecentralizedRequestPage(Page page, DecentralizedRequest decentralizedRequest, HttpServletRequest theHttpServletRequest) {
+ public R> getDecentralizedRequestPage(Page page, DecentralizedRequest decentralizedRequest, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
- IPage decentralizedRequestSList = decentralizedRequestService.page(page, Wrappers.query()
+ IPage decentralizedRequestSList = decentralizedRequestService.getDecentralizedRequestVOPage(page, Wrappers.query()
.eq("create_by", dlpUser.getId())
.orderByDesc("create_time")
);
@@ -178,12 +185,12 @@ public class DecentralizedRequestController {
*/
@ApiOperation(value = "通过id删除分散采购申请", notes = "通过id删除分散采购申请")
@SysLog("通过id删除(分散采购申请)")
- @DeleteMapping("/{decentralizedRequestId}")
+ @DeleteMapping()
// @PreAuthorize("@pms.hasPermission('reagent_decentralized_request_del')")
- public R deleteById(@PathVariable String decentralizedRequestId, HttpServletRequest theHttpServletRequest) {
+ public R deleteById(String decentralizedRequestId, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
- DecentralizedRequest oldDecentralizedRequest = decentralizedRequestService.getById(decentralizedRequestId);
+
if (decentralizedRequestService.delRequestById(decentralizedRequestId)) {
return R.ok("删除成功");
} else return R.failed("删除失败");
@@ -199,9 +206,9 @@ public class DecentralizedRequestController {
*/
@ApiOperation(value = "通过id删除分散采购申请明细", notes = "通过id删除分散采购申请明细")
@SysLog("通过id删除分散采购申请明细")
- @DeleteMapping("details/{decentralizeDetailsId}")
+ @DeleteMapping("/details")
// @PreAuthorize("@pms.hasPermission('reagent_decentralize_details_del')")
- public R deleteDetailsById(@PathVariable String decentralizeDetailsId, HttpServletRequest theHttpServletRequest) {
+ public R deleteDetailsById(String decentralizeDetailsId, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
@@ -288,20 +295,20 @@ public class DecentralizedRequestController {
/**
* 三级审核分散采购申请
*
- * @param auditDecentralizedRequestDTO
+ * @param auditAndApproveDTO
* @return R
*/
@ApiOperation(value = "三级审核分散采购申请", notes = "三级审核分散采购申请")
@SysLog("审核分散采购申请明细")
@PutMapping("/threeLevel/audit")
// @PreAuthorize("@pms.hasPermission('reagent_decentralized_request_threeLevel')")
- public R threeLevelAuditRequest(@RequestBody AuditDecentralizedRequestDTO auditDecentralizedRequestDTO, HttpServletRequest theHttpServletRequest) {
+ public R threeLevelAuditRequest(@RequestBody AuditAndApproveDTO auditAndApproveDTO, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
- DecentralizedRequest decentralizedRequest = decentralizedRequestService.threeLevelAuditRequest(dlpUser, auditDecentralizedRequestDTO);
+ DecentralizedRequest decentralizedRequest = decentralizedRequestService.threeLevelAuditRequest(dlpUser, auditAndApproveDTO);
if (decentralizedRequest != null) {
return R.ok(decentralizedRequest, "审核成功");
@@ -326,6 +333,9 @@ public class DecentralizedRequestController {
DecentralizedRequest decentralizedRequest = decentralizedRequestService.approveRequest(dlpUser, auditAndApproveDto);
+
+
+
if (decentralizedRequest != null) {
return R.ok(decentralizedRequest, "审批成功");
} else return R.failed("审批失败");
diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/DeliveryRegistrationFormController.java b/src/main/java/digital/laboratory/platform/reagent/controller/DeliveryRegistrationFormController.java
index fc58e2a..9d6b5de 100644
--- a/src/main/java/digital/laboratory/platform/reagent/controller/DeliveryRegistrationFormController.java
+++ b/src/main/java/digital/laboratory/platform/reagent/controller/DeliveryRegistrationFormController.java
@@ -1,5 +1,6 @@
package digital.laboratory.platform.reagent.controller;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@@ -9,7 +10,11 @@ import digital.laboratory.platform.common.log.annotation.SysLog;
import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
import digital.laboratory.platform.reagent.dto.OutgoingContentsDTO;
import digital.laboratory.platform.reagent.entity.DeliveryRegistrationForm;
+import digital.laboratory.platform.reagent.entity.OutgoingContents;
import digital.laboratory.platform.reagent.service.DeliveryRegistrationFormService;
+import digital.laboratory.platform.reagent.service.OutgoingContentsService;
+import digital.laboratory.platform.reagent.vo.DeliveryRegistrationFormVO;
+import digital.laboratory.platform.reagent.vo.ReagentConsumablesVO;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -44,19 +49,21 @@ public class DeliveryRegistrationFormController {
private final DeliveryRegistrationFormService deliveryRegistrationFormService;
+ private final OutgoingContentsService outgoingContentsService;
+
/**
* 通过id查询(试剂耗材出库登记表)
* @param deliveryRegistrationFormId id
* @return R
*/
@ApiOperation(value = "通过id查询", notes = "通过id查询")
- @GetMapping("/{deliveryRegistrationFormId}" )
+ @GetMapping( )
// @PreAuthorize("@pms.hasPermission('reagent_delivery_registration_form_get')" )
- public R getById(@PathVariable("deliveryRegistrationFormId" ) String deliveryRegistrationFormId, HttpServletRequest theHttpServletRequest) {
+ public R getById(String deliveryRegistrationFormId, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
- DeliveryRegistrationForm deliveryRegistrationForm = deliveryRegistrationFormService.getById(deliveryRegistrationFormId);
+ DeliveryRegistrationFormVO deliveryRegistrationForm = deliveryRegistrationFormService.getDeliveryRegistrationFormVOById(deliveryRegistrationFormId);
return R.ok(deliveryRegistrationForm);
//return R.ok(deliveryRegistrationFormService.getById(deliveryRegistrationFormId));
}
@@ -69,15 +76,26 @@ public class DeliveryRegistrationFormController {
*/
@ApiOperation(value = "分页查询", notes = "分页查询")
@GetMapping("/page" )
-// @PreAuthorize("@pms.hasPermission('reagent_delivery_registration_form_get')" )
- public R> getDeliveryRegistrationFormPage(Page page, DeliveryRegistrationForm deliveryRegistrationForm, HttpServletRequest theHttpServletRequest) {
+// @PreAuthorize("@pms.hasPermission('reagent_delivery_registration_form_page')" )
+ public R> getDeliveryRegistrationFormPage(Page page, DeliveryRegistrationForm deliveryRegistrationForm, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
- IPage deliveryRegistrationFormSList = deliveryRegistrationFormService.page(page, Wrappers.query()
- .eq("create_by", dlpUser.getId())
+ IPage deliveryRegistrationFormSList = deliveryRegistrationFormService.getDeliveryRegistrationFormVOPage(page, Wrappers.query()
+ .eq("status",0)
.orderByDesc("create_time")
);
+
+ List records = deliveryRegistrationFormSList.getRecords();
+
+ for (DeliveryRegistrationFormVO record : records) {
+
+ LambdaQueryWrapper outgoingContentsLambdaQueryWrapper = new LambdaQueryWrapper<>();
+
+ outgoingContentsLambdaQueryWrapper.eq(OutgoingContents::getDeliveryRegistrationFormId,record.getId());
+
+ record.setTypeOfDelivery(outgoingContentsService.list(outgoingContentsLambdaQueryWrapper).size());
+ }
return R.ok(deliveryRegistrationFormSList);
// return R.ok(deliveryRegistrationFormService.page(page, Wrappers.query(deliveryRegistrationForm)));
}
@@ -91,7 +109,7 @@ public class DeliveryRegistrationFormController {
@ApiOperation(value = "提交(试剂耗材出库登记表)", notes = "提交(试剂耗材出库登记表)")
@SysLog("提交(试剂耗材出库登记表)" )
@PostMapping
-// @PreAuthorize("@pms.hasPermission('reagent_delivery_registration_form_add')" )
+// @PreAuthorize("@pms.hasPermission('reagent_delivery_registration_form_commit')" )
public R postAddObject(@RequestBody List outgoingContentsDTOS, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
@@ -103,4 +121,5 @@ public class DeliveryRegistrationFormController {
}else return R.failed("提交失败");
}
+
}
diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/DetailsOfCentralizedController.java b/src/main/java/digital/laboratory/platform/reagent/controller/DetailsOfCentralizedController.java
deleted file mode 100644
index be2e556..0000000
--- a/src/main/java/digital/laboratory/platform/reagent/controller/DetailsOfCentralizedController.java
+++ /dev/null
@@ -1,151 +0,0 @@
-package digital.laboratory.platform.reagent.controller;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.core.toolkit.IdWorker;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-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.entity.DetailsOfCentralized;
-import digital.laboratory.platform.reagent.service.DetailsOfCentralizedService;
-import org.springframework.security.access.prepost.PreAuthorize;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import lombok.RequiredArgsConstructor;
-import org.springframework.security.oauth2.provider.OAuth2Authentication;
-import org.springframework.web.bind.annotation.*;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.security.Principal;
-
-/**
- * (集中采购申请明细)
- *
- * @author Zhang Xiaolong created at 2023-03-10
- * @describe (集中采购申请明细) 前端控制器
- *
- * 这是与表示层的接口, 不应该接业务逻辑写在这里, 业务逻辑应该写在 service 中
- * 这里写什么:
- * 为前端提供数据, 接受前端的数据
- * 为前端提供的数据, 从 service 取得后, 可以做一些适当的加工, 这种加工不是业务层面的, 只能是数据格式上, 为方便前端处理
- * 接受前端的数据, 每一个函数的参数可以先做一些整理后, 再调用 service 中的函数。这里对参数的整理, 应该只是格式上的, 而不能是业务上的
- * 数据层在 mapper 中, 数据层不涉及业务, 只管技术上的 对象<->表 之间的转换
- */
-@RestController
-@RequiredArgsConstructor
-@RequestMapping("/details_of_centralized" )
-@Api(value = "details_of_centralized", tags = "(集中采购申请明细)管理")
-public class DetailsOfCentralizedController {
-
- private final DetailsOfCentralizedService detailsOfCentralizedService;
-
- /**
- * 通过id查询(集中采购申请明细)
- * @param detailsOfCentralizedId id
- * @return R
- */
- @ApiOperation(value = "通过id查询", notes = "通过id查询")
- @GetMapping("/{detailsOfCentralizedId}" )
- @PreAuthorize("@pms.hasPermission('reagent_details_of_centralized_get')" )
- public R getById(@PathVariable("detailsOfCentralizedId" ) String detailsOfCentralizedId, HttpServletRequest theHttpServletRequest) {
- Principal principal = theHttpServletRequest.getUserPrincipal();
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
-
- DetailsOfCentralized detailsOfCentralized = detailsOfCentralizedService.getById(detailsOfCentralizedId);
- return R.ok(detailsOfCentralized);
- //return R.ok(detailsOfCentralizedService.getById(detailsOfCentralizedId));
- }
-
- /**
- * 分页查询
- * @param page 分页对象
- * @param detailsOfCentralized (集中采购申请明细)
- * @return
- */
- @ApiOperation(value = "分页查询", notes = "分页查询")
- @GetMapping("/page" )
- @PreAuthorize("@pms.hasPermission('reagent_details_of_centralized_get')" )
- public R> getDetailsOfCentralizedPage(Page page, DetailsOfCentralized detailsOfCentralized, HttpServletRequest theHttpServletRequest) {
- Principal principal = theHttpServletRequest.getUserPrincipal();
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
-
- IPage detailsOfCentralizedSList = detailsOfCentralizedService.page(page, Wrappers.query()
- .eq("create_by", dlpUser.getId())
- .orderByDesc("create_time")
- );
- return R.ok(detailsOfCentralizedSList);
-// return R.ok(detailsOfCentralizedService.page(page, Wrappers.query(detailsOfCentralized)));
- }
-
-
- /**
- * 新增(集中采购申请明细)
- * @param detailsOfCentralized (集中采购申请明细)
- * @return R
- */
- @ApiOperation(value = "新增(集中采购申请明细)", notes = "新增(集中采购申请明细)")
- @SysLog("新增(集中采购申请明细)" )
- @PostMapping
- @PreAuthorize("@pms.hasPermission('reagent_details_of_centralized_add')" )
- public R postAddObject(@RequestBody DetailsOfCentralized detailsOfCentralized, HttpServletRequest theHttpServletRequest) {
- Principal principal = theHttpServletRequest.getUserPrincipal();
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
-
- detailsOfCentralized.setDetailsOfCentralizedId(IdWorker.get32UUID().toUpperCase());
- if (detailsOfCentralizedService.save(detailsOfCentralized)) {
- return R.ok(detailsOfCentralized, "对象创建成功");
- }
- else {
- return R.failed(detailsOfCentralized, "对象创建失败");
- }
- }
-
- /**
- * 修改(集中采购申请明细)
- * @param detailsOfCentralized (集中采购申请明细)
- * @return R
- */
- @ApiOperation(value = "修改(集中采购申请明细)", notes = "修改(集中采购申请明细)")
- @SysLog("修改(集中采购申请明细)" )
- @PutMapping
- @PreAuthorize("@pms.hasPermission('reagent_details_of_centralized_edit')" )
- public R putUpdateById(@RequestBody DetailsOfCentralized detailsOfCentralized, HttpServletRequest theHttpServletRequest) {
- Principal principal = theHttpServletRequest.getUserPrincipal();
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
-
- if (detailsOfCentralizedService.updateById(detailsOfCentralized)) {
- return R.ok(detailsOfCentralized, "保存对象成功");
- }
- else {
- return R.failed(detailsOfCentralized, "保存对象失败");
- }
- }
-
- /**
- * 通过id删除(集中采购申请明细)
- * @param detailsOfCentralizedId id
- * @return R
- */
- @ApiOperation(value = "通过id删除(集中采购申请明细)", notes = "通过id删除(集中采购申请明细)")
- @SysLog("通过id删除(集中采购申请明细)" )
- @DeleteMapping("/{detailsOfCentralizedId}" )
- @PreAuthorize("@pms.hasPermission('reagent_details_of_centralized_del')" )
- public R deleteById(@PathVariable String detailsOfCentralizedId, HttpServletRequest theHttpServletRequest) {
- Principal principal = theHttpServletRequest.getUserPrincipal();
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
-
- DetailsOfCentralized oldDetailsOfCentralized = detailsOfCentralizedService.getById(detailsOfCentralizedId);
-
- if (detailsOfCentralizedService.removeById(detailsOfCentralizedId)) {
- return R.ok(oldDetailsOfCentralized, "对象删除成功");
- }
- else {
- return R.failed(oldDetailsOfCentralized, "对象删除失败");
- }
-
- }
-
-}
diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/EvaluationFormController.java b/src/main/java/digital/laboratory/platform/reagent/controller/EvaluationFormController.java
index fb77b90..aad26ec 100644
--- a/src/main/java/digital/laboratory/platform/reagent/controller/EvaluationFormController.java
+++ b/src/main/java/digital/laboratory/platform/reagent/controller/EvaluationFormController.java
@@ -11,6 +11,7 @@ import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO;
import digital.laboratory.platform.reagent.dto.EvaluationFormDTO;
import digital.laboratory.platform.reagent.entity.EvaluationForm;
import digital.laboratory.platform.reagent.service.EvaluationFormService;
+import digital.laboratory.platform.reagent.vo.EvaluationFormVO;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -46,44 +47,24 @@ public class EvaluationFormController {
/**
* 通过id查询(服务商/供应商评价表)
- * @param evaluationFormId id
+ * @param supplierInformationId id
* @return R
*/
- @ApiOperation(value = "通过id查询", notes = "通过id查询")
- @GetMapping("/{evaluationFormId}" )
+ @ApiOperation(value = "通过id查询(服务商/供应商评价表)", notes = "通过id查询(服务商/供应商评价表)")
+ @SysLog("通过id查询(服务商/供应商评价表)" )
+ @GetMapping()
// @PreAuthorize("@pms.hasPermission('reagent_evaluation_form_get')" )
- public R getById(@PathVariable("evaluationFormId" ) String evaluationFormId, HttpServletRequest theHttpServletRequest) {
+ public R getById(String supplierInformationId, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
- EvaluationForm evaluationForm = evaluationFormService.getById(evaluationFormId);
+// EvaluationFormVO formById = evaluationFormService.getFormById(supplierInformationId);
- return R.ok(evaluationForm);
- //return R.ok(evaluationFormService.getById(evaluationFormId));
+ return R.ok(null);
}
- /**
- * 分页查询
- * @param page 分页对象
- * @param evaluationForm (服务商/供应商评价表)
- * @return
- */
- @ApiOperation(value = "分页查询", notes = "分页查询")
- @GetMapping("/page" )
-// @PreAuthorize("@pms.hasPermission('reagent_evaluation_form_get')" )
- public R> getEvaluationFormPage(Page page, EvaluationForm evaluationForm, HttpServletRequest theHttpServletRequest) {
- Principal principal = theHttpServletRequest.getUserPrincipal();
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
-
- IPage evaluationFormSList = evaluationFormService.page(page, Wrappers.query()
- .eq("create_by", dlpUser.getId())
- .orderByDesc("create_time")
- );
- return R.ok(evaluationFormSList);
-// return R.ok(evaluationFormService.page(page, Wrappers.query(evaluationForm)));
- }
/**
@@ -91,8 +72,8 @@ public class EvaluationFormController {
* @param evaluationFormDTO (服务商/供应商评价表)
* @return R
*/
- @ApiOperation(value = "录入(服务商/供应商评价表)", notes = "录入(服务商/供应商评价表)")
- @SysLog("录入(服务商/供应商评价表)" )
+ @ApiOperation(value = "录入并提交(服务商/供应商评价表)", notes = "录入并提交(服务商/供应商评价表)")
+ @SysLog("录入并提交(服务商/供应商评价表)" )
@PostMapping
// @PreAuthorize("@pms.hasPermission('reagent_evaluation_form_add')" )
public R postAddObject(@RequestBody EvaluationFormDTO evaluationFormDTO, HttpServletRequest theHttpServletRequest) {
@@ -101,12 +82,12 @@ public class EvaluationFormController {
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
- EvaluationForm evaluationForm = evaluationFormService.editFormById(evaluationFormDTO);
+ EvaluationForm evaluationForm = evaluationFormService.editFormById(evaluationFormDTO,dlpUser);
if (evaluationForm!=null) {
- return R.ok(evaluationForm,"保存成功");
+ return R.ok(evaluationForm,"提交成功");
}else {
- return R.failed("保存失败");
+ return R.failed("提交失败");
}
}
@@ -118,7 +99,7 @@ public class EvaluationFormController {
@ApiOperation(value = "二级审核(服务商/供应商评价表)", notes = "二级审核(服务商/供应商评价表)")
@SysLog("二级审核(服务商/供应商评价表)" )
@PutMapping("/secondary")
-// @PreAuthorize("@pms.hasPermission('reagent_evaluation_form_add')" )
+// @PreAuthorize("@pms.hasPermission('reagent_evaluation_form_secondaryAudit')" )
public R auditFormOfSecondary(@RequestBody AuditAndApproveDTO auditAndApproveDTO, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
@@ -142,7 +123,7 @@ public class EvaluationFormController {
@ApiOperation(value = "三级审核(服务商/供应商评价表)", notes = "三级审核(服务商/供应商评价表)")
@SysLog("三级审核(服务商/供应商评价表)" )
@PutMapping("/three_level")
-// @PreAuthorize("@pms.hasPermission('reagent_evaluation_form_add')" )
+// @PreAuthorize("@pms.hasPermission('reagent_evaluation_form_three_level_audit')" )
public R auditFormOfThreeLevel(@RequestBody AuditAndApproveDTO auditAndApproveDTO, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/InstructionBookController.java b/src/main/java/digital/laboratory/platform/reagent/controller/InstructionBookController.java
index fdf0aac..dcb0c3e 100644
--- a/src/main/java/digital/laboratory/platform/reagent/controller/InstructionBookController.java
+++ b/src/main/java/digital/laboratory/platform/reagent/controller/InstructionBookController.java
@@ -94,7 +94,7 @@ public class InstructionBookController {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
- instructionBook.setInstructionBookId(IdWorker.get32UUID().toUpperCase());
+ instructionBook.setId(IdWorker.get32UUID().toUpperCase());
if (instructionBookService.save(instructionBook)) {
return R.ok(instructionBook, "对象创建成功");
}
diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/LatticeFormController.java b/src/main/java/digital/laboratory/platform/reagent/controller/LatticeFormController.java
deleted file mode 100644
index 8c65968..0000000
--- a/src/main/java/digital/laboratory/platform/reagent/controller/LatticeFormController.java
+++ /dev/null
@@ -1,151 +0,0 @@
-package digital.laboratory.platform.reagent.controller;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.core.toolkit.IdWorker;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-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.entity.LatticeForm;
-import digital.laboratory.platform.reagent.service.LatticeFormService;
-import org.springframework.security.access.prepost.PreAuthorize;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import lombok.RequiredArgsConstructor;
-import org.springframework.security.oauth2.provider.OAuth2Authentication;
-import org.springframework.web.bind.annotation.*;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.security.Principal;
-
-/**
- *
- *
- * @author Zhang Xiaolong created at 2023-03-22
- * @describe 前端控制器
- *
- * 这是与表示层的接口, 不应该接业务逻辑写在这里, 业务逻辑应该写在 service 中
- * 这里写什么:
- * 为前端提供数据, 接受前端的数据
- * 为前端提供的数据, 从 service 取得后, 可以做一些适当的加工, 这种加工不是业务层面的, 只能是数据格式上, 为方便前端处理
- * 接受前端的数据, 每一个函数的参数可以先做一些整理后, 再调用 service 中的函数。这里对参数的整理, 应该只是格式上的, 而不能是业务上的
- * 数据层在 mapper 中, 数据层不涉及业务, 只管技术上的 对象<->表 之间的转换
- */
-@RestController
-@RequiredArgsConstructor
-@RequestMapping("/lattice_form" )
-@Api(value = "lattice_form", tags = "管理")
-public class LatticeFormController {
-
- private final LatticeFormService latticeFormService;
-
- /**
- * 通过id查询
- * @param latticeFormId id
- * @return R
- */
- @ApiOperation(value = "通过id查询", notes = "通过id查询")
- @GetMapping("/{latticeFormId}" )
- @PreAuthorize("@pms.hasPermission('reagent_lattice_form_get')" )
- public R getById(@PathVariable("latticeFormId" ) String latticeFormId, HttpServletRequest theHttpServletRequest) {
- Principal principal = theHttpServletRequest.getUserPrincipal();
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
-
- LatticeForm latticeForm = latticeFormService.getById(latticeFormId);
- return R.ok(latticeForm);
- //return R.ok(latticeFormService.getById(latticeFormId));
- }
-
- /**
- * 分页查询
- * @param page 分页对象
- * @param latticeForm
- * @return
- */
- @ApiOperation(value = "分页查询", notes = "分页查询")
- @GetMapping("/page" )
- @PreAuthorize("@pms.hasPermission('reagent_lattice_form_get')" )
- public R> getLatticeFormPage(Page page, LatticeForm latticeForm, HttpServletRequest theHttpServletRequest) {
- Principal principal = theHttpServletRequest.getUserPrincipal();
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
-
- IPage latticeFormSList = latticeFormService.page(page, Wrappers.query()
- .eq("create_by", dlpUser.getId())
- .orderByDesc("create_time")
- );
- return R.ok(latticeFormSList);
-// return R.ok(latticeFormService.page(page, Wrappers.query(latticeForm)));
- }
-
-
- /**
- * 新增
- * @param latticeForm
- * @return R
- */
- @ApiOperation(value = "新增", notes = "新增")
- @SysLog("新增" )
- @PostMapping
- @PreAuthorize("@pms.hasPermission('reagent_lattice_form_add')" )
- public R postAddObject(@RequestBody LatticeForm latticeForm, HttpServletRequest theHttpServletRequest) {
- Principal principal = theHttpServletRequest.getUserPrincipal();
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
-
- latticeForm.setLatticeFormId(IdWorker.get32UUID().toUpperCase());
- if (latticeFormService.save(latticeForm)) {
- return R.ok(latticeForm, "对象创建成功");
- }
- else {
- return R.failed(latticeForm, "对象创建失败");
- }
- }
-
- /**
- * 修改
- * @param latticeForm
- * @return R
- */
- @ApiOperation(value = "修改", notes = "修改")
- @SysLog("修改" )
- @PutMapping
- @PreAuthorize("@pms.hasPermission('reagent_lattice_form_edit')" )
- public R putUpdateById(@RequestBody LatticeForm latticeForm, HttpServletRequest theHttpServletRequest) {
- Principal principal = theHttpServletRequest.getUserPrincipal();
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
-
- if (latticeFormService.updateById(latticeForm)) {
- return R.ok(latticeForm, "保存对象成功");
- }
- else {
- return R.failed(latticeForm, "保存对象失败");
- }
- }
-
- /**
- * 通过id删除
- * @param latticeFormId id
- * @return R
- */
- @ApiOperation(value = "通过id删除", notes = "通过id删除")
- @SysLog("通过id删除" )
- @DeleteMapping("/{latticeFormId}" )
- @PreAuthorize("@pms.hasPermission('reagent_lattice_form_del')" )
- public R deleteById(@PathVariable String latticeFormId, HttpServletRequest theHttpServletRequest) {
- Principal principal = theHttpServletRequest.getUserPrincipal();
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
-
- LatticeForm oldLatticeForm = latticeFormService.getById(latticeFormId);
-
- if (latticeFormService.removeById(latticeFormId)) {
- return R.ok(oldLatticeForm, "对象删除成功");
- }
- else {
- return R.failed(oldLatticeForm, "对象删除失败");
- }
-
- }
-
-}
diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/OutgoingContentsController.java b/src/main/java/digital/laboratory/platform/reagent/controller/OutgoingContentsController.java
index b7e1992..368c01a 100644
--- a/src/main/java/digital/laboratory/platform/reagent/controller/OutgoingContentsController.java
+++ b/src/main/java/digital/laboratory/platform/reagent/controller/OutgoingContentsController.java
@@ -94,7 +94,7 @@ public class OutgoingContentsController {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
- outgoingContents.setOutgoingContentsId(IdWorker.get32UUID().toUpperCase());
+ outgoingContents.setId(IdWorker.get32UUID().toUpperCase());
if (outgoingContentsService.save(outgoingContents)) {
return R.ok(outgoingContents, "对象创建成功");
}
diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/PeriodVerificationImplementationController.java b/src/main/java/digital/laboratory/platform/reagent/controller/PeriodVerificationImplementationController.java
index 9dc87aa..a254888 100644
--- a/src/main/java/digital/laboratory/platform/reagent/controller/PeriodVerificationImplementationController.java
+++ b/src/main/java/digital/laboratory/platform/reagent/controller/PeriodVerificationImplementationController.java
@@ -72,10 +72,18 @@ public class PeriodVerificationImplementationController {
@ApiOperation(value = "分页查询", notes = "分页查询")
@GetMapping("/page" )
// @PreAuthorize("@pms.hasPermission('reagent_period_verification_implementation_get')" )
- public R> getPeriodVerificationImplementationPage(Page page, PeriodVerificationImplementation periodVerificationImplementation, HttpServletRequest theHttpServletRequest) {
+ public R> getPeriodVerificationImplementationPage(Page page, String name,PeriodVerificationImplementation periodVerificationImplementation, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
+ if (name!=null){
+
+ IPage periodVerificationImplementationSList = periodVerificationImplementationService.getPeriodVerificationImplementationVOPage(page, Wrappers.query()
+ .orderByDesc("create_time")
+ );
+ return R.ok(periodVerificationImplementationSList);
+ }
+
IPage periodVerificationImplementationSList = periodVerificationImplementationService.getPeriodVerificationImplementationVOPage(page, Wrappers.query()
.eq("create_by", dlpUser.getId())
.orderByDesc("create_time")
diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/PeriodVerificationPlanController.java b/src/main/java/digital/laboratory/platform/reagent/controller/PeriodVerificationPlanController.java
deleted file mode 100644
index 0c0b174..0000000
--- a/src/main/java/digital/laboratory/platform/reagent/controller/PeriodVerificationPlanController.java
+++ /dev/null
@@ -1,151 +0,0 @@
-package digital.laboratory.platform.reagent.controller;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.core.toolkit.IdWorker;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-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.entity.PeriodVerificationPlan;
-import digital.laboratory.platform.reagent.service.PeriodVerificationPlanService;
-import org.springframework.security.access.prepost.PreAuthorize;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import lombok.RequiredArgsConstructor;
-import org.springframework.security.oauth2.provider.OAuth2Authentication;
-import org.springframework.web.bind.annotation.*;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.security.Principal;
-
-/**
- * (标准物质期间核查计划和确认表)
- *
- * @author Zhang Xiaolong created at 2023-03-10
- * @describe (标准物质期间核查计划和确认表) 前端控制器
- *
- * 这是与表示层的接口, 不应该接业务逻辑写在这里, 业务逻辑应该写在 service 中
- * 这里写什么:
- * 为前端提供数据, 接受前端的数据
- * 为前端提供的数据, 从 service 取得后, 可以做一些适当的加工, 这种加工不是业务层面的, 只能是数据格式上, 为方便前端处理
- * 接受前端的数据, 每一个函数的参数可以先做一些整理后, 再调用 service 中的函数。这里对参数的整理, 应该只是格式上的, 而不能是业务上的
- * 数据层在 mapper 中, 数据层不涉及业务, 只管技术上的 对象<->表 之间的转换
- */
-@RestController
-@RequiredArgsConstructor
-@RequestMapping("/period_verification_plan" )
-@Api(value = "period_verification_plan", tags = "(标准物质期间核查计划和确认表)管理")
-public class PeriodVerificationPlanController {
-
- private final PeriodVerificationPlanService periodVerificationPlanService;
-
- /**
- * 通过id查询(标准物质期间核查计划和确认表)
- * @param periodVerificationPlanId id
- * @return R
- */
- @ApiOperation(value = "通过id查询", notes = "通过id查询")
- @GetMapping("/{periodVerificationPlanId}" )
- @PreAuthorize("@pms.hasPermission('reagent_period_verification_plan_get')" )
- public R getById(@PathVariable("periodVerificationPlanId" ) String periodVerificationPlanId, HttpServletRequest theHttpServletRequest) {
- Principal principal = theHttpServletRequest.getUserPrincipal();
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
-
- PeriodVerificationPlan periodVerificationPlan = periodVerificationPlanService.getById(periodVerificationPlanId);
- return R.ok(periodVerificationPlan);
- //return R.ok(periodVerificationPlanService.getById(periodVerificationPlanId));
- }
-
- /**
- * 分页查询
- * @param page 分页对象
- * @param periodVerificationPlan (标准物质期间核查计划和确认表)
- * @return
- */
- @ApiOperation(value = "分页查询", notes = "分页查询")
- @GetMapping("/page" )
- @PreAuthorize("@pms.hasPermission('reagent_period_verification_plan_get')" )
- public R> getPeriodVerificationPlanPage(Page page, PeriodVerificationPlan periodVerificationPlan, HttpServletRequest theHttpServletRequest) {
- Principal principal = theHttpServletRequest.getUserPrincipal();
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
-
- IPage periodVerificationPlanSList = periodVerificationPlanService.page(page, Wrappers.query()
- .eq("create_by", dlpUser.getId())
- .orderByDesc("create_time")
- );
- return R.ok(periodVerificationPlanSList);
-// return R.ok(periodVerificationPlanService.page(page, Wrappers.query(periodVerificationPlan)));
- }
-
-
- /**
- * 新增(标准物质期间核查计划和确认表)
- * @param periodVerificationPlan (标准物质期间核查计划和确认表)
- * @return R
- */
- @ApiOperation(value = "新增(标准物质期间核查计划和确认表)", notes = "新增(标准物质期间核查计划和确认表)")
- @SysLog("新增(标准物质期间核查计划和确认表)" )
- @PostMapping
- @PreAuthorize("@pms.hasPermission('reagent_period_verification_plan_add')" )
- public R postAddObject(@RequestBody PeriodVerificationPlan periodVerificationPlan, HttpServletRequest theHttpServletRequest) {
- Principal principal = theHttpServletRequest.getUserPrincipal();
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
-
- periodVerificationPlan.setPeriodVerificationPlanId(IdWorker.get32UUID().toUpperCase());
- if (periodVerificationPlanService.save(periodVerificationPlan)) {
- return R.ok(periodVerificationPlan, "对象创建成功");
- }
- else {
- return R.failed(periodVerificationPlan, "对象创建失败");
- }
- }
-
- /**
- * 修改(标准物质期间核查计划和确认表)
- * @param periodVerificationPlan (标准物质期间核查计划和确认表)
- * @return R
- */
- @ApiOperation(value = "修改(标准物质期间核查计划和确认表)", notes = "修改(标准物质期间核查计划和确认表)")
- @SysLog("修改(标准物质期间核查计划和确认表)" )
- @PutMapping
- @PreAuthorize("@pms.hasPermission('reagent_period_verification_plan_edit')" )
- public R putUpdateById(@RequestBody PeriodVerificationPlan periodVerificationPlan, HttpServletRequest theHttpServletRequest) {
- Principal principal = theHttpServletRequest.getUserPrincipal();
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
-
- if (periodVerificationPlanService.updateById(periodVerificationPlan)) {
- return R.ok(periodVerificationPlan, "保存对象成功");
- }
- else {
- return R.failed(periodVerificationPlan, "保存对象失败");
- }
- }
-
- /**
- * 通过id删除(标准物质期间核查计划和确认表)
- * @param periodVerificationPlanId id
- * @return R
- */
- @ApiOperation(value = "通过id删除(标准物质期间核查计划和确认表)", notes = "通过id删除(标准物质期间核查计划和确认表)")
- @SysLog("通过id删除(标准物质期间核查计划和确认表)" )
- @DeleteMapping("/{periodVerificationPlanId}" )
- @PreAuthorize("@pms.hasPermission('reagent_period_verification_plan_del')" )
- public R deleteById(@PathVariable String periodVerificationPlanId, HttpServletRequest theHttpServletRequest) {
- Principal principal = theHttpServletRequest.getUserPrincipal();
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
-
- PeriodVerificationPlan oldPeriodVerificationPlan = periodVerificationPlanService.getById(periodVerificationPlanId);
-
- if (periodVerificationPlanService.removeById(periodVerificationPlanId)) {
- return R.ok(oldPeriodVerificationPlan, "对象删除成功");
- }
- else {
- return R.failed(oldPeriodVerificationPlan, "对象删除失败");
- }
-
- }
-
-}
diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/ProvideServicesOrSuppliesController.java b/src/main/java/digital/laboratory/platform/reagent/controller/ProvideServicesOrSuppliesController.java
index a14afcb..724f5b4 100644
--- a/src/main/java/digital/laboratory/platform/reagent/controller/ProvideServicesOrSuppliesController.java
+++ b/src/main/java/digital/laboratory/platform/reagent/controller/ProvideServicesOrSuppliesController.java
@@ -9,6 +9,7 @@ import digital.laboratory.platform.common.log.annotation.SysLog;
import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
import digital.laboratory.platform.reagent.entity.ProvideServicesOrSupplies;
import digital.laboratory.platform.reagent.service.ProvideServicesOrSuppliesService;
+import digital.laboratory.platform.reagent.vo.ProvideServicesOrSuppliesVO;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -20,6 +21,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.security.Principal;
+import java.util.List;
/**
* 提供服务或供应品
@@ -44,108 +46,21 @@ public class ProvideServicesOrSuppliesController {
/**
* 通过id查询提供服务或供应品
- * @param provideServicesOrSuppliesId id
+ * @param supplierInformationId id
* @return R
*/
- @ApiOperation(value = "通过id查询", notes = "通过id查询")
- @GetMapping("/{provideServicesOrSuppliesId}" )
- @PreAuthorize("@pms.hasPermission('reagent_provide_services_or_supplies_get')" )
- public R getById(@PathVariable("provideServicesOrSuppliesId" ) String provideServicesOrSuppliesId, HttpServletRequest theHttpServletRequest) {
+ @ApiOperation(value = "通过供应商id查询该供应商提供的所有物品", notes = "通过供应商id查询该供应商提供的所有物品")
+ @GetMapping()
+// @PreAuthorize("@pms.hasPermission('reagent_provide_services_or_supplies_get')" )
+ public R> getById(String supplierInformationId, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
- ProvideServicesOrSupplies provideServicesOrSupplies = provideServicesOrSuppliesService.getById(provideServicesOrSuppliesId);
- return R.ok(provideServicesOrSupplies);
+ List voList = provideServicesOrSuppliesService.getVOList(supplierInformationId);
+ return R.ok(voList);
//return R.ok(provideServicesOrSuppliesService.getById(provideServicesOrSuppliesid));
}
- /**
- * 分页查询
- * @param page 分页对象
- * @param provideServicesOrSupplies 提供服务或供应品
- * @return
- */
- @ApiOperation(value = "分页查询", notes = "分页查询")
- @GetMapping("/page" )
- @PreAuthorize("@pms.hasPermission('reagent_provide_services_or_supplies_get')" )
- public R> getProvideServicesOrSuppliesPage(Page page, ProvideServicesOrSupplies provideServicesOrSupplies, HttpServletRequest theHttpServletRequest) {
- Principal principal = theHttpServletRequest.getUserPrincipal();
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
-
- IPage provideServicesOrSuppliesSList = provideServicesOrSuppliesService.page(page, Wrappers.query()
- .eq("create_by", dlpUser.getId())
- .orderByDesc("create_time")
- );
- return R.ok(provideServicesOrSuppliesSList);
-// return R.ok(provideServicesOrSuppliesService.page(page, Wrappers.query(provideServicesOrSupplies)));
- }
-
-
- /**
- * 新增提供服务或供应品
- * @param provideServicesOrSupplies 提供服务或供应品
- * @return R
- */
- @ApiOperation(value = "新增提供服务或供应品", notes = "新增提供服务或供应品")
- @SysLog("新增提供服务或供应品" )
- @PostMapping
- @PreAuthorize("@pms.hasPermission('reagent_provide_services_or_supplies_add')" )
- public R postAddObject(@RequestBody ProvideServicesOrSupplies provideServicesOrSupplies, HttpServletRequest theHttpServletRequest) {
- Principal principal = theHttpServletRequest.getUserPrincipal();
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
-
- provideServicesOrSupplies.setEvaluationFormId(IdWorker.get32UUID().toUpperCase());
- if (provideServicesOrSuppliesService.save(provideServicesOrSupplies)) {
- return R.ok(provideServicesOrSupplies, "对象创建成功");
- }
- else {
- return R.failed(provideServicesOrSupplies, "对象创建失败");
- }
- }
-
- /**
- * 修改提供服务或供应品
- * @param provideServicesOrSupplies 提供服务或供应品
- * @return R
- */
- @ApiOperation(value = "修改提供服务或供应品", notes = "修改提供服务或供应品")
- @SysLog("修改提供服务或供应品" )
- @PutMapping
- @PreAuthorize("@pms.hasPermission('reagent_provide_services_or_supplies_edit')" )
- public R putUpdateById(@RequestBody ProvideServicesOrSupplies provideServicesOrSupplies, HttpServletRequest theHttpServletRequest) {
- Principal principal = theHttpServletRequest.getUserPrincipal();
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
-
- if (provideServicesOrSuppliesService.updateById(provideServicesOrSupplies)) {
- return R.ok(provideServicesOrSupplies, "保存对象成功");
- }
- else {
- return R.failed(provideServicesOrSupplies, "保存对象失败");
- }
- }
-
- /**
- * 通过id删除提供服务或供应品
- * @param provideServicesOrSuppliesid id
- * @return R
- */
- @ApiOperation(value = "通过id删除提供服务或供应品", notes = "通过id删除提供服务或供应品")
- @SysLog("通过id删除提供服务或供应品" )
- @DeleteMapping("/{provideServicesOrSuppliesid}" )
- @PreAuthorize("@pms.hasPermission('reagent_provide_services_or_supplies_del')" )
- public R deleteById(@PathVariable String provideServicesOrSuppliesid, HttpServletRequest theHttpServletRequest) {
- Principal principal = theHttpServletRequest.getUserPrincipal();
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
-
- ProvideServicesOrSupplies oldProvideServicesOrSupplies = provideServicesOrSuppliesService.getById(provideServicesOrSuppliesid);
-
- if (provideServicesOrSuppliesService.removeById(provideServicesOrSuppliesid)) {
- return R.ok(oldProvideServicesOrSupplies, "对象删除成功");
- }
- else {
- return R.failed(oldProvideServicesOrSupplies, "对象删除失败");
- }
- }
}
diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/PurchaseCatalogueController.java b/src/main/java/digital/laboratory/platform/reagent/controller/PurchaseCatalogueController.java
index da4d843..b49dca1 100644
--- a/src/main/java/digital/laboratory/platform/reagent/controller/PurchaseCatalogueController.java
+++ b/src/main/java/digital/laboratory/platform/reagent/controller/PurchaseCatalogueController.java
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+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;
@@ -17,6 +18,7 @@ import digital.laboratory.platform.reagent.service.CatalogueDetailsService;
import digital.laboratory.platform.reagent.service.PurchaseCatalogueService;
import digital.laboratory.platform.reagent.vo.PurchaseCatalogueVO;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -27,6 +29,10 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
import javax.servlet.http.HttpServletRequest;
import java.security.Principal;
+import java.sql.Date;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.time.LocalDateTime;
import java.util.List;
/**
@@ -56,19 +62,18 @@ public class PurchaseCatalogueController {
* 分页查询
*
* @param
-
* @return
*/
@ApiOperation(value = "分页查询已发布的采购目录明细", notes = "分页查询已发布的采购目录明细")
@GetMapping("/page")
// @PreAuthorize("@pms.hasPermission('reagent_purchase_catalogue_getPage')")
- public R getPurchaseCataloguePage(HttpServletRequest theHttpServletRequest) {
+ public R getPurchaseCataloguePage(HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
- PurchaseCatalogueVO vOpage = purchaseCatalogueService.getVOpage();
+ Page vOpage = purchaseCatalogueService.getVOpage();
return R.ok(vOpage);
@@ -77,27 +82,25 @@ public class PurchaseCatalogueController {
/**
* 分页查询
*
- * @param page 分页对象
-
+ * @param page 分页对象
* @return
*/
@ApiOperation(value = "分页查询制定编辑的采购目录", notes = "分页查询制定编辑的采购目录")
@GetMapping("/pages")
// @PreAuthorize("@pms.hasPermission('reagent_purchase_catalogue_getPage')")
- public R> getPurchaseCatalogueVOPage(Page page, Integer status, HttpServletRequest theHttpServletRequest) {
+ public R> getPurchaseCatalogueVOPage(Page page, @JsonFormat(pattern = "yyyy-MM-dd") Date startTime, @JsonFormat(pattern = "yyyy-MM-dd") Date endTime, HttpServletRequest theHttpServletRequest) {
IPage purchaseCatalogueVOPage = purchaseCatalogueService.getPurchaseCatalogueVOPage(page, Wrappers.query().orderByDesc("create_time"));
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
- if (status!=null){
+ if (startTime != null && endTime != null) {
- IPage purchaseCatalogueVOPage1 = purchaseCatalogueService.getPurchaseCatalogueVOPage(page, Wrappers.query().eq("status",status).orderByDesc("create_time"));
+ IPage purchaseCatalogueVOPage1 = purchaseCatalogueService.getPurchaseCatalogueVOPage(page, Wrappers.query().ge("create_time", startTime).le("create_time", endTime).orderByDesc("create_time"));
- List records = purchaseCatalogueVOPage.getRecords();
-
- return R.ok(purchaseCatalogueVOPage1);}
+ return R.ok(purchaseCatalogueVOPage1);
+ }
return R.ok(purchaseCatalogueVOPage);
@@ -130,10 +133,6 @@ public class PurchaseCatalogueController {
}
-
-
-
-
/**
* 新增(采购目录)
*
@@ -153,7 +152,7 @@ public class PurchaseCatalogueController {
PurchaseCatalogue purchaseCatalogue = purchaseCatalogueService.addCatalogue(dlpUser, purchaseCatalogueDTOList);
- if (purchaseCatalogue!=null) {
+ if (purchaseCatalogue != null) {
return R.ok(purchaseCatalogue, "保存成功");
} else {
return R.failed(purchaseCatalogue, "保存失败");
@@ -178,7 +177,7 @@ public class PurchaseCatalogueController {
CatalogueDetails catalogueDetails = purchaseCatalogueService.editCatalogue(purchaseCatalogueDto);
- if (catalogueDetails!=null) {
+ if (catalogueDetails != null) {
return R.ok(catalogueDetails, "修改成功");
} else {
return R.failed(catalogueDetails, "修改失败");
@@ -203,7 +202,7 @@ public class PurchaseCatalogueController {
CatalogueDetails catalogueDetails = purchaseCatalogueService.addDetails(purchaseCatalogueDto);
- if (catalogueDetails!=null) {
+ if (catalogueDetails != null) {
return R.ok(catalogueDetails, "创建成功");
} else {
return R.failed(catalogueDetails, "创建失败");
@@ -220,7 +219,7 @@ public class PurchaseCatalogueController {
@SysLog("通过id删除采购目录")
@DeleteMapping("/catalogue")
// @PreAuthorize("@pms.hasPermission('reagent_purchase_catalogue_del')")
- public R deleteById( String purchaseCatalogueId, HttpServletRequest theHttpServletRequest) {
+ public R deleteById(String purchaseCatalogueId, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
@@ -228,9 +227,9 @@ public class PurchaseCatalogueController {
Boolean aBoolean = purchaseCatalogueService.delCatalogue(purchaseCatalogueId);
- if (aBoolean){
+ if (aBoolean) {
return R.ok("删除采购");
- }else return R.failed("删除失败");
+ } else return R.failed("删除失败");
}
@@ -252,9 +251,9 @@ public class PurchaseCatalogueController {
CatalogueDetails byId = catalogueDetailsService.getById(catalogueDetailsId);
- if (catalogueDetailsService.removeById(byId)){
- return R.ok(byId,"删除明细成功");
- }else {
+ if (catalogueDetailsService.removeById(byId)) {
+ return R.ok(byId, "删除明细成功");
+ } else {
return R.failed("删除失败");
}
}
@@ -269,17 +268,17 @@ public class PurchaseCatalogueController {
@SysLog("提交采购目录")
@PostMapping("/commit")
// @PreAuthorize("@pms.hasPermission('reagent_purchase_catalogue_commit')")
- public R commitById(@RequestBody List purchaseCatalogueDTOList , HttpServletRequest theHttpServletRequest) {
+ public R commitById(@RequestBody List purchaseCatalogueDTOList, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
- PurchaseCatalogue purchaseCatalogue = purchaseCatalogueService.commitById(purchaseCatalogueDTOList,dlpUser);
+ PurchaseCatalogue purchaseCatalogue = purchaseCatalogueService.commitById(purchaseCatalogueDTOList, dlpUser);
- if (purchaseCatalogue!=null){
- return R.ok(purchaseCatalogue,"提交成功");
- }else {
+ if (purchaseCatalogue != null) {
+ return R.ok(purchaseCatalogue, "提交成功");
+ } else {
return R.failed("提交失败");
}
}
@@ -300,11 +299,11 @@ public class PurchaseCatalogueController {
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
- PurchaseCatalogue purchaseCatalogue = purchaseCatalogueService.primaryAuditCatalogue(auditAndApproveDto,dlpUser);
+ PurchaseCatalogue purchaseCatalogue = purchaseCatalogueService.primaryAuditCatalogue(auditAndApproveDto, dlpUser);
- if (purchaseCatalogue!=null){
- return R.ok(purchaseCatalogue,"审核成功");
- }else {
+ if (purchaseCatalogue != null) {
+ return R.ok(purchaseCatalogue, "审核成功");
+ } else {
return R.failed("审核失败");
}
}
@@ -325,11 +324,11 @@ public class PurchaseCatalogueController {
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
- PurchaseCatalogue purchaseCatalogue = purchaseCatalogueService.secondaryAuditCatalogue(auditAndApproveDto,dlpUser);
+ PurchaseCatalogue purchaseCatalogue = purchaseCatalogueService.secondaryAuditCatalogue(auditAndApproveDto, dlpUser);
- if (purchaseCatalogue!=null){
- return R.ok(purchaseCatalogue,"审核成功");
- }else {
+ if (purchaseCatalogue != null) {
+ return R.ok(purchaseCatalogue, "审核成功");
+ } else {
return R.failed("审核失败");
}
}
@@ -342,18 +341,18 @@ public class PurchaseCatalogueController {
*/
@ApiOperation(value = "发布采购目录", notes = "发布采购目录")
@SysLog("发布采购目录")
- @PutMapping("/release/{purchaseCatalogueId}")
+ @PutMapping("/release")
// @PreAuthorize("@pms.hasPermission('reagent_purchase_catalogue_release')")
- public R releaseById(@PathVariable String purchaseCatalogueId, HttpServletRequest theHttpServletRequest) {
+ public R releaseById( String purchaseCatalogueId, HttpServletRequest theHttpServletRequest) {
PurchaseCatalogue purchaseCatalogue = purchaseCatalogueService.releaseCatalogue(purchaseCatalogueId);
- if (purchaseCatalogue!=null){
- return R.ok(purchaseCatalogue,"发布成功");
- }else {
+ if (purchaseCatalogue != null) {
+ return R.ok(purchaseCatalogue, "发布成功");
+ } else {
return R.failed("发布失败");
}
}
- }
+}
diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/PurchaseListController.java b/src/main/java/digital/laboratory/platform/reagent/controller/PurchaseListController.java
index 4ad63ff..3c87ad4 100644
--- a/src/main/java/digital/laboratory/platform/reagent/controller/PurchaseListController.java
+++ b/src/main/java/digital/laboratory/platform/reagent/controller/PurchaseListController.java
@@ -11,6 +11,8 @@ import digital.laboratory.platform.reagent.dto.PurchaseListDTO;
import digital.laboratory.platform.reagent.entity.PurchaseList;
import digital.laboratory.platform.reagent.entity.PurchaseListDetails;
import digital.laboratory.platform.reagent.service.PurchaseListService;
+import digital.laboratory.platform.reagent.vo.PurchaseListDetailsVO;
+import digital.laboratory.platform.reagent.vo.PurchaseListPageVO;
import digital.laboratory.platform.reagent.vo.PurchaseListVO;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.annotations.Api;
@@ -52,9 +54,9 @@ public class PurchaseListController {
* @return R
*/
@ApiOperation(value = "通过id查询", notes = "通过id查询")
- @GetMapping("/{purchaseListId}" )
+ @GetMapping( )
// @PreAuthorize("@pms.hasPermission('reagent_purchase_list_get')" )
- public R getById(@PathVariable("purchaseListId" ) String purchaseListId, HttpServletRequest theHttpServletRequest) {
+ public R getById(String purchaseListId, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
@@ -73,43 +75,66 @@ public class PurchaseListController {
*/
@ApiOperation(value = "分页查询", notes = "分页查询")
@GetMapping("/page" )
-// @PreAuthorize("@pms.hasPermission('reagent_purchase_list_get')" )
+// @PreAuthorize("@pms.hasPermission('reagent_purchase_list_page')" )
public R> getPurchaseListPage(Page page, PurchaseList purchaseList, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
IPage purchaseListSList = purchaseListService.page(page, Wrappers.query()
- .eq("create_by", dlpUser.getId())
.orderByDesc("create_time")
);
return R.ok(purchaseListSList);
// return R.ok(purchaseListService.page(page, Wrappers.query(purchaseList)));
}
-
/**
* 新增(采购清单)
- * @param purchaseListDTOList (采购清单)
+ * @param purchaseListDTO (采购清单)
* @return R
*/
- @ApiOperation(value = "新增采购清单", notes = "新增采购清单")
- @SysLog("新增采购清单" )
+ @ApiOperation(value = "修改采购清单明细", notes = "修改采购清单明细")
+ @SysLog("修改采购清单明细" )
@PostMapping
// @PreAuthorize("@pms.hasPermission('reagent_purchase_list_add')" )
- public R postAddObject(@RequestBody List purchaseListDTOList, HttpServletRequest theHttpServletRequest) {
+ public R postAddObject(@RequestBody PurchaseListDTO purchaseListDTO, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
- PurchaseList purchaseList = new PurchaseList();
+ PurchaseListDetailsVO purchaseListDetailsVO = purchaseListService.addDetails(purchaseListDTO);
- if (purchaseListService.addListById(purchaseListDTOList, purchaseList)!=null) {
- return R.ok(purchaseList, "创建成功");
+ if (purchaseListDetailsVO!=null) {
+ return R.ok(purchaseListDetailsVO, "保存成功");
}
else {
- return R.failed(purchaseList, "创建失败");
+ return R.failed(purchaseListDetailsVO, "保存失败");
}
- }}
+ }
+ /**
+ * 新增(采购清单)
+ * @param id (采购清单)
+ * @return R
+ */
+ @ApiOperation(value = "提交采购清单明细", notes = "提交采购清单明细")
+ @SysLog("提交采购清单明细" )
+ @PutMapping("/commit")
+// @PreAuthorize("@pms.hasPermission('reagent_purchase_list_commit)" )
+ public R commitById( String id, HttpServletRequest theHttpServletRequest) {
+
+ Principal principal = theHttpServletRequest.getUserPrincipal();
+
+ DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
+
+ PurchaseList purchaseList = purchaseListService.commitById(id);
+
+ if (purchaseList!=null) {
+ return R.ok(purchaseList, "提交成功");
+ }
+ else {
+ return R.failed(purchaseList, "提交失败");
+ }
+ }
+}
diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/PurchaseListDetailsController.java b/src/main/java/digital/laboratory/platform/reagent/controller/PurchaseListDetailsController.java
deleted file mode 100644
index 8729f62..0000000
--- a/src/main/java/digital/laboratory/platform/reagent/controller/PurchaseListDetailsController.java
+++ /dev/null
@@ -1,149 +0,0 @@
-package digital.laboratory.platform.reagent.controller;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.core.toolkit.IdWorker;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-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.entity.PurchaseListDetails;
-import digital.laboratory.platform.reagent.service.PurchaseListDetailsService;
-import org.springframework.security.access.prepost.PreAuthorize;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import lombok.RequiredArgsConstructor;
-import org.springframework.security.oauth2.provider.OAuth2Authentication;
-import org.springframework.web.bind.annotation.*;
-
-import javax.servlet.http.HttpServletRequest;
-import java.security.Principal;
-
-/**
- * (采购清单明细)
- *
- * @author Zhang Xiaolong created at 2023-03-10
- * @describe (采购清单明细) 前端控制器
- *
- * 这是与表示层的接口, 不应该接业务逻辑写在这里, 业务逻辑应该写在 service 中
- * 这里写什么:
- * 为前端提供数据, 接受前端的数据
- * 为前端提供的数据, 从 service 取得后, 可以做一些适当的加工, 这种加工不是业务层面的, 只能是数据格式上, 为方便前端处理
- * 接受前端的数据, 每一个函数的参数可以先做一些整理后, 再调用 service 中的函数。这里对参数的整理, 应该只是格式上的, 而不能是业务上的
- * 数据层在 mapper 中, 数据层不涉及业务, 只管技术上的 对象<->表 之间的转换
- */
-@RestController
-@RequiredArgsConstructor
-@RequestMapping("/purchaselist_details" )
-@Api(value = "purchaselist_details", tags = "(采购清单明细)管理")
-public class PurchaseListDetailsController {
-
- private final PurchaseListDetailsService purchaselistDetailsService;
-
- /**
- * 通过id查询(采购清单明细)
- * @param purchaselistDetailsId id
- * @return R
- */
- @ApiOperation(value = "通过id查询", notes = "通过id查询")
- @GetMapping("/{purchaselistDetailsId}" )
- @PreAuthorize("@pms.hasPermission('reagent_purchaselist_details_get')" )
- public R getById(@PathVariable("purchaselistDetailsId" ) String purchaselistDetailsId, HttpServletRequest theHttpServletRequest) {
- Principal principal = theHttpServletRequest.getUserPrincipal();
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
-
- PurchaseListDetails purchaselistDetails = purchaselistDetailsService.getById(purchaselistDetailsId);
- return R.ok(purchaselistDetails);
- //return R.ok(purchaselistDetailsService.getById(purchaselistDetailsId));
- }
-
- /**
- * 分页查询
- * @param page 分页对象
- * @param purchaselistDetails (采购清单明细)
- * @return
- */
- @ApiOperation(value = "分页查询", notes = "分页查询")
- @GetMapping("/page" )
- @PreAuthorize("@pms.hasPermission('reagent_purchaselist_details_get')" )
- public R> getPurchaselistDetailsPage(Page page, PurchaseListDetails purchaselistDetails, HttpServletRequest theHttpServletRequest) {
- Principal principal = theHttpServletRequest.getUserPrincipal();
- DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
-
- IPage purchaselistDetailsSList = purchaselistDetailsService.page(page, Wrappers.query()
- .eq("create_by", dlpUser.getId())
- .orderByDesc("create_time")
- );
- return R.ok(purchaselistDetailsSList);
-// return R.ok(purchaselistDetailsService.page(page, Wrappers.query(purchaselistDetails)));
- }
-
-
- /**
- * 新增(采购清单明细)
- * @param purchaselistDetails (采购清单明细)
- * @return R
- */
- @ApiOperation(value = "新增(采购清单明细)", notes = "新增(采购清单明细)")
- @SysLog("新增(采购清单明细)" )
- @PostMapping
- @PreAuthorize("@pms.hasPermission('reagent_purchaselist_details_add')" )
- public R