|
@@ -99,7 +99,6 @@ public class MuseumFlowController {
|
|
|
Long UserId = getLoginUserId();
|
|
|
if (permissionService.hasAnyRoles(UserId, "operate")) {//获取操作者id并对其权限做判断,不为operate则结束进程
|
|
|
List<String> errorList = new ArrayList<>();
|
|
|
-// errorList.add(museumFlowService.isMuseumFlowIn(saveVO));
|
|
|
// store中 1现为未出库或已回库,0为已出库
|
|
|
// State中 0在库,1为已出库,2为审批中,3为审批通过,4为审批驳回
|
|
|
for (String number : saveVO.getNumber()) {
|
|
@@ -107,21 +106,24 @@ public class MuseumFlowController {
|
|
|
//根据标本编号查询标本在标本库中是否存在
|
|
|
if (result == null) {
|
|
|
return CommonResult.error(2, number + "标本不存在");
|
|
|
- } else {//若存在则检查标本馆藏状态
|
|
|
- if (result.getStore() == 0) {//出库时返回已出库的信息
|
|
|
- return CommonResult.error(2, number + "标本已出库");
|
|
|
- } else if (result.getStore() == 1) {//在库时对该标本是否有过出库申请记录进行查询
|
|
|
- List<MuseumFlowDO> event = museumFlowService.selectMuseumFlowByNumbersLike(number);
|
|
|
- //根据标本编号在出回库中进行包含查询
|
|
|
- if (event != null) {
|
|
|
- errorList.addAll(museumFlowService.isMuseumFlowStateOutbound0(event, number));
|
|
|
- //若该标本有过出库申请记录且未回库,则返回相关错误信息到errorList中
|
|
|
- }
|
|
|
- } else {
|
|
|
- return CommonResult.error(2, number + "标本状态异常");//标本馆藏状态为null或不为所需求的0和1
|
|
|
+ }
|
|
|
+ //若存在则检查标本馆藏状态
|
|
|
+ if (result.getStore() == 0) {
|
|
|
+ //出库时返回已出库的信息
|
|
|
+ return CommonResult.error(2, number + "标本已出库");
|
|
|
+ } else if (result.getStore() == 1) {
|
|
|
+ //在库时对该标本是否有过出库申请记录进行查询
|
|
|
+ List<MuseumFlowDO> event = museumFlowService.selectMuseumFlowByNumbersLike(number);
|
|
|
+ //根据标本编号在出回库中进行包含查询
|
|
|
+ if (event != null) {
|
|
|
+ //若该标本有过出库申请记录且未回库,则返回相关错误信息到errorList中
|
|
|
+ errorList.addAll(museumFlowService.isMuseumFlowStateOutbound0(event, number));
|
|
|
}
|
|
|
+ } else {
|
|
|
+ return CommonResult.error(2, number + "标本状态异常");//标本馆藏状态为null或不为所需求的0和1
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
if (errorList.isEmpty()) {
|
|
|
museumFlowService.createMuseumFlow(saveVO);//根据所传信息创建出库单
|
|
|
return CommonResult.success(true);
|
|
@@ -206,7 +208,7 @@ public class MuseumFlowController {
|
|
|
if (event != null) {
|
|
|
int State = event.getState();
|
|
|
if (State == 1) {
|
|
|
- museumFlowService.updateMuseumFlowSave1(event.getNumber());
|
|
|
+ museumFlowService.updateMuseumFlowSave1(event.getNumber());
|
|
|
museumFlowService.updateMuseumFlowStateReturn(returnVO);
|
|
|
return CommonResult.success(true);
|
|
|
} else {
|
|
@@ -221,16 +223,16 @@ public class MuseumFlowController {
|
|
|
}
|
|
|
|
|
|
@GetMapping("/export")
|
|
|
- @Operation(summary = "导出用户")
|
|
|
+ @Operation(summary = "导出表单")
|
|
|
// @PreAuthorize("@ss.hasPermission('system:user:export')")
|
|
|
@ApiAccessLog(operateType = EXPORT)
|
|
|
public void exportUserList(@Validated MuseumFlowPageVO pageVO,
|
|
|
HttpServletResponse response) throws IOException {
|
|
|
pageVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
|
- List<MuseumFlowPageVO> list = museumFlowService.selectPageMuseumFlowFormIntel(pageVO).getList();
|
|
|
+ List<MuseumFlowExcelVO> list =BeanUtils.toBean(museumFlowService.selectPageMuseumFlowFormIntel(pageVO).getList(), MuseumFlowExcelVO.class);
|
|
|
// 输出 Excel
|
|
|
- ExcelUtils.write(response, "用户数据.xls", "数据", MuseumFlowPageVO.class,
|
|
|
- BeanUtils.toBean(list, MuseumFlowPageVO.class));
|
|
|
+ ExcelUtils.write(response, "用户数据.xls", "数据", MuseumFlowExcelVO.class,list);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
//TODO 有空可以研究一下Excel导出
|