This commit is contained in:
parent
ff25047310
commit
8ac6000605
|
|
@ -124,19 +124,22 @@ public class BssVatInvoiceController {
|
||||||
if (bssVatInvoice.getId() != null) {
|
if (bssVatInvoice.getId() != null) {
|
||||||
BssVatInvoice beBssVatInvoice = bssVatInvoiceService.getById(bssVatInvoice.getId());
|
BssVatInvoice beBssVatInvoice = bssVatInvoiceService.getById(bssVatInvoice.getId());
|
||||||
EntityBeanUtil.copyProperties(beBssVatInvoice, bssVatInvoice);
|
EntityBeanUtil.copyProperties(beBssVatInvoice, bssVatInvoice);
|
||||||
|
bssVatInvoice.setSalerTaxInfo(beBssVatInvoice.getSalerTaxInfo());
|
||||||
|
bssVatInvoice.setBuyTaxInfo(beBssVatInvoice.getBuyTaxInfo());
|
||||||
|
}else {
|
||||||
|
if(!StringUtil.isBlank(String.valueOf(bssVatInvoice.getSalerTaxInfoId()))){
|
||||||
|
bssVatInvoice.setSalerTaxInfo(bssTaxinfoService.getById(bssVatInvoice.getSalerTaxInfoId()));
|
||||||
|
}
|
||||||
|
if(!StringUtil.isBlank(String.valueOf(bssVatInvoice.getBuyTaxInfoId()))) {
|
||||||
|
bssVatInvoice.setBuyTaxInfo(bssTaxinfoService.getById(bssVatInvoice.getBuyTaxInfoId()));
|
||||||
|
}
|
||||||
|
List<BssGoods> bssGoods = bssVatInvoice.getBssGoods();
|
||||||
|
if(bssGoods != null && bssGoods.size() > 0){
|
||||||
|
bssGoods.stream().forEach(good ->{
|
||||||
|
good.setVatInvoice(bssVatInvoice);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(!StringUtil.isBlank(String.valueOf(bssVatInvoice.getSalerTaxInfoId()))){
|
|
||||||
bssVatInvoice.setSalerTaxInfo(bssTaxinfoService.getById(bssVatInvoice.getSalerTaxInfoId()));
|
|
||||||
}
|
|
||||||
if(!StringUtil.isBlank(String.valueOf(bssVatInvoice.getBuyTaxInfoId()))) {
|
|
||||||
bssVatInvoice.setBuyTaxInfo(bssTaxinfoService.getById(bssVatInvoice.getBuyTaxInfoId()));
|
|
||||||
}
|
|
||||||
|
|
||||||
List<BssGoods> bssGoods = bssVatInvoice.getBssGoods();
|
|
||||||
bssGoods.stream().forEach(good ->{
|
|
||||||
good.setVatInvoice(bssVatInvoice);
|
|
||||||
});
|
|
||||||
|
|
||||||
// 保存数据
|
// 保存数据
|
||||||
bssVatInvoiceService.save(bssVatInvoice);
|
bssVatInvoiceService.save(bssVatInvoice);
|
||||||
return ResultVoUtil.SAVE_SUCCESS;
|
return ResultVoUtil.SAVE_SUCCESS;
|
||||||
|
|
|
||||||
|
|
@ -135,24 +135,23 @@ layui.use(['element', 'form', 'layer', 'upload'], function () {
|
||||||
var serializeArray = form.serializeArray();
|
var serializeArray = form.serializeArray();
|
||||||
var _newData = null;
|
var _newData = null;
|
||||||
var from = false; // from = true 代表增值税页面请求,用设置content-type的请求
|
var from = false; // from = true 代表增值税页面请求,用设置content-type的请求
|
||||||
for(var i=0; i<serializeArray.length; i++){
|
console.info("本次请求的url是---", url);
|
||||||
if(serializeArray[i].name == 'salerTaxInfoId'){
|
if(url == '/bss/vatInvoice/add'){//增值税add页面请求
|
||||||
from = true;
|
from = true;
|
||||||
_newData = trans.serialize( serializeArray );
|
_newData = trans.serialize( serializeArray );
|
||||||
var goods = createGoodsParams();
|
var goods = createGoodsParams();
|
||||||
_newData.bssGoods = goods;
|
_newData.bssGoods = goods;
|
||||||
delete _newData.name;
|
delete _newData.name;
|
||||||
delete _newData.specification;
|
delete _newData.specification;
|
||||||
delete _newData.unit;
|
delete _newData.unit;
|
||||||
delete _newData.num;
|
delete _newData.num;
|
||||||
delete _newData.unitPrice;
|
delete _newData.unitPrice;
|
||||||
delete _newData.detailAmount;
|
delete _newData.detailAmount;
|
||||||
delete _newData.taxRate;
|
delete _newData.taxRate;
|
||||||
delete _newData.goodTaxAmount;
|
delete _newData.goodTaxAmount;
|
||||||
break;
|
}else if(url == '/bss/vatInvoice/edit'){//增值税edit页面请求
|
||||||
}else {
|
from = true;
|
||||||
continue;
|
_newData = trans.serialize( serializeArray );
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(from){
|
if(from){
|
||||||
|
|
@ -169,7 +168,7 @@ layui.use(['element', 'form', 'layer', 'upload'], function () {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}else {
|
}else {
|
||||||
$.post(url, _newData, function(result) {
|
$.post(url, serializeArray, function(result) {
|
||||||
if (result.data == null) {
|
if (result.data == null) {
|
||||||
result.data = 'submit[refresh]';
|
result.data = 'submit[refresh]';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,9 +46,9 @@
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th>购买方纳税人信息</th>
|
<th>购买方纳税人信息</th>
|
||||||
<td th:text="${bssVatInvoice.buyTaxInfo.name}"></td>
|
<td th:text="${bssVatInvoice.buyTaxInfo?.name}"></td>
|
||||||
<th>销售方纳税人信息</th>
|
<th>销售方纳税人信息</th>
|
||||||
<td th:text="${bssVatInvoice.salerTaxInfo.name}"></td>
|
<td th:text="${bssVatInvoice.salerTaxInfo?.name}"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th>创建时间</th>
|
<th>创建时间</th>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue