|
@@ -88,7 +88,7 @@ public class MuseumFlowController {
|
|
|
|
|
|
@GetMapping("/getFormIntel")
|
|
|
@Operation(summary = "根据id查找标本出回库中的信息,并展示在标本库中的信息")
|
|
|
- public CommonResult<MuseumFlowInfoVO> getFormIntel( @Valid MuseumInfoPageReqVO reqVO) {
|
|
|
+ public CommonResult<MuseumFlowInfoVO> getFormIntel(@Valid MuseumInfoPageReqVO reqVO) {
|
|
|
Long UserId = getLoginUserId();
|
|
|
if (permissionService.hasAnyRoles(UserId, "operate")) {
|
|
|
List<MuseumInfoDO> museumInfoDO = new ArrayList<>();
|
|
@@ -97,12 +97,12 @@ public class MuseumFlowController {
|
|
|
if (form != null) {
|
|
|
// int State = form.getState();
|
|
|
// if (State == 2) {
|
|
|
- for (String number : form.getNumber()) {
|
|
|
- reqVO.setSampleId(number);
|
|
|
- museumInfoDO.addAll(museumInfoService.getMuseumInfoPageList(reqVO));
|
|
|
- }
|
|
|
- form.setMuseumInfoList(museumInfoDO);
|
|
|
- return CommonResult.success(form);
|
|
|
+ for (String number : form.getNumber()) {
|
|
|
+ reqVO.setSampleId(number);
|
|
|
+ museumInfoDO.addAll(museumInfoService.getMuseumInfoPageList(reqVO));
|
|
|
+ }
|
|
|
+ form.setMuseumInfoList(museumInfoDO);
|
|
|
+ return CommonResult.success(form);
|
|
|
// } else {
|
|
|
// return CommonResult.error(2, reqVO.getOutBoundId() + museumFlowService.isMuseumFlowStateForm(State));
|
|
|
// }
|
|
@@ -130,31 +130,33 @@ public class MuseumFlowController {
|
|
|
@Operation(summary = "出库功能")
|
|
|
public CommonResult<Boolean> createMuseumFlowOutbound(@RequestBody MuseumFlowSaveVO saveVO) {
|
|
|
Long UserId = getLoginUserId();
|
|
|
- if (permissionService.hasAnyRoles(UserId, "operate")) {
|
|
|
+ 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()) {
|
|
|
MuseumInfoDO result = museumFlowService.selectMuseumFlowSampleId(number);
|
|
|
+ //根据标本编号查询标本在标本库中是否存在
|
|
|
if (result == null) {
|
|
|
return CommonResult.error(2, number + "标本不存在");
|
|
|
- } else {
|
|
|
- if (result.getStore() == 0) {
|
|
|
+ } else {//若存在则检查标本馆藏状态
|
|
|
+ if (result.getStore() == 0) {//出库时返回已出库的信息
|
|
|
return CommonResult.error(2, number + "标本已出库");
|
|
|
- } else if (result.getStore() == 1) {
|
|
|
+ } else if (result.getStore() == 1) {//在库时对该标本是否有过出库申请记录进行查询
|
|
|
List<MuseumFlowDO> event = museumFlowService.selectMuseumFlowByNumbersLike(number);
|
|
|
- System.out.println(event);
|
|
|
+ //根据标本编号在出回库中进行包含查询
|
|
|
if (event != null) {
|
|
|
errorList.addAll(museumFlowService.isMuseumFlowStateOutbound0(event, number));
|
|
|
+ //若该标本有过出库申请记录且未回库,则返回相关错误信息到errorList中
|
|
|
}
|
|
|
} else {
|
|
|
- return CommonResult.error(2, number + "标本状态异常");
|
|
|
+ return CommonResult.error(2, number + "标本状态异常");//标本馆藏状态为null或不为所需求的0和1
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
if (errorList.isEmpty()) {
|
|
|
- museumFlowService.createMuseumFlow(saveVO);
|
|
|
+ museumFlowService.createMuseumFlow(saveVO);//根据所传信息创建出库单
|
|
|
return CommonResult.success(true);
|
|
|
} else {
|
|
|
return CommonResult.error(2, errorList.toString());
|
|
@@ -169,7 +171,7 @@ public class MuseumFlowController {
|
|
|
public CommonResult<Boolean> createMuseumFlowOutboundEnd(@RequestBody MuseumFlowSaveVO saveVO) {
|
|
|
Long UserId = getLoginUserId();
|
|
|
if (permissionService.hasAnyRoles(UserId, "operate")) {
|
|
|
- MuseumFlowDO result = museumFlowService.selectMuseumFlowById(saveVO.getId());
|
|
|
+ MuseumFlowDO result = museumFlowService.selectMuseumFlowById(saveVO.getId());//根据标本编号查询标本在标本库中是否存在
|
|
|
if (result != null) {
|
|
|
MuseumFlowReviewVO event = BeanUtils.toBean(result, MuseumFlowReviewVO.class);
|
|
|
int State = event.getState();
|
|
@@ -197,6 +199,7 @@ public class MuseumFlowController {
|
|
|
//// Save中 1现为未出库或已回库,0为已出库
|
|
|
//// State中 0现为未出库或已回库,1为已出库,2为审批中,3为审批通过,4为审批驳回
|
|
|
if (permissionService.hasAnyRoles(UserId, "leader")) {
|
|
|
+ System.out.println(reviewVO.getId());
|
|
|
MuseumFlowDO result = museumFlowService.selectMuseumFlowById(reviewVO.getId());
|
|
|
MuseumFlowReviewVO event = BeanUtils.toBean(result, MuseumFlowReviewVO.class);
|
|
|
if (event != null) {
|
|
@@ -227,19 +230,20 @@ public class MuseumFlowController {
|
|
|
//// Save中 1现为未出库或已回库,0为已出库
|
|
|
//// State中 0现为未出库或已回库,1为已出库,2为审批中,3为审批通过,4为审批驳回
|
|
|
if (permissionService.hasAnyRoles(UserId, "operate")) {
|
|
|
- MuseumFlowDO result = museumFlowService.selectMuseumFlowById(returnVO.getId());
|
|
|
+ int id = returnVO.getTableId();
|
|
|
+ MuseumFlowDO result = museumFlowService.selectMuseumFlowById(id);
|
|
|
MuseumFlowReviewVO event = BeanUtils.toBean(result, MuseumFlowReviewVO.class);
|
|
|
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 {
|
|
|
- return CommonResult.error(2, returnVO.getId() + museumFlowService.isMuseumFlowStateForm(State));
|
|
|
+ return CommonResult.error(2, id + museumFlowService.isMuseumFlowStateForm(State));
|
|
|
}
|
|
|
} else {
|
|
|
- return CommonResult.error(2, returnVO.getId() + "id输入错误");
|
|
|
+ return CommonResult.error(2, id + "id输入错误");
|
|
|
}
|
|
|
} else {
|
|
|
return CommonResult.error(2, "您无此操作权限");
|