bug修复

new
parent 1424ecf52e
commit 48b265a850

@ -48,9 +48,8 @@ public class BorrowApplyController {
@PutMapping("/update")
@Operation(summary = "更新档案借阅申请")
@PreAuthorize("@ss.hasPermission('archives:borrow-apply:update')")
public CommonResult<Boolean> updateBorrowApply(@Valid @RequestBody BorrowApplyUpdateReqVO updateReqVO) {
borrowApplyService.updateBorrowApply(updateReqVO);
return success(true);
public CommonResult<String> updateBorrowApply(@Valid @RequestBody BorrowApplyUpdateReqVO updateReqVO) {
return success(borrowApplyService.updateBorrowApply(updateReqVO);
}
@DeleteMapping("/delete")

@ -34,7 +34,7 @@ public interface BorrowApplyMapper extends BaseMapperX<BorrowApplyDO> {
.eqIfPresent(BorrowApplyDO::getRemark, reqVO.getRemark())
.betweenIfPresent(BorrowApplyDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(BorrowApplyDO::getId)
.eq(BorrowApplyDO::getBorrowState,"1"));
.isNull(BorrowApplyDO::getBorrowState));
}
@ -55,7 +55,7 @@ public interface BorrowApplyMapper extends BaseMapperX<BorrowApplyDO> {
.eqIfPresent(BorrowApplyDO::getRemark, reqVO.getRemark())
.betweenIfPresent(BorrowApplyDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(BorrowApplyDO::getId)
.isNull(BorrowApplyDO::getBorrowState));
.in(BorrowApplyDO::getBorrowState,"0","1","2"));
}

@ -28,7 +28,7 @@ public interface BorrowApplyService {
*
* @param updateReqVO
*/
void updateBorrowApply(@Valid BorrowApplyUpdateReqVO updateReqVO);
CommonResult<String> updateBorrowApply(@Valid BorrowApplyUpdateReqVO updateReqVO);
/**
*

@ -50,7 +50,6 @@ public class BorrowApplyServiceImpl implements BorrowApplyService {
}
RecordUpdateReqVO recordUpdateReqVO = new RecordUpdateReqVO();
BeanUtils.copyProperties(record,recordUpdateReqVO);
recordUpdateReqVO.setBorrowStatus("1");
recordService.updateRecord(recordUpdateReqVO);
borrowApplyMapper.insert(borrowApply);
// 返回
@ -59,7 +58,7 @@ public class BorrowApplyServiceImpl implements BorrowApplyService {
@Override
@Transactional
public void updateBorrowApply(BorrowApplyUpdateReqVO updateReqVO) {
public CommonResult<String> updateBorrowApply(BorrowApplyUpdateReqVO updateReqVO) {
BorrowApplyDO borrowApply = this.getBorrowApply(updateReqVO.getId());
RecordUpdateReqVO recordUpdateReqVO = new RecordUpdateReqVO();
@ -68,9 +67,13 @@ public class BorrowApplyServiceImpl implements BorrowApplyService {
BeanUtils.copyProperties(record,recordUpdateReqVO);
if (StringUtils.isNotNull(updateReqVO.getBorrowState())){
if (record.getBorrowStatus().equals("0")){
return CommonResult.error("档案已被借阅");
}
if (updateReqVO.getBorrowState().equals("2")) {
recordUpdateReqVO.setBorrowStatus(null);
}
recordUpdateReqVO.setBorrowStatus(updateReqVO.getBorrowState());
recordService.updateRecord(recordUpdateReqVO);
}
@ -79,6 +82,7 @@ public class BorrowApplyServiceImpl implements BorrowApplyService {
// 更新
BorrowApplyDO updateObj = BorrowApplyConvert.INSTANCE.convert(updateReqVO);
borrowApplyMapper.updateById(updateObj);
return CommonResult.success("成功");
}
@Override

Loading…
Cancel
Save