|
|
@@ -288,6 +288,15 @@ public class OtherReceivableService extends BaseService<OtherReceivable> {
|
|
|
rollbackFor = {Exception.class}
|
|
|
)
|
|
|
public ResponseResultVO<?> update(OtherReceivableVO otherReceivableVO) {
|
|
|
+ OtherReceivable otherReceivableForUpdate = otherReceivableMapper.selectByIdForUpdate(otherReceivableVO.getReceivableId());
|
|
|
+ // 并发校验
|
|
|
+ if (!otherReceivableForUpdate.getFlgValid()) {
|
|
|
+ throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.ISFLGVALID_FALSE.getMessage());
|
|
|
+ }
|
|
|
+ // 期初数据不允许编辑
|
|
|
+ if (otherReceivableForUpdate.getBusinessType() == 0) {
|
|
|
+ throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.INVOICE_ISQICHU.getMessage());
|
|
|
+ }
|
|
|
// 收款金额不能大于收入金额
|
|
|
if(otherReceivableVO.getSumAmtRec().compareTo(otherReceivableVO.getSumAmtReceivable()) == 1){
|
|
|
throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.RECEIVABLE_NO_LESS_RECEIPT.getMessage());
|
|
|
@@ -454,7 +463,6 @@ public class OtherReceivableService extends BaseService<OtherReceivable> {
|
|
|
/*********************************** 收款的处理 end ************************************/
|
|
|
|
|
|
/*********************************** 应收收款的处理 begin ************************************/
|
|
|
- OtherReceivable otherReceivableForUpdate = otherReceivableMapper.selectByIdForUpdate(otherReceivableVO.getReceivableId());
|
|
|
// 应收收款的处理
|
|
|
RecPayHandleItem recPayHandleItem = new RecPayHandleItem();
|
|
|
recPayHandleItem.setRpId(recPay.getRpId()).setAccItemId(otherReceivableForUpdate.getAccItemId())
|