parent
a6f72d9c4c
commit
48ab83a8f8
@ -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.AcceptanceContent; |
||||
import digital.laboratory.platform.reagent.service.AcceptanceContentService; |
||||
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("/acceptance_content" ) |
||||
@Api(value = "acceptance_content", tags = "(验收内容)管理") |
||||
public class AcceptanceContentController { |
||||
|
||||
private final AcceptanceContentService acceptanceContentService; |
||||
|
||||
/** |
||||
* 通过id查询(验收内容) |
||||
* @param acceptanceContentId id |
||||
* @return R |
||||
*/ |
||||
@ApiOperation(value = "通过id查询", notes = "通过id查询") |
||||
@GetMapping("/{acceptanceContentId}" ) |
||||
@PreAuthorize("@pms.hasPermission('reagent_acceptance_content_get')" ) |
||||
public R<AcceptanceContent> getById(@PathVariable("acceptanceContentId" ) String acceptanceContentId, HttpServletRequest theHttpServletRequest) { |
||||
Principal principal = theHttpServletRequest.getUserPrincipal(); |
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); |
||||
|
||||
AcceptanceContent acceptanceContent = acceptanceContentService.getById(acceptanceContentId); |
||||
return R.ok(acceptanceContent); |
||||
//return R.ok(acceptanceContentService.getById(acceptanceContentId));
|
||||
} |
||||
|
||||
/** |
||||
* 分页查询 |
||||
* @param page 分页对象 |
||||
* @param acceptanceContent (验收内容) |
||||
* @return |
||||
*/ |
||||
@ApiOperation(value = "分页查询", notes = "分页查询") |
||||
@GetMapping("/page" ) |
||||
@PreAuthorize("@pms.hasPermission('reagent_acceptance_content_get')" ) |
||||
public R<IPage<AcceptanceContent>> getAcceptanceContentPage(Page<AcceptanceContent> page, AcceptanceContent acceptanceContent, HttpServletRequest theHttpServletRequest) { |
||||
Principal principal = theHttpServletRequest.getUserPrincipal(); |
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); |
||||
|
||||
IPage<AcceptanceContent> acceptanceContentSList = acceptanceContentService.page(page, Wrappers.<AcceptanceContent>query() |
||||
.eq("create_by", dlpUser.getId()) |
||||
.orderByDesc("create_time") |
||||
); |
||||
return R.ok(acceptanceContentSList); |
||||
// return R.ok(acceptanceContentService.page(page, Wrappers.query(acceptanceContent)));
|
||||
} |
||||
|
||||
|
||||
/** |
||||
* 新增(验收内容) |
||||
* @param acceptanceContent (验收内容) |
||||
* @return R |
||||
*/ |
||||
@ApiOperation(value = "新增(验收内容)", notes = "新增(验收内容)") |
||||
@SysLog("新增(验收内容)" ) |
||||
@PostMapping |
||||
@PreAuthorize("@pms.hasPermission('reagent_acceptance_content_add')" ) |
||||
public R<AcceptanceContent> postAddObject(@RequestBody AcceptanceContent acceptanceContent, HttpServletRequest theHttpServletRequest) { |
||||
Principal principal = theHttpServletRequest.getUserPrincipal(); |
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); |
||||
|
||||
acceptanceContent.setAcceptanceContentId(IdWorker.get32UUID().toUpperCase()); |
||||
if (acceptanceContentService.save(acceptanceContent)) { |
||||
return R.ok(acceptanceContent, "对象创建成功"); |
||||
} |
||||
else { |
||||
return R.failed(acceptanceContent, "对象创建失败"); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 修改(验收内容) |
||||
* @param acceptanceContent (验收内容) |
||||
* @return R |
||||
*/ |
||||
@ApiOperation(value = "修改(验收内容)", notes = "修改(验收内容)") |
||||
@SysLog("修改(验收内容)" ) |
||||
@PutMapping |
||||
@PreAuthorize("@pms.hasPermission('reagent_acceptance_content_edit')" ) |
||||
public R<AcceptanceContent> putUpdateById(@RequestBody AcceptanceContent acceptanceContent, HttpServletRequest theHttpServletRequest) { |
||||
Principal principal = theHttpServletRequest.getUserPrincipal(); |
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); |
||||
|
||||
if (acceptanceContentService.updateById(acceptanceContent)) { |
||||
return R.ok(acceptanceContent, "保存对象成功"); |
||||
} |
||||
else { |
||||
return R.failed(acceptanceContent, "保存对象失败"); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 通过id删除(验收内容) |
||||
* @param acceptanceContentId id |
||||
* @return R |
||||
*/ |
||||
@ApiOperation(value = "通过id删除(验收内容)", notes = "通过id删除(验收内容)") |
||||
@SysLog("通过id删除(验收内容)" ) |
||||
@DeleteMapping("/{acceptanceContentId}" ) |
||||
@PreAuthorize("@pms.hasPermission('reagent_acceptance_content_del')" ) |
||||
public R<AcceptanceContent> deleteById(@PathVariable String acceptanceContentId, HttpServletRequest theHttpServletRequest) { |
||||
Principal principal = theHttpServletRequest.getUserPrincipal(); |
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); |
||||
|
||||
AcceptanceContent oldAcceptanceContent = acceptanceContentService.getById(acceptanceContentId); |
||||
|
||||
if (acceptanceContentService.removeById(acceptanceContentId)) { |
||||
return R.ok(oldAcceptanceContent, "对象删除成功"); |
||||
} |
||||
else { |
||||
return R.failed(oldAcceptanceContent, "对象删除失败"); |
||||
} |
||||
|
||||
} |
||||
|
||||
} |
@ -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.Blacklist; |
||||
import digital.laboratory.platform.reagent.service.BlacklistService; |
||||
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("/blacklist" ) |
||||
@Api(value = "blacklist", tags = "(试剂耗材黑名单)管理") |
||||
public class BlacklistController { |
||||
|
||||
private final BlacklistService blacklistService; |
||||
|
||||
/** |
||||
* 通过id查询(试剂耗材黑名单) |
||||
* @param blacklistId id |
||||
* @return R |
||||
*/ |
||||
@ApiOperation(value = "通过id查询", notes = "通过id查询") |
||||
@GetMapping("/{blacklistId}" ) |
||||
@PreAuthorize("@pms.hasPermission('reagent_blacklist_get')" ) |
||||
public R<Blacklist> getById(@PathVariable("blacklistId" ) String blacklistId, HttpServletRequest theHttpServletRequest) { |
||||
Principal principal = theHttpServletRequest.getUserPrincipal(); |
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); |
||||
|
||||
Blacklist blacklist = blacklistService.getById(blacklistId); |
||||
return R.ok(blacklist); |
||||
//return R.ok(blacklistService.getById(blacklistId));
|
||||
} |
||||
|
||||
/** |
||||
* 分页查询 |
||||
* @param page 分页对象 |
||||
* @param blacklist (试剂耗材黑名单) |
||||
* @return |
||||
*/ |
||||
@ApiOperation(value = "分页查询", notes = "分页查询") |
||||
@GetMapping("/page" ) |
||||
@PreAuthorize("@pms.hasPermission('reagent_blacklist_get')" ) |
||||
public R<IPage<Blacklist>> getBlacklistPage(Page<Blacklist> page, Blacklist blacklist, HttpServletRequest theHttpServletRequest) { |
||||
Principal principal = theHttpServletRequest.getUserPrincipal(); |
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); |
||||
|
||||
IPage<Blacklist> blacklistSList = blacklistService.page(page, Wrappers.<Blacklist>query() |
||||
.eq("create_by", dlpUser.getId()) |
||||
.orderByDesc("create_time") |
||||
); |
||||
return R.ok(blacklistSList); |
||||
// return R.ok(blacklistService.page(page, Wrappers.query(blacklist)));
|
||||
} |
||||
|
||||
|
||||
/** |
||||
* 新增(试剂耗材黑名单) |
||||
* @param blacklist (试剂耗材黑名单) |
||||
* @return R |
||||
*/ |
||||
@ApiOperation(value = "新增(试剂耗材黑名单)", notes = "新增(试剂耗材黑名单)") |
||||
@SysLog("新增(试剂耗材黑名单)" ) |
||||
@PostMapping |
||||
@PreAuthorize("@pms.hasPermission('reagent_blacklist_add')" ) |
||||
public R<Blacklist> postAddObject(@RequestBody Blacklist blacklist, HttpServletRequest theHttpServletRequest) { |
||||
Principal principal = theHttpServletRequest.getUserPrincipal(); |
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); |
||||
|
||||
blacklist.setBlacklistId(IdWorker.get32UUID().toUpperCase()); |
||||
if (blacklistService.save(blacklist)) { |
||||
return R.ok(blacklist, "对象创建成功"); |
||||
} |
||||
else { |
||||
return R.failed(blacklist, "对象创建失败"); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 修改(试剂耗材黑名单) |
||||
* @param blacklist (试剂耗材黑名单) |
||||
* @return R |
||||
*/ |
||||
@ApiOperation(value = "修改(试剂耗材黑名单)", notes = "修改(试剂耗材黑名单)") |
||||
@SysLog("修改(试剂耗材黑名单)" ) |
||||
@PutMapping |
||||
@PreAuthorize("@pms.hasPermission('reagent_blacklist_edit')" ) |
||||
public R<Blacklist> putUpdateById(@RequestBody Blacklist blacklist, HttpServletRequest theHttpServletRequest) { |
||||
Principal principal = theHttpServletRequest.getUserPrincipal(); |
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); |
||||
|
||||
if (blacklistService.updateById(blacklist)) { |
||||
return R.ok(blacklist, "保存对象成功"); |
||||
} |
||||
else { |
||||
return R.failed(blacklist, "保存对象失败"); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 通过id删除(试剂耗材黑名单) |
||||
* @param blacklistId id |
||||
* @return R |
||||
*/ |
||||
@ApiOperation(value = "通过id删除(试剂耗材黑名单)", notes = "通过id删除(试剂耗材黑名单)") |
||||
@SysLog("通过id删除(试剂耗材黑名单)" ) |
||||
@DeleteMapping("/{blacklistId}" ) |
||||
@PreAuthorize("@pms.hasPermission('reagent_blacklist_del')" ) |
||||
public R<Blacklist> 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, "对象删除失败"); |
||||
} |
||||
|
||||
} |
||||
|
||||
} |
@ -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<CatalogueDetails> 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<IPage<CatalogueDetails>> getCatalogueDetailsPage(Page<CatalogueDetails> page, CatalogueDetails catalogueDetails, HttpServletRequest theHttpServletRequest) { |
||||
Principal principal = theHttpServletRequest.getUserPrincipal(); |
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); |
||||
|
||||
IPage<CatalogueDetails> catalogueDetailsSList = catalogueDetailsService.page(page, Wrappers.<CatalogueDetails>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<CatalogueDetails> 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<CatalogueDetails> 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<CatalogueDetails> 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, "对象删除失败"); |
||||
} |
||||
|
||||
} |
||||
|
||||
} |
@ -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<CheckContent> 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<IPage<CheckContent>> getCheckContentPage(Page<CheckContent> page, CheckContent checkContent, HttpServletRequest theHttpServletRequest) { |
||||
Principal principal = theHttpServletRequest.getUserPrincipal(); |
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); |
||||
|
||||
IPage<CheckContent> checkContentSList = checkContentService.page(page, Wrappers.<CheckContent>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<CheckContent> 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<CheckContent> 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<CheckContent> 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, "对象删除失败"); |
||||
} |
||||
|
||||
} |
||||
|
||||
} |
@ -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<DecentralizeDetails> 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<IPage<DecentralizeDetails>> getDecentralizeDetailsPage(Page<DecentralizeDetails> page, DecentralizeDetails decentralizeDetails, HttpServletRequest theHttpServletRequest) { |
||||
Principal principal = theHttpServletRequest.getUserPrincipal(); |
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); |
||||
|
||||
IPage<DecentralizeDetails> decentralizeDetailsSList = decentralizeDetailsService.page(page, Wrappers.<DecentralizeDetails>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<DecentralizeDetails> 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<DecentralizeDetails> 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<DecentralizeDetails> 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, "对象删除失败"); |
||||
} |
||||
|
||||
} |
||||
|
||||
} |
@ -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<DetailsOfCentralized> 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<IPage<DetailsOfCentralized>> getDetailsOfCentralizedPage(Page<DetailsOfCentralized> page, DetailsOfCentralized detailsOfCentralized, HttpServletRequest theHttpServletRequest) { |
||||
Principal principal = theHttpServletRequest.getUserPrincipal(); |
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); |
||||
|
||||
IPage<DetailsOfCentralized> detailsOfCentralizedSList = detailsOfCentralizedService.page(page, Wrappers.<DetailsOfCentralized>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<DetailsOfCentralized> 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<DetailsOfCentralized> 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<DetailsOfCentralized> 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, "对象删除失败"); |
||||
} |
||||
|
||||
} |
||||
|
||||
} |
@ -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<LatticeForm> 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<IPage<LatticeForm>> getLatticeFormPage(Page<LatticeForm> page, LatticeForm latticeForm, HttpServletRequest theHttpServletRequest) { |
||||
Principal principal = theHttpServletRequest.getUserPrincipal(); |
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); |
||||
|
||||
IPage<LatticeForm> latticeFormSList = latticeFormService.page(page, Wrappers.<LatticeForm>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<LatticeForm> 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<LatticeForm> 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<LatticeForm> 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, "对象删除失败"); |
||||
} |
||||
|
||||
} |
||||
|
||||
} |
@ -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<PeriodVerificationPlan> 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<IPage<PeriodVerificationPlan>> getPeriodVerificationPlanPage(Page<PeriodVerificationPlan> page, PeriodVerificationPlan periodVerificationPlan, HttpServletRequest theHttpServletRequest) { |
||||
Principal principal = theHttpServletRequest.getUserPrincipal(); |
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); |
||||
|
||||
IPage<PeriodVerificationPlan> periodVerificationPlanSList = periodVerificationPlanService.page(page, Wrappers.<PeriodVerificationPlan>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<PeriodVerificationPlan> 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<PeriodVerificationPlan> 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<PeriodVerificationPlan> 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, "对象删除失败"); |
||||
} |
||||
|
||||
} |
||||
|
||||
} |
@ -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<PurchaseListDetails> 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<IPage<PurchaseListDetails>> getPurchaselistDetailsPage(Page<PurchaseListDetails> page, PurchaseListDetails purchaselistDetails, HttpServletRequest theHttpServletRequest) { |
||||
Principal principal = theHttpServletRequest.getUserPrincipal(); |
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); |
||||
|
||||
IPage<PurchaseListDetails> purchaselistDetailsSList = purchaselistDetailsService.page(page, Wrappers.<PurchaseListDetails>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<PurchaseListDetails> postAddObject(@RequestBody PurchaseListDetails purchaselistDetails, HttpServletRequest theHttpServletRequest) { |
||||
Principal principal = theHttpServletRequest.getUserPrincipal(); |
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); |
||||
|
||||
purchaselistDetails.setPurchaselistDetailsId(IdWorker.get32UUID().toUpperCase()); |
||||
if (purchaselistDetailsService.save(purchaselistDetails)) { |
||||
return R.ok(purchaselistDetails, "对象创建成功"); |
||||
} |
||||
else { |
||||
return R.failed(purchaselistDetails, "对象创建失败"); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 修改(采购清单明细) |
||||
* @param purchaselistDetails (采购清单明细) |
||||
* @return R |
||||
*/ |
||||
@ApiOperation(value = "修改(采购清单明细)", notes = "修改(采购清单明细)") |
||||
@SysLog("修改(采购清单明细)" ) |
||||
@PutMapping |
||||
@PreAuthorize("@pms.hasPermission('reagent_purchaselist_details_edit')" ) |
||||
public R<PurchaseListDetails> putUpdateById(@RequestBody PurchaseListDetails purchaselistDetails, HttpServletRequest theHttpServletRequest) { |
||||
Principal principal = theHttpServletRequest.getUserPrincipal(); |
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); |
||||
|
||||
if (purchaselistDetailsService.updateById(purchaselistDetails)) { |
||||
return R.ok(purchaselistDetails, "保存对象成功"); |
||||
} |
||||
else { |
||||
return R.failed(purchaselistDetails, "保存对象失败"); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 通过id删除(采购清单明细) |
||||
* @param purchaselistDetailsId id |
||||
* @return R |
||||
*/ |
||||
@ApiOperation(value = "通过id删除(采购清单明细)", notes = "通过id删除(采购清单明细)") |
||||
@SysLog("通过id删除(采购清单明细)" ) |
||||
@DeleteMapping("/{purchaselistDetailsId}" ) |
||||
@PreAuthorize("@pms.hasPermission('reagent_purchaselist_details_del')" ) |
||||
public R<PurchaseListDetails> deleteById(@PathVariable String purchaselistDetailsId, HttpServletRequest theHttpServletRequest) { |
||||
Principal principal = theHttpServletRequest.getUserPrincipal(); |
||||
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); |
||||
|
||||
PurchaseListDetails oldPurchaseListDetails = purchaselistDetailsService.getById(purchaselistDetailsId); |
||||
|
||||
if (purchaselistDetailsService.removeById(purchaselistDetailsId)) { |
||||
return R.ok(oldPurchaseListDetails, "对象删除成功"); |
||||
} |
||||
else { |
||||
return R.failed(oldPurchaseListDetails, "对象删除失败"); |
||||
} |
||||
|
||||
} |
||||
|
||||
} |
@ -1,12 +0,0 @@ |
||||
package digital.laboratory.platform.reagent.dto; |
||||
|
||||
import lombok.Data; |
||||
|
||||
@Data |
||||
public class AuditDecentralizedRequestDTO { |
||||
|
||||
private Boolean auditResult; |
||||
private String auditOpinion; |
||||
private Boolean haveCheck; |
||||
private String uuId; |
||||
} |
@ -1,25 +1,52 @@ |
||||
package digital.laboratory.platform.reagent.dto; |
||||
|
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
|
||||
import java.time.LocalDate; |
||||
import java.time.LocalDateTime; |
||||
@Data |
||||
public class PeriodVerificationImplementationDTO { |
||||
|
||||
@ApiModelProperty(value="(不满足应用要求原因分析)") |
||||
private String causeOfDissatisfaction; |
||||
private LocalDateTime checkingTime; |
||||
|
||||
@ApiModelProperty(value="(核查时间)") |
||||
private LocalDate checkingTime; |
||||
|
||||
@ApiModelProperty(value="(偏差/不确定度)") |
||||
private String deviationAndUncertainty; |
||||
|
||||
@ApiModelProperty(value="(核查实施情况及结果)") |
||||
private String implementationAndResults; |
||||
private String number; |
||||
|
||||
@ApiModelProperty(value="(标准物质编号)") |
||||
private String referenceMaterialNumber; |
||||
|
||||
@ApiModelProperty(value="(标准物质ID)") |
||||
private String referenceMaterialId; |
||||
|
||||
@ApiModelProperty(value="(标准物质名称)") |
||||
private String referenceMaterialName; |
||||
|
||||
@ApiModelProperty(value="(备注)") |
||||
private String remarks; |
||||
|
||||
@ApiModelProperty(value="(标准值/纯度)") |
||||
private String standardValueAndPurity; |
||||
|
||||
@ApiModelProperty(value="(核查方法)") |
||||
private String verificationMethod; |
||||
|
||||
@ApiModelProperty(value="(期间核查计划明细ID)") |
||||
private String periodVerificationPlanId; |
||||
|
||||
@ApiModelProperty(value="(核查人ID)") |
||||
private Integer opinionOfInspector; |
||||
private String result; |
||||
private String periodVerificationImplementationId; |
||||
|
||||
@ApiModelProperty(value="(标准物质期间核查实施情况及结果记录表ID)") |
||||
private String periodVerificationImplementationId; |
||||
|
||||
@ApiModelProperty(value="(核查结果:PDF)") |
||||
private String result; |
||||
} |
||||
|
@ -1,41 +0,0 @@ |
||||
package digital.laboratory.platform.reagent.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import digital.laboratory.platform.common.mybatis.base.BaseEntity; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import java.io.Serializable; |
||||
import java.time.LocalDateTime; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
|
||||
|
||||
/** |
||||
* (检查内容) |
||||
* |
||||
* @author Zhang Xiaolong created at 2023-03-10 14:25:06 |
||||
* @describe (检查内容) 实体类 |
||||
*/ |
||||
@Data |
||||
@TableName(value = "check_content", autoResultMap = true) |
||||
@EqualsAndHashCode(callSuper = true) |
||||
@ApiModel(value = "(检查内容)") |
||||
public class CheckContent extends BaseEntity { |
||||
|
||||
|
||||
|
||||
/** |
||||
* checkContentId |
||||
*/ |
||||
@TableId(value = "check_content_id", type = IdType.ASSIGN_UUID) |
||||
@ApiModelProperty(value="checkContentId") |
||||
private String checkContentId; |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} |
@ -1,22 +0,0 @@ |
||||
package digital.laboratory.platform.reagent.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import digital.laboratory.platform.reagent.entity.CheckContent; |
||||
import digital.laboratory.platform.reagent.vo.CheckContentVO; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
import org.apache.ibatis.annotations.Param; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* (检查内容) Mapper 接口 |
||||
* |
||||
* @author Zhang Xiaolong created at 2023-03-10 |
||||
* @describe (检查内容) Mapper 类 |
||||
*/ |
||||
@Mapper |
||||
public interface CheckContentMapper extends BaseMapper<CheckContent> { |
||||
|
||||
List<CheckContentVO> getCheckContentVOList (String complianceCheckId); |
||||
|
||||
} |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue