单据校验
This commit is contained in:
parent
64d8e875bd
commit
5ffaf4ce0e
@ -306,6 +306,9 @@ public class ExceptionConstants {
|
||||
//单据录入-调入仓库不能为空
|
||||
public static final int DEPOT_HEAD_ANOTHER_DEPOT_FAILED_CODE = 8500005;
|
||||
public static final String DEPOT_HEAD_ANOTHER_DEPOT_FAILED_MSG = "调入仓库不能为空";
|
||||
//单据录入-明细不能为空
|
||||
public static final int DEPOT_HEAD_ROW_FAILED_CODE = 8500006;
|
||||
public static final String DEPOT_HEAD_ROW_FAILED_MSG = "单据明细不能为空";
|
||||
/**
|
||||
* 单据明细信息
|
||||
* type = 90
|
||||
@ -332,6 +335,9 @@ public class ExceptionConstants {
|
||||
//修改财务信息失败
|
||||
public static final int ACCOUNT_HEAD_EDIT_FAILED_CODE = 9500002;
|
||||
public static final String ACCOUNT_HEAD_EDIT_FAILED_MSG = "修改财务信息失败";
|
||||
//单据录入-明细不能为空
|
||||
public static final int ACCOUNT_HEAD_ROW_FAILED_CODE = 9500003;
|
||||
public static final String ACCOUNT_HEAD_ROW_FAILED_MSG = "单据明细不能为空";
|
||||
/**
|
||||
* 财务明细信息
|
||||
* type = 100
|
||||
|
||||
@ -3,12 +3,14 @@ package com.jsh.erp.service.accountItem;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.constants.BusinessConstants;
|
||||
import com.jsh.erp.constants.ExceptionConstants;
|
||||
import com.jsh.erp.datasource.entities.AccountItem;
|
||||
import com.jsh.erp.datasource.entities.AccountItemExample;
|
||||
import com.jsh.erp.datasource.entities.User;
|
||||
import com.jsh.erp.datasource.mappers.AccountItemMapper;
|
||||
import com.jsh.erp.datasource.mappers.AccountItemMapperEx;
|
||||
import com.jsh.erp.datasource.vo.AccountItemVo4List;
|
||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||
import com.jsh.erp.exception.JshException;
|
||||
import com.jsh.erp.service.log.LogService;
|
||||
import com.jsh.erp.service.user.UserService;
|
||||
@ -186,7 +188,7 @@ public class AccountItemService {
|
||||
//删除单据的明细
|
||||
deleteAccountItemHeadId(headerId);
|
||||
JSONArray rowArr = JSONArray.parseArray(rows);
|
||||
if (null != rowArr) {
|
||||
if (null != rowArr && rowArr.size()>0) {
|
||||
for (int i = 0; i < rowArr.size(); i++) {
|
||||
AccountItem accountItem = new AccountItem();
|
||||
JSONObject tempInsertedJson = JSONObject.parseObject(rowArr.getString(i));
|
||||
@ -209,6 +211,9 @@ public class AccountItemService {
|
||||
accountItem.setRemark(tempInsertedJson.getString("remark"));
|
||||
this.insertAccountItemWithObj(accountItem);
|
||||
}
|
||||
} else {
|
||||
throw new BusinessRunTimeException(ExceptionConstants.ACCOUNT_HEAD_ROW_FAILED_CODE,
|
||||
String.format(ExceptionConstants.ACCOUNT_HEAD_ROW_FAILED_MSG));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -316,7 +316,7 @@ public class DepotItemService {
|
||||
//删除单据的明细
|
||||
deleteDepotItemHeadId(headerId);
|
||||
JSONArray rowArr = JSONArray.parseArray(rows);
|
||||
if (null != rowArr) {
|
||||
if (null != rowArr && rowArr.size()>0) {
|
||||
for (int i = 0; i < rowArr.size(); i++) {
|
||||
DepotItem depotItem = new DepotItem();
|
||||
JSONObject rowObj = JSONObject.parseObject(rowArr.getString(i));
|
||||
@ -411,6 +411,9 @@ public class DepotItemService {
|
||||
//更新当前库存
|
||||
updateCurrentStock(depotItem,tenantId);
|
||||
}
|
||||
} else {
|
||||
throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_ROW_FAILED_CODE,
|
||||
String.format(ExceptionConstants.DEPOT_HEAD_ROW_FAILED_MSG));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user