更新了数据库
This commit is contained in:
+28
-3
@@ -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,11 +6,12 @@ import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class ApplicationForUseDTO {
|
||||
|
||||
@ApiModelProperty(value = "(标准物质编号)")
|
||||
private String referenceMaterialId;
|
||||
private String referenceMaterialId;
|
||||
|
||||
@ApiModelProperty(value = "(备注)")
|
||||
private String remarks;
|
||||
@@ -36,4 +37,7 @@ public class ApplicationForUseDTO {
|
||||
@ApiModelProperty(value = "(批次ID)")
|
||||
private String batchDetailsId;
|
||||
|
||||
@ApiModelProperty(value = "(领用物品明细ID)")
|
||||
private String reagentConsumableSetId;
|
||||
|
||||
}
|
||||
|
||||
+20
-18
@@ -16,59 +16,59 @@ public class DecentralizedRequestDTO {
|
||||
@ApiModelProperty(value = "(类别)")
|
||||
|
||||
private String category;
|
||||
@ApiModelProperty(value="偏差/不确定度")
|
||||
@ApiModelProperty(value = "偏差/不确定度")
|
||||
|
||||
private String deviationOrUncertainty;
|
||||
|
||||
@ApiModelProperty(value="包装份数")
|
||||
@ApiModelProperty(value = "包装份数")
|
||||
|
||||
private String packagedCopies;
|
||||
|
||||
@ApiModelProperty(value="(数量)")
|
||||
@ApiModelProperty(value = "(数量)")
|
||||
|
||||
private Integer quantity;
|
||||
@ApiModelProperty(value="(种类)")
|
||||
@ApiModelProperty(value = "(种类)")
|
||||
|
||||
private String species;
|
||||
@ApiModelProperty(value="(试剂耗材ID)")
|
||||
@ApiModelProperty(value = "(试剂耗材ID)")
|
||||
|
||||
private String reagentConsumableId;
|
||||
@ApiModelProperty(value="(规格型号)")
|
||||
@ApiModelProperty(value = "(规格型号)")
|
||||
|
||||
private String specificationAndModel;
|
||||
@ApiModelProperty(value="(技术参数)")
|
||||
@ApiModelProperty(value = "(技术参数)")
|
||||
|
||||
private String technicalParameter;
|
||||
@ApiModelProperty(value="(标准值/纯度)")
|
||||
@ApiModelProperty(value = "(标准值/纯度)")
|
||||
|
||||
private String standardValueOrPurity;
|
||||
@ApiModelProperty(value="(用途)")
|
||||
@ApiModelProperty(value = "(用途)")
|
||||
private String purpose;
|
||||
@ApiModelProperty(value="(分散采购申请ID)")
|
||||
@ApiModelProperty(value = "(分散采购申请ID)")
|
||||
|
||||
private String decentralizedRequestId;
|
||||
@ApiModelProperty(value="(分散采购申请明细.ID)")
|
||||
@ApiModelProperty(value = "(分散采购申请明细.ID)")
|
||||
|
||||
private String decentralizeDetailsId;
|
||||
@ApiModelProperty(value="单价")
|
||||
@ApiModelProperty(value = "单价")
|
||||
|
||||
private Double unitPrice;
|
||||
@ApiModelProperty(value="(试剂耗材名称)")
|
||||
@ApiModelProperty(value = "(试剂耗材名称)")
|
||||
|
||||
private String reagentConsumableName;
|
||||
@ApiModelProperty(value="存储条件")
|
||||
@ApiModelProperty(value = "存储条件")
|
||||
|
||||
private String storageCondition;
|
||||
@ApiModelProperty(value="别名")
|
||||
@ApiModelProperty(value = "别名")
|
||||
|
||||
private String alias;
|
||||
@ApiModelProperty(value="备注")
|
||||
@ApiModelProperty(value = "备注")
|
||||
|
||||
private String remarks;
|
||||
@ApiModelProperty(value="(英文名)")
|
||||
@ApiModelProperty(value = "(英文名)")
|
||||
|
||||
private String englishName;
|
||||
@ApiModelProperty(value="包装单位")
|
||||
@ApiModelProperty(value = "包装单位")
|
||||
|
||||
private String minimumUnit;
|
||||
|
||||
@@ -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;
|
||||
/**
|
||||
* (英文名)
|
||||
*/
|
||||
|
||||
+48
-11
@@ -59,7 +59,10 @@ public class ApplicationForUseServiceImpl extends ServiceImpl<ApplicationForUseM
|
||||
|
||||
List<ReagentConsumablesSetVO> list = reagentConsumablesSetService.getList(applicationForUseId);
|
||||
|
||||
applicationForUseVO.setReagentConsumablesSetVOList(list);
|
||||
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.setId(IdWorker.get32UUID().toUpperCase());
|
||||
|
||||
applicationForUse.setStatus(0);
|
||||
|
||||
applicationForUse.setRecipientId(dlpUser.getId());
|
||||
}
|
||||
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">
|
||||
|
||||
Reference in New Issue
Block a user