更新了数据库

main
杨海航 2 years ago
parent b3e1f96fcd
commit 49a38af6e6
  1. 4396
      db/dlp_reagent_managment.sql
  2. 31
      src/main/java/digital/laboratory/platform/reagent/controller/ApplicationForUseController.java
  3. 4
      src/main/java/digital/laboratory/platform/reagent/dto/ApplicationForUseDTO.java
  4. 2
      src/main/java/digital/laboratory/platform/reagent/dto/DecentralizedRequestDTO.java
  5. 6
      src/main/java/digital/laboratory/platform/reagent/entity/DecentralizeDetails.java
  6. 49
      src/main/java/digital/laboratory/platform/reagent/service/impl/ApplicationForUseServiceImpl.java
  7. 1
      src/main/resources/mapper/DecentralizeDetailsMapper.xml

File diff suppressed because it is too large Load Diff

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

@ -6,6 +6,7 @@ import lombok.Data;
import java.time.LocalDateTime;
import java.util.List;
@Data
public class ApplicationForUseDTO {
@ -36,4 +37,7 @@ public class ApplicationForUseDTO {
@ApiModelProperty(value = "(批次ID)")
private String batchDetailsId;
@ApiModelProperty(value = "(领用物品明细ID)")
private String reagentConsumableSetId;
}

@ -78,4 +78,6 @@ public class DecentralizedRequestDTO {
private String code;
private String purityGrade;
}

@ -29,6 +29,12 @@ public class DecentralizeDetails extends BaseEntity {
*/
@ApiModelProperty(value="(品牌)")
private String brand;
/**
* (品牌)
*/
@ApiModelProperty(value="(纯度等级)")
private String purityGrade;
/**
* (英文名)
*/

@ -59,7 +59,10 @@ public class ApplicationForUseServiceImpl extends ServiceImpl<ApplicationForUseM
List<ReagentConsumablesSetVO> list = reagentConsumablesSetService.getList(applicationForUseId);
if (list != null && list.size() > 0) {
applicationForUseVO.setReagentConsumablesSetVOList(list);
}
return applicationForUseVO;
@ -90,20 +93,54 @@ public class ApplicationForUseServiceImpl extends ServiceImpl<ApplicationForUseM
@Override//创建领用申请表(试剂耗材领用、标准物质领用、标准溶液领用)
public ApplicationForUseVO addApplication(ApplicationForUseDTO applicationForUseDTO, DLPUser dlpUser) {
ApplicationForUse applicationForUse = new ApplicationForUse();
if (applicationForUseDTO.getApplicationForUseId() != null) {
ApplicationForUse byId = this.getById(applicationForUseDTO.getApplicationForUseId());
if (byId != null) {
ReagentConsumablesSet reagentConsumablesSet = new ReagentConsumablesSet();
BeanUtils.copyProperties(applicationForUseDTO, reagentConsumablesSet);
reagentConsumablesSet.setId(IdWorker.get32UUID().toUpperCase());
reagentConsumablesSet.setApplicationForUseId(byId.getId());
if (applicationForUseDTO.getReferenceMaterialId() != null) {
reagentConsumablesSet.setReferenceMaterialId(applicationForUseDTO.getReferenceMaterialId());
}
LambdaQueryWrapper<ReagentConsumableInventory> reagentConsumableInventoryLambdaQueryWrapper = new LambdaQueryWrapper<>();
reagentConsumableInventoryLambdaQueryWrapper.eq(ReagentConsumableInventory::getReagentConsumableId, applicationForUseDTO.getReagentConsumableId());
ReagentConsumableInventory one = reagentConsumableInventoryService.getOne(reagentConsumableInventoryLambdaQueryWrapper);
Integer totalQuantity = one.getTotalQuantity();
if (reagentConsumablesSet.getQuantity() > totalQuantity) {
throw new RuntimeException(String.format("领用数量不能大于库存量"));
}
if (reagentConsumablesSetService.save(reagentConsumablesSet)
) {
ApplicationForUseVO applicationForUseVO = this.getApplicationForUseVO(byId.getId());
return applicationForUseVO;
} else return null;
}
if (applicationForUseDTO.getApplicationForUseId() != null & (this.getById(applicationForUseDTO.getApplicationForUseId()) != null
)) {
applicationForUse = this.getById(applicationForUseDTO.getApplicationForUseId());
//录入领用申请表
} else {
}
ApplicationForUse applicationForUse = new ApplicationForUse();
applicationForUse.setId(IdWorker.get32UUID().toUpperCase());
applicationForUse.setStatus(0);
applicationForUse.setRecipientId(dlpUser.getId());
}
//录入领用申请内容
//生成领用登记表集合
ReagentConsumablesSet reagentConsumablesSet = new ReagentConsumablesSet();

@ -29,6 +29,7 @@
<result property="remark" column="remark"/>
<result property="casNumber" column="cas_number"/>
<result property="code" column="code"/>
<result property="purityGrade" column="purity_grade"/>
</resultMap>
<select id="getDecentralizeDetailsList" resultMap="decentralizeDetailsMap" resultType="digital.laboratory.platform.reagent.entity.DecentralizeDetails">

Loading…
Cancel
Save