更新数据库,支持批量验收

main
杨海航 2 years ago
parent 002e48e312
commit 2d22c458d7
  1. 8
      pom.xml
  2. 78
      src/main/java/digital/laboratory/platform/reagent/controller/AcceptanceRecordFormController.java
  3. 6
      src/main/java/digital/laboratory/platform/reagent/controller/ApplicationForUseController.java
  4. 3
      src/main/java/digital/laboratory/platform/reagent/entity/AcceptanceRecordForm.java
  5. 4
      src/main/java/digital/laboratory/platform/reagent/entity/ApplicationForUse.java
  6. 10
      src/main/java/digital/laboratory/platform/reagent/entity/WarehousingContent.java
  7. 2
      src/main/java/digital/laboratory/platform/reagent/mapper/AcceptanceRecordFormMapper.java
  8. 11
      src/main/java/digital/laboratory/platform/reagent/service/AcceptanceRecordFormService.java
  9. 103
      src/main/java/digital/laboratory/platform/reagent/service/impl/AcceptanceRecordFormServiceImpl.java
  10. 4
      src/main/java/digital/laboratory/platform/reagent/service/impl/ApplicationForUseServiceImpl.java
  11. 12
      src/main/java/digital/laboratory/platform/reagent/service/impl/CatalogueDetailsServiceImpl.java
  12. 1
      src/main/java/digital/laboratory/platform/reagent/service/impl/CentralizedRequestServiceImpl.java
  13. 15
      src/main/java/digital/laboratory/platform/reagent/service/impl/PurchaseListServiceImpl.java
  14. 2
      src/main/java/digital/laboratory/platform/reagent/service/impl/ReviewAndApproveServiceImpl.java
  15. 8
      src/main/java/digital/laboratory/platform/reagent/service/impl/StandardReserveSolutionServiceImpl.java
  16. 2
      src/main/java/digital/laboratory/platform/reagent/service/impl/StandardSolutionCurveServiceImpl.java
  17. 61
      src/main/java/digital/laboratory/platform/reagent/service/impl/WarehousingRecordFormServiceImpl.java
  18. 2
      src/main/java/digital/laboratory/platform/reagent/vo/WarehousingContentVO.java
  19. 18
      src/main/resources/bootstrap.yml
  20. 2
      src/main/resources/mapper/AcceptanceRecordFormMapper.xml
  21. 2
      src/main/resources/mapper/ApplicationForUseMapper.xml
  22. 3
      src/main/resources/mapper/WarehousingContentMapper.xml

@ -163,14 +163,6 @@
<artifactId>spring-test</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jms</artifactId>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-client</artifactId>
</dependency>
<dependency>
<groupId>digital.laboratory.platform</groupId>

@ -11,6 +11,7 @@ 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.common.oss.service.OssFile;
import digital.laboratory.platform.reagent.dto.AcceptanceRecordFormAuditDTO;
import digital.laboratory.platform.reagent.dto.AcceptanceRecordFormDTO;
import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO;
import digital.laboratory.platform.reagent.entity.*;
@ -53,6 +54,8 @@ import java.util.List;
@Api(value = "acceptance_record_form", tags = "(验收记录表)管理")
public class AcceptanceRecordFormController {
private final AcceptanceSignForService acceptanceSignForService;
private final AcceptanceRecordFormService acceptanceRecordFormService;
private final ReagentConsumablesService reagentConsumablesService;
@ -107,7 +110,7 @@ public class AcceptanceRecordFormController {
@ApiOperation(value = "分页查询验收任务", notes = "分页查询验收任务")
@GetMapping("/page")
@PreAuthorize("@pms.hasPermission('reagent_acceptance_record_form_page')")
public R<IPage<AcceptanceRecordFormVO>> getAcceptanceRecordFormPage(Page<AcceptanceRecordForm> page, Integer status, String reagentConsumableName, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate startTime, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate endTime, HttpServletRequest theHttpServletRequest) {
public R<IPage<AcceptanceRecordFormVO>> getAcceptanceRecordFormPage(Page<AcceptanceRecordForm> page, Integer status, String reagentConsumableName, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate startTime, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate endTime, HttpServletRequest theHttpServletRequest, String acceptanceSignForId) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
@ -115,39 +118,14 @@ public class AcceptanceRecordFormController {
.like(StrUtil.isNotBlank(reagentConsumableName), "reagent_consumable_name", reagentConsumableName)
.ge(startTime != null, "create_time", startTime)
.le(endTime != null, "create_time", endTime)
.ne("status", 4)
.eq(status != null, "status", status)
.orderByDesc("create_time")
);
, acceptanceSignForId);
return R.ok(acceptanceRecordFormVOPage);
// return R.ok(acceptanceRecordFormService.page(page, Wrappers.query(acceptanceRecordForm)));
}
/**
* 分页查询
*
* @param page 分页对象
* @param reagentConsumableName (验收记录表)
* @return
*/
@ApiOperation(value = "分页查询验收记录", notes = "分页查询验收记录")
@GetMapping("/recordPage")
@PreAuthorize("@pms.hasPermission('reagent_acceptance_record_form_recordPage')")
public R<IPage<AcceptanceRecordFormVO>> getAcceptanceRecordFormRecordPage(Page<AcceptanceRecordForm> page, String rid, String reagentConsumableName, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate startTime, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate endTime, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
IPage<AcceptanceRecordFormVO> acceptanceRecordFormVOPage = acceptanceRecordFormService.getAcceptanceRecordFormVOPage(page, Wrappers.<AcceptanceRecordForm>query()
.like(StrUtil.isNotBlank(reagentConsumableName), "reagent_consumable_name", reagentConsumableName)
.eq("status", 4)
.ge(startTime != null, "create_time", startTime)
.le(endTime != null, "create_time", endTime)
);
return R.ok(acceptanceRecordFormVOPage);
// return R.ok(acceptanceRecordFormService.page(page, Wrappers.query(acceptanceRecordForm)));
}
/**
@ -195,63 +173,60 @@ public class AcceptanceRecordFormController {
/**
* 一级审核(验收记录表)
*
* @param auditAndApproveDTO (验收记录表)
* @param acceptanceRecordFormAuditDTO (验收记录表)
* @return R
*/
@ApiOperation(value = "一级审核(验收记录表)", notes = "一级审核(验收记录表)")
@SysLog("一级审核(验收记录表)")
@PutMapping("/primary")
@PreAuthorize("@pms.hasPermission('reagent_acceptance_record_form_primary')")
public R<AcceptanceRecordForm> primaryAudit(@RequestBody AuditAndApproveDTO auditAndApproveDTO, HttpServletRequest theHttpServletRequest) {
public R<String> primaryAudit(@RequestBody AcceptanceRecordFormAuditDTO acceptanceRecordFormAuditDTO, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
AcceptanceRecordForm acceptanceRecordForm = acceptanceRecordFormService.primaryAudit(auditAndApproveDTO, dlpUser);
if (acceptanceRecordForm != null) {
return R.ok(acceptanceRecordForm, "审核成功");
if (acceptanceRecordFormService.primaryAudit(acceptanceRecordFormAuditDTO, dlpUser)) {
return R.ok("审核成功");
} else return R.failed("审核失败");
}
/**
* 二级审核(验收记录表)
*
* @param auditAndApproveDTO (验收记录表)
* @param acceptanceRecordFormAuditDTO (验收记录表)
* @return R
*/
@ApiOperation(value = "二级审核(验收记录表)", notes = "二级审核(验收记录表)")
@SysLog("二级审核(验收记录表)")
@PutMapping("/secondary")
@PreAuthorize("@pms.hasPermission('reagent_acceptance_record_form_secondary')")
public R<AcceptanceRecordForm> secondaryAudit(@RequestBody AuditAndApproveDTO auditAndApproveDTO, HttpServletRequest theHttpServletRequest) {
public R<String> secondaryAudit(@RequestBody AcceptanceRecordFormAuditDTO acceptanceRecordFormAuditDTO, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
AcceptanceRecordForm acceptanceRecordForm = acceptanceRecordFormService.secondaryAudit(auditAndApproveDTO, dlpUser);
if (acceptanceRecordForm != null) {
return R.ok(acceptanceRecordForm, "审核成功");
if (acceptanceRecordFormService.secondaryAudit(acceptanceRecordFormAuditDTO, dlpUser)) {
return R.ok("审核成功");
} else return R.failed("审核失败");
}
/**
* 三级审核(验收记录表)
*
* @param auditAndApproveDTO (验收记录表)
* @param acceptanceRecordFormAuditDTO (验收记录表)
* @return R
*/
@ApiOperation(value = "三级审核(验收记录表)", notes = "三级审核(验收记录表)")
@SysLog("三级审核(验收记录表)")
@PutMapping("/three_level")
@PreAuthorize("@pms.hasPermission('reagent_acceptance_record_form_threeLevel')")
public R<AcceptanceRecordForm> threeLevelAudit(@RequestBody AuditAndApproveDTO auditAndApproveDTO, HttpServletRequest theHttpServletRequest) {
public R<String> threeLevelAudit(@RequestBody AcceptanceRecordFormAuditDTO acceptanceRecordFormAuditDTO, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
AcceptanceRecordForm acceptanceRecordForm = acceptanceRecordFormService.threeLevelAudit(auditAndApproveDTO, dlpUser);
if (acceptanceRecordForm != null) {
return R.ok(acceptanceRecordForm, "审核成功");
if (acceptanceRecordFormService.threeLevelAudit(acceptanceRecordFormAuditDTO, dlpUser)) {
return R.ok("审核成功");
} else return R.failed("审核失败");
}
@ -298,4 +273,23 @@ public class AcceptanceRecordFormController {
}
}
/**
* 分页查询
*
* @param page 分页对象
* @return
*/
@ApiOperation(value = "分页查询验收集合主表", notes = "分页查询验收集合主表")
@GetMapping("/acceptanceSignFor/Page")
@PreAuthorize("@pms.hasPermission('reagent_acceptance_record_form_recordPage')")
public R<IPage<AcceptanceSignFor>> getacceptanceSignForPage(Page<AcceptanceSignFor> page, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate startTime, @DateTimeFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd") LocalDate endTime, String acceptanceSignForId, HttpServletRequest theHttpServletRequest) {
Principal principal = theHttpServletRequest.getUserPrincipal();
DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal();
IPage<AcceptanceSignFor> page1 = acceptanceSignForService.page(page);
return R.ok(page1);
// return R.ok(acceptanceRecordFormService.page(page, Wrappers.query(acceptanceRecordForm)));
}
}

@ -241,9 +241,9 @@ public class ApplicationForUseController {
* @param id (批量提交试剂耗材领用申请表)
* @return R
*/
@ApiOperation(value = "通过实验模板ID查询领用情况", notes = "通过实验模板ID查询领用情况")
@SysLog("通过实验模板ID查询领用情况")
@GetMapping("/get/template")
@ApiOperation(value = "通过实验ID查询领用情况", notes = "通过实验ID查询领用情况")
@SysLog("通过实验ID查询领用情况")
@GetMapping("/get/experiment")
@PreAuthorize("@pms.hasPermission('reagent_application_for_use_get')")
public R<List<ReagentConsumablesSetVO>> getReagentConsumablesSets(String id, HttpServletRequest theHttpServletRequest) {

@ -218,5 +218,8 @@ public class AcceptanceRecordForm extends BaseEntity {
@ApiModelProperty(value = "(验收人名称)")
private String userName;
@ApiModelProperty(value = "(验收中间表ID)")
private String acceptanceSignForId;
}

@ -74,8 +74,8 @@ public class ApplicationForUse extends BaseEntity {
/**
* 实验模板ID
*/
@ApiModelProperty(value="实验模板ID")
private String templateId;
@ApiModelProperty(value="实验ID")
private String experimentId;
}

@ -83,5 +83,15 @@ public class WarehousingContent extends BaseEntity {
@ApiModelProperty(value = "预警值")
private Integer warningValue;
@ApiModelProperty(value = "上次存放位置")
private String lastStorageLocation;
@ApiModelProperty(value="格子ID")
private String latticeId;
@ApiModelProperty(value="柜子ID")
private String boxId;
}

@ -18,7 +18,7 @@ import org.apache.ibatis.annotations.Param;
@Mapper
public interface AcceptanceRecordFormMapper extends BaseMapper<AcceptanceRecordForm> {
IPage<AcceptanceRecordFormVO> getAcceptanceRecordFormVOPage(IPage<AcceptanceRecordForm> page, @Param(Constants.WRAPPER)QueryWrapper<AcceptanceRecordForm> qw);
IPage<AcceptanceRecordFormVO> getAcceptanceRecordFormVOPage(IPage<AcceptanceRecordForm> page, @Param(Constants.WRAPPER)QueryWrapper<AcceptanceRecordForm> qw,String acceptanceSignForId);
AcceptanceRecordFormVO getAcceptanceRecordFormVO(String acceptanceRecordFormId);
}

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
import digital.laboratory.platform.reagent.dto.AcceptanceRecordFormAuditDTO;
import digital.laboratory.platform.reagent.dto.AcceptanceRecordFormDTO;
import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO;
import digital.laboratory.platform.reagent.entity.AcceptanceRecordForm;
@ -27,19 +28,19 @@ public interface AcceptanceRecordFormService extends IService<AcceptanceRecordFo
AcceptanceRecordForm commitForm(AcceptanceRecordFormDTO acceptanceRecordFormDTO, DLPUser dlpUser);
AcceptanceRecordForm addForm(String reagentConsumableId, String supplierId);
AcceptanceRecordForm addForm(String reagentConsumableId, String supplierId,String acceptanceSignForId);
IPage<AcceptanceRecordFormVO> getAcceptanceRecordFormVOPage(IPage<AcceptanceRecordForm> page, QueryWrapper<AcceptanceRecordForm>qw);
IPage<AcceptanceRecordFormVO> getAcceptanceRecordFormVOPage(IPage<AcceptanceRecordForm> page, QueryWrapper<AcceptanceRecordForm>qw,String acceptanceSignForId);
IPage<AcceptanceRecordFormVO> getAcceptanceRecordFormVORecordPage(IPage<AcceptanceRecordForm> page);
AcceptanceRecordFormVO getAcceptanceRecordFormVO(String acceptanceRecordFormId);
AcceptanceRecordForm primaryAudit(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser);
boolean primaryAudit(AcceptanceRecordFormAuditDTO acceptanceRecordFormAuditDTO, DLPUser dlpUser);
AcceptanceRecordForm secondaryAudit(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser);
boolean secondaryAudit(AcceptanceRecordFormAuditDTO acceptanceRecordFormAuditDTO, DLPUser dlpUser);
AcceptanceRecordForm threeLevelAudit(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser);
boolean threeLevelAudit(AcceptanceRecordFormAuditDTO acceptanceRecordFormAuditDTO, DLPUser dlpUser);
void acceptanceRecordFormTablePDF(AcceptanceRecordFormVO acceptanceRecordFormVO, HttpServletRequest theHttpServletRequest, HttpServletResponse httpServletResponse) throws Exception;
}

@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
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;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.deepoove.poi.XWPFTemplate;
@ -15,16 +16,18 @@ import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
import digital.laboratory.platform.common.feign.RemoteWord2PDFService;
import digital.laboratory.platform.common.mybatis.security.service.DLPUser;
import digital.laboratory.platform.common.oss.service.OssFile;
import digital.laboratory.platform.reagent.dto.AcceptanceRecordFormAuditDTO;
import digital.laboratory.platform.reagent.entity.WarehousingRecordForm;
import digital.laboratory.platform.reagent.service.*;
import digital.laboratory.platform.reagent.utils.PageUtils;
import digital.laboratory.platform.reagent.dto.AcceptanceRecordFormDTO;
import digital.laboratory.platform.reagent.dto.AuditAndApproveDTO;
import digital.laboratory.platform.reagent.entity.AcceptanceRecordForm;
import digital.laboratory.platform.reagent.entity.ReagentConsumables;
import digital.laboratory.platform.reagent.mapper.AcceptanceRecordFormMapper;
import digital.laboratory.platform.reagent.service.AcceptanceRecordFormService;
import digital.laboratory.platform.reagent.service.BlacklistService;
import digital.laboratory.platform.reagent.service.ReagentConsumablesService;
import digital.laboratory.platform.reagent.vo.AcceptanceRecordFormFullVO;
import digital.laboratory.platform.reagent.vo.AcceptanceRecordFormVO;
import digital.laboratory.platform.reagent.vo.WarehousingContentVO;
import feign.Response;
import org.apache.commons.io.output.ByteArrayOutputStream;
import org.springframework.beans.BeanUtils;
@ -57,12 +60,18 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor
@Autowired
private ReagentConsumablesService reagentConsumablesService;
@Autowired
private WarehousingContentService warehousingContentService;
@Autowired
private OssFile ossFile;
@Autowired
private RemoteWord2PDFService remoteWord2PDFService;
@Autowired
private WarehousingRecordFormService warehousingRecordFormService;
@Transactional
@Override
public void culkCommit(List<AcceptanceRecordFormDTO> acceptanceRecordFormDTOList, DLPUser dlpUser) {
@ -95,7 +104,8 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor
} else {
throw new RuntimeException(String.format("重新提交失败"));
}
} if (byId.getStatus() == -3) {
}
if (byId.getStatus() == -3) {
BeanUtils.copyProperties(acceptanceRecordFormDTO, byId);
byId.setUserName(dlpUser.getName());
@ -116,7 +126,8 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor
} else {
throw new RuntimeException(String.format("重新提交失败"));
}
} if (byId.getStatus() == -4) {
}
if (byId.getStatus() == -4) {
BeanUtils.copyProperties(acceptanceRecordFormDTO, byId);
byId.setUserName(dlpUser.getName());
@ -156,7 +167,7 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor
}
@Override
public AcceptanceRecordForm addForm(String reagentConsumableId, String supplierId) {
public AcceptanceRecordForm addForm(String reagentConsumableId, String supplierId, String acceptanceSignForId) {
AcceptanceRecordForm acceptanceRecordForm = new AcceptanceRecordForm();
@ -164,6 +175,8 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor
acceptanceRecordForm.setSupplierId(supplierId);
acceptanceRecordForm.setAcceptanceSignForId(acceptanceSignForId);
acceptanceRecordForm.setReagentConsumableId(reagentConsumableId);
ReagentConsumables byId = reagentConsumablesService.getById(reagentConsumableId);
@ -180,9 +193,9 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor
}
@Override
public IPage<AcceptanceRecordFormVO> getAcceptanceRecordFormVOPage(IPage<AcceptanceRecordForm> page, QueryWrapper<AcceptanceRecordForm>qw) {
public IPage<AcceptanceRecordFormVO> getAcceptanceRecordFormVOPage(IPage<AcceptanceRecordForm> page, QueryWrapper<AcceptanceRecordForm> qw,String acceptanceSignForId) {
IPage<AcceptanceRecordFormVO> acceptanceRecordFormVOPage = baseMapper.getAcceptanceRecordFormVOPage(page,qw);
IPage<AcceptanceRecordFormVO> acceptanceRecordFormVOPage = baseMapper.getAcceptanceRecordFormVOPage(page, qw,acceptanceSignForId);
List<AcceptanceRecordFormVO> records = acceptanceRecordFormVOPage.getRecords();
@ -236,64 +249,90 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor
}
@Override//一级审核
public AcceptanceRecordForm primaryAudit(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser) {
@Transactional
public boolean primaryAudit(AcceptanceRecordFormAuditDTO acceptanceRecordFormAuditDTO, DLPUser dlpUser) {
List<String> uuId = acceptanceRecordFormAuditDTO.getUuId();
AcceptanceRecordForm byId = this.getById(auditAndApproveDTO.getUuId());
List<AcceptanceRecordForm> acceptanceRecordForms = new ArrayList<>();
for (String s : uuId) {
AcceptanceRecordForm byId = this.getById(s);
if (byId.getStatus() != 1) {
throw new RuntimeException(String.format("当前状态不能审核"));
}
byId.setPrimaryAuditorId(dlpUser.getId());
byId.setAuditOpinionOfPrimary(auditAndApproveDTO.getAuditOpinion());
byId.setAuditOpinionOfPrimary(acceptanceRecordFormAuditDTO.getAuditOpinion());
byId.setAuditTimeOfPrimary(LocalDateTime.now());
byId.setAuditResultOfPrimary(auditAndApproveDTO.getAuditResult());
byId.setAuditResultOfPrimary(acceptanceRecordFormAuditDTO.getAuditResult());
if (auditAndApproveDTO.getAuditResult() == true) {
if (acceptanceRecordFormAuditDTO.getAuditResult() == true) {
byId.setStatus(2);
} else byId.setStatus(-2);
acceptanceRecordForms.add(byId);
if (this.updateById(byId)) {
return byId;
}
if (this.updateBatchById(acceptanceRecordForms)) {
return true;
} else throw new RuntimeException(String.format("审核失败"));
}
@Override//二级审核
public AcceptanceRecordForm secondaryAudit(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser) {
@Transactional
public boolean secondaryAudit(AcceptanceRecordFormAuditDTO acceptanceRecordFormAuditDTO, DLPUser dlpUser) {
AcceptanceRecordForm byId = this.getById(auditAndApproveDTO.getUuId());
List<String> uuId = acceptanceRecordFormAuditDTO.getUuId();
List<AcceptanceRecordForm> acceptanceRecordForms = new ArrayList<>();
for (String s : uuId) {
AcceptanceRecordForm byId = this.getById(s);
if (byId.getStatus() != 2) {
throw new RuntimeException(String.format("当前状态不能审核"));
}
byId.setSecondaryAuditorId(dlpUser.getId());
byId.setAuditOpinionOfSecondary(auditAndApproveDTO.getAuditOpinion());
byId.setAuditOpinionOfSecondary(acceptanceRecordFormAuditDTO.getAuditOpinion());
byId.setAuditTimeOfSecondary(LocalDateTime.now());
byId.setAuditResultOfSecondary(auditAndApproveDTO.getAuditResult());
byId.setAuditResultOfSecondary(acceptanceRecordFormAuditDTO.getAuditResult());
if (auditAndApproveDTO.getAuditResult() == true) {
if (acceptanceRecordFormAuditDTO.getAuditResult() == true) {
byId.setStatus(3);
} else byId.setStatus(-3);
if (this.updateById(byId)) {
return byId;
acceptanceRecordForms.add(byId);
}
if (this.updateBatchById(acceptanceRecordForms)) {
return true;
} else throw new RuntimeException(String.format("审核失败"));
}
@Override//三级审核
public AcceptanceRecordForm threeLevelAudit(AuditAndApproveDTO auditAndApproveDTO, DLPUser dlpUser) {
@Transactional
public boolean threeLevelAudit(AcceptanceRecordFormAuditDTO acceptanceRecordFormAuditDTO, DLPUser dlpUser) {
List<String> uuId = acceptanceRecordFormAuditDTO.getUuId();
List<AcceptanceRecordForm> acceptanceRecordForms = new ArrayList<>();
AcceptanceRecordForm byId = this.getById(auditAndApproveDTO.getUuId());
for (String s : uuId) {
AcceptanceRecordForm byId = this.getById(s);
if (byId.getStatus() != 3) {
throw new RuntimeException(String.format("当前状态不能审核"));
}
byId.setThreeLevelAuditorId(dlpUser.getId());
byId.setAuditOpinionOfThreeLevel(auditAndApproveDTO.getAuditOpinion());
byId.setAuditOpinionOfThreeLevel(acceptanceRecordFormAuditDTO.getAuditOpinion());
byId.setAuditTimeOfThreeLevel(LocalDateTime.now());
byId.setAuditResultOfThreeLevel(auditAndApproveDTO.getAuditResult());
byId.setAuditResultOfThreeLevel(acceptanceRecordFormAuditDTO.getAuditResult());
if (auditAndApproveDTO.getAuditResult() == true) {
if (acceptanceRecordFormAuditDTO.getAuditResult() == true) {
if (byId.getNonconformingItem() != null) {
@ -301,9 +340,10 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor
}
byId.setStatus(6);
} else byId.setStatus(-4);
if (this.updateById(byId)) {
return byId;
acceptanceRecordForms.add(byId);
}
if (this.updateBatchById(acceptanceRecordForms)) {
return true;
} else throw new RuntimeException(String.format("审核失败"));
}
@ -434,5 +474,4 @@ public class AcceptanceRecordFormServiceImpl extends ServiceImpl<AcceptanceRecor
}
}

@ -251,7 +251,7 @@ public class ApplicationForUseServiceImpl extends ServiceImpl<ApplicationForUseM
applicationForUse.setRecipientId(dlpUser.getId());
applicationForUse.setTemplateId(applicationForUseBatchDTO.getTemplateId());
applicationForUse.setExperimentId(applicationForUseBatchDTO.getTemplateId());
List<ReagentConsumablesSet> reagentConsumablesSets = new ArrayList<>();
@ -299,7 +299,7 @@ public class ApplicationForUseServiceImpl extends ServiceImpl<ApplicationForUseM
@Override
public List<ReagentConsumablesSetVO> getReagentConsumablesSets(String id) {
List<ApplicationForUse> applicationForUseList = this.list(Wrappers.<ApplicationForUse>query().eq("template_id", id));
List<ApplicationForUse> applicationForUseList = this.list(Wrappers.<ApplicationForUse>query().eq("experiment_id", id));
List<ReagentConsumablesSetVO> reagentConsumablesSetList = new ArrayList<>();

@ -10,6 +10,8 @@ import digital.laboratory.platform.reagent.vo.CatalogueDetailsVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
/**
@ -27,8 +29,16 @@ public class CatalogueDetailsServiceImpl extends ServiceImpl<CatalogueDetailsMap
LambdaQueryWrapper<CatalogueDetails> catalogueDetailsLambdaQueryWrapper = new LambdaQueryWrapper<>();
List<CatalogueDetails> list = this.list(Wrappers.<CatalogueDetails>query().eq("purchase_catalogue_id",purchaseCatalogueId).orderByDesc("create_time"));
List<CatalogueDetails> list = this.list(Wrappers.<CatalogueDetails>query().eq("purchase_catalogue_id",purchaseCatalogueId).orderByDesc("purchase_catalogue_number"));
Collections.sort(list, new Comparator<CatalogueDetails>() {
@Override
public int compare(CatalogueDetails o1, CatalogueDetails o2) {
return Integer.valueOf(o1.getPurchaseCatalogueNumber().substring(5)) - Integer.valueOf(o2.getPurchaseCatalogueNumber().substring(5));
}
});
return list;
}

@ -309,7 +309,6 @@ public class CentralizedRequestServiceImpl extends ServiceImpl<CentralizedReques
purchaseRequestPrintVOList.add(purchaseRequestPrintVO);
}
}
} else {

@ -33,6 +33,7 @@ import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayInputStream;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
@ -87,6 +88,9 @@ public class PurchaseListServiceImpl extends ServiceImpl<PurchaseListMapper, Pur
@Autowired
private ReagentConsumableInventoryService reagentConsumableInventoryService;
@Autowired
private BatchDetailsService batchDetailsService;
@Override//通过ID查找清单
public PurchaseListVO getPurchaseList(String purchaseListId) {
@ -180,7 +184,18 @@ public class PurchaseListServiceImpl extends ServiceImpl<PurchaseListMapper, Pur
ReagentConsumableInventory one = reagentConsumableInventoryService.getOne(Wrappers.<ReagentConsumableInventory>query()
.eq("reagent_consumable_id", byId.getReagentConsumableId()));
List<BatchDetails> batchDetailsList = batchDetailsService.list(Wrappers.<BatchDetails>query().eq("reagent_consumable_inventory_id", one.getReagentConsumableInventoryId())
.orderByDesc("create_time"));
WarehousingContent warehousingContent = new WarehousingContent();
if (batchDetailsList.size() != 0 && batchDetailsList != null) {
warehousingContent.setLastStorageLocation(batchDetailsList.get(0).getLocation());
warehousingContent.setBoxId(batchDetailsList.get(0).getBoxId());
warehousingContent.setLatticeId(batchDetailsList.get(0).getLatticeId());
}
//完善入库内容信息
warehousingContent.setId(IdWorker.get32UUID().toUpperCase());

@ -541,7 +541,7 @@ public class ReviewAndApproveServiceImpl extends ServiceImpl<ReviewAndApproveMap
LambdaQueryWrapper<CentralizedRequest> centralizedRequestLambdaQueryWrapper = new LambdaQueryWrapper<>();
centralizedRequestLambdaQueryWrapper.eq(CentralizedRequest::getStatus,2).or().eq(CentralizedRequest::getStatus, -2);
centralizedRequestLambdaQueryWrapper.eq(CentralizedRequest::getAuditId, dlpUser.getId());
List<CentralizedRequest> list = centralizedRequestService.list(centralizedRequestLambdaQueryWrapper);

@ -167,7 +167,7 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese
String format = date.format(formatter);
String prefix = reagentConsumableInventory.getEnglishName() + "-" + format+"-";
String prefix = reagentConsumableInventory.getAlias() + "-" + format+"-";
List<ReferenceMaterial> list = referenceMaterialService.list(Wrappers.<ReferenceMaterial>query()
.likeRight("number", prefix)
@ -191,7 +191,7 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese
referenceMaterial.setId(IdWorker.get32UUID().toUpperCase());
referenceMaterial.setReagentConsumableId(reagentConsumableInventory.getReagentConsumableId());
referenceMaterial.setReagentConsumableInventoryId(reagentConsumableInventory.getReagentConsumableInventoryId());
referenceMaterial.setNumber(reagentConsumableInventory.getEnglishName() + "-" + format + "-" + newNo);
referenceMaterial.setNumber(reagentConsumableInventory.getAlias() + "-" + format + "-" + newNo);
ReferenceMaterial byId1 = referenceMaterialService.getById(standardReserveSolution.getReferenceMaterialId());
@ -238,7 +238,7 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese
int year = calendar.get(Calendar.YEAR);
String prefix = one.getEnglishName() + "-" + format+"-";
String prefix = one.getAlias() + "-" + format+"-";
List<ReferenceMaterial> list = referenceMaterialService.list(Wrappers.<ReferenceMaterial>query()
.likeRight("number", prefix)
@ -258,7 +258,7 @@ public class StandardReserveSolutionServiceImpl extends ServiceImpl<StandardRese
}
}
referenceMaterial.setNumber(one.getEnglishName() + "-" + format + "-" + newNo);
referenceMaterial.setNumber(one.getAlias() + "-" + format + "-" + newNo);
referenceMaterial.setBatchDetailsId(batchDetails.getBatchDetailsId());

@ -87,7 +87,7 @@ public class StandardSolutionCurveServiceImpl extends ServiceImpl<StandardSoluti
if (referenceMaterial.getStatus() != -3) {
throw new RuntimeException(String.format("请先领用该标准储备溶液后,再进行操作"));
} else if (!(referenceMaterial.getStatus() == 0 || referenceMaterial.getStatus() == -2)) {
} else if (!(referenceMaterial.getStatus() == 0 || referenceMaterial.getStatus() == -2||referenceMaterial.getStatus()==-3)) {
throw new RuntimeException(String.format("该标准储备溶液已使用完毕或已停止使用/报废使用,不能进行操作"));

@ -91,6 +91,9 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
@Autowired
private PurchaseListService purchaseListService;
@Autowired
private AcceptanceSignForService acceptanceSignForService;
@Override//查看采购入库
public WarehousingRecordFormVO getWarehousingRecordFormVO(String warehousingFormId) {
@ -146,14 +149,22 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
WarehousingContent byId = warehousingContentService.getById(warehousingBatchList.getWarehousingContentId());
byId.setLastStorageLocation(warehousingRecordFormDTO.getLocation());
byId.setBoxId(warehousingRecordFormDTO.getBoxId());
byId.setLatticeId(warehousingRecordFormDTO.getLatticeId());
byId.setWarehousingQuantity(byId.getWarehousingQuantity() + warehousingBatchList.getQuantity());
if (warehousingRecordFormDTO.getCode() != null) {
byId.setCode(warehousingRecordFormDTO.getCode());
}
//判断采购数量与签收数量
if (byId.getWarehousingQuantity() > byId.getTotalQuantity()) {
throw new RuntimeException(String.format("入库数量不能大于采购数量"));
}
warehousingContentService.updateById(byId);
ReagentConsumableInventory one = reagentConsumableInventoryService.getOne(Wrappers.<ReagentConsumableInventory>query().eq("reagent_consumable_id", byId.getReagentConsumableId()));
//录入仓库批次信息,若仓库不存在该物品,则新增该物品的库存信息
@ -179,6 +190,7 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
reagentConsumableInventory.setCode(warehousingRecordFormDTO.getCode());
reagentConsumables.setCode(warehousingRecordFormDTO.getCode());
reagentConsumablesService.updateById(reagentConsumables);
}
BatchDetails batchDetails = new BatchDetails();
@ -223,6 +235,9 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
//如果是标准物质,则赋值编号
if (reagentConsumables.getCategory().equals("标准物质")) {
batchDetails.setLatticeId(warehousingRecordFormDTO.getLatticeId());
batchDetails.setLocation(warehousingRecordFormDTO.getLocation());
batchDetails.setBoxId(warehousingRecordFormDTO.getBoxId());
for (int j = 0; j < batchDetails.getQuantity(); j++) {
@ -243,7 +258,7 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
String location = warehousingRecordFormDTO.getLocation();
String prefix = reagentConsumables.getEnglishName() + "-" + year + "-" + location.charAt(1) + "-";
String prefix = reagentConsumables.getAlias() + "-" + year + "-" + location.charAt(1) + "-";
List<ReferenceMaterial> list = referenceMaterialService.list(Wrappers.<ReferenceMaterial>query()
.likeRight("number", prefix)
@ -278,7 +293,6 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
if (warehousingRecordFormDTO.getCode() != null) {
one.setCode(warehousingRecordFormDTO.getCode());
ReagentConsumables byId1 = reagentConsumablesService.getById(one.getReagentConsumableId());
byId1.setCode(one.getCode());
reagentConsumablesService.updateById(byId1);
}
LambdaQueryWrapper<ReagentConsumables> reagentConsumablesLambdaQueryWrapper = new LambdaQueryWrapper<>();
@ -331,6 +345,9 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
one.setWarningValue(warehousingRecordFormDTO.getWarningValue());
if (one.getCategory().equals("标准物质")) {
batchDetails.setLocation(warehousingRecordFormDTO.getLocation());
batchDetails.setLatticeId(warehousingRecordFormDTO.getLatticeId());
batchDetails.setBoxId(warehousingRecordFormDTO.getBoxId());
for (int j = 0; j < batchDetails.getQuantity(); j++) {
@ -350,7 +367,7 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
String location = warehousingRecordFormDTO.getLocation();
String prefix = reagentConsumables.getEnglishName() + "-" + year + "-" + location.charAt(1) + "-";
String prefix = reagentConsumables.getAlias() + "-" + year + "-" + location.charAt(1) + "-";
List<ReferenceMaterial> list = referenceMaterialService.list(Wrappers.<ReferenceMaterial>query()
.likeRight("number", prefix)
@ -379,14 +396,15 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
batchDetailsService.save(batchDetails);
}
warehousingContentService.updateById(byId);
warehousingBatchListService.save(warehousingBatchList);
LambdaQueryWrapper<WarehousingContent> warehousingContentLambdaQueryWrapper = new LambdaQueryWrapper<>();
WarehousingContent byId1 = warehousingContentService.getById(warehousingRecordFormDTO.getWarehousingContentId());
String warehousingRecordFormId = byId1.getWarehousingRecordFormId();
String warehousingRecordFormId = byId.getWarehousingRecordFormId();
warehousingContentLambdaQueryWrapper.eq(WarehousingContent::getWarehousingRecordFormId, warehousingRecordFormId);
@ -405,9 +423,24 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
warehousingContentService.updateById(warehousingContent);
if (warehousingContent.getAcceptanceRecordFormId() == null) {
AcceptanceRecordForm acceptanceRecordForm = acceptanceRecordFormService.addForm(warehousingContent.getReagentConsumableId(), warehousingContent.getSupplierId());
AcceptanceSignFor acceptanceSignForServiceOne = acceptanceSignForService.getOne(Wrappers.<AcceptanceSignFor>query().eq("warehousing_record_form_id", warehousingRecordFormId));
if (acceptanceSignForServiceOne == null) {
AcceptanceSignFor acceptanceSignFor = new AcceptanceSignFor();
acceptanceSignFor.setWarehousingRecordFormId(warehousingRecordFormId);
acceptanceSignFor.setId(IdWorker.get32UUID().toUpperCase());
acceptanceSignFor.setQuantity(list.size());
acceptanceSignForService.save(acceptanceSignFor);
AcceptanceRecordForm acceptanceRecordForm = acceptanceRecordFormService.addForm(warehousingContent.getReagentConsumableId(), warehousingContent.getSupplierId(), acceptanceSignFor.getId());
warehousingContent.setAcceptanceRecordFormId(acceptanceRecordForm.getId());
} else {
AcceptanceRecordForm acceptanceRecordForm = acceptanceRecordFormService.addForm(warehousingContent.getReagentConsumableId(), warehousingContent.getSupplierId(), acceptanceSignForServiceOne.getId());
warehousingContent.setAcceptanceRecordFormId(acceptanceRecordForm.getId());
}
warehousingContentService.updateById(warehousingContent);
}
@ -501,11 +534,7 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
DecentralizedRequestVO requestById = decentralizedRequestService.getRequestById(request.getId());
List<DecentralizeDetails> decentralizeDetailsVOList = requestById.getDecentralizeDetailsVOList();
}
for (WarehousingContent warehousingContent : warehousingContentList) {
PurchaseListDetails purchaseListDetails = purchaseListDetailsService.getById(warehousingContent.getPurchaseListDetailsId());
@ -527,7 +556,6 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
PurchaseRequestPrintVO purchaseRequestPrintVO = new PurchaseRequestPrintVO();
if (decentralizeDetail.getCategory().equals("标准物质")) {
purchaseRequestPrintVO.setRemarks(decentralizeDetail.getRemarks());
purchaseRequestPrintVO.setQuantity(decentralizeDetail.getQuantity());
purchaseRequestPrintVO.setPurpose(decentralizeDetail.getPurpose());
@ -537,13 +565,8 @@ public class WarehousingRecordFormServiceImpl extends ServiceImpl<WarehousingRec
// purchaseRequestPrintVO.setSupplierName();
}
}
}
ProcurementContent procurementContent = procurementContentService.getById(purchaseListDetails.getProcurementContentId());
}
return

@ -39,4 +39,6 @@ public class WarehousingContentVO extends WarehousingContent {
}

@ -63,13 +63,13 @@ oss:
secretKey: 87990016
bucket-name: dlpfiles
config:
activemq:
brokerUrl: tcp://localhost:61616
user: admin
password: admin
#true:topic模式,false:queue模式
pub-sub-domain: true
msgListener:
reagentTopicName: reagent
#config:
# activemq:
# brokerUrl: tcp://localhost:61616
# user: admin
# password: admin
# #true:topic模式,false:queue模式
# pub-sub-domain: true
# msgListener:
# reagentTopicName: reagent

@ -43,6 +43,7 @@
<result property="userName" column="user_name"/>
<result property="commitTime" column="commit_time"/>
<result property="reagentConsumableName" column="reagent_consumable_name"/>
<result property="acceptanceSignForId" column="acceptance_sign_for_id"/>
</resultMap>
<resultMap id="acceptanceRecordFormVO" type="digital.laboratory.platform.reagent.vo.AcceptanceRecordFormVO"
@ -80,6 +81,7 @@
WHERE user.user_id=arf.three_level_auditor_id
) AS three_level_auditor_name
FROM acceptance_record_form arf
WHERE arf.acceptance_sign_for_id = #{acceptanceSignForId}
</sql>
<select id="getAcceptanceRecordFormVOPage" resultMap="acceptanceRecordFormVO"

@ -16,7 +16,7 @@
<result property="updateTime" column="update_time"/>
<result property="createBy" column="create_by"/>
<result property="updateBy" column="update_by"/>
<result property="templateId" column="template_id"/>
<result property="experimentId" column="experiment_id"/>
</resultMap>
<resultMap id="applicationForUseVO" type="digital.laboratory.platform.reagent.vo.ApplicationForUseVO"

@ -23,6 +23,9 @@
<result property="status" column="status"/>
<result property="warningValue" column="warning_value"/>
<result property="code" column="code"/>
<result property="lastStorageLocation" column="last_storage_location"/>
<result property="latticeId" column="lattice_id"/>
<result property="boxId" column="box_id"/>
</resultMap>

Loading…
Cancel
Save