增值税
This commit is contained in:
parent
63e7402ed9
commit
d5301a092f
|
|
@ -162,5 +162,9 @@
|
|||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.baidu.aip:java-sdk:4.12.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.json:json:20160810" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-simple:1.7.26" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.coobird:thumbnailator:0.4.8" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
|
|
@ -3,14 +3,19 @@ package com.cwhelp.admin.business.controller;
|
|||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cwhelp.admin.business.validator.BssVatInvoiceCheckValid;
|
||||
import com.cwhelp.admin.business.validator.BssVatInvoiceValid;
|
||||
import com.cwhelp.common.api.baidu.BaiduAipOCR;
|
||||
import com.cwhelp.common.api.baidu.entity.vatinvoice.*;
|
||||
import com.cwhelp.common.api.baidu.entity.vatinvoice.enums.VatInvoiceTypeEnum;
|
||||
import com.cwhelp.common.enums.StatusEnum;
|
||||
import com.cwhelp.common.utils.EntityBeanUtil;
|
||||
import com.cwhelp.common.utils.HttpYoushangFapiaoUtil;
|
||||
import com.cwhelp.common.utils.ResultVoUtil;
|
||||
import com.cwhelp.common.utils.StatusUtil;
|
||||
import com.cwhelp.common.utils.*;
|
||||
import com.cwhelp.common.vo.ResultVo;
|
||||
import com.cwhelp.component.fileUpload.FileUpload;
|
||||
import com.cwhelp.devtools.generate.utils.jAngel.utils.StringUtil;
|
||||
import com.cwhelp.modules.business.domain.BssGoods;
|
||||
import com.cwhelp.modules.business.domain.BssTaxinfo;
|
||||
import com.cwhelp.modules.business.domain.BssVatInvoice;
|
||||
import com.cwhelp.modules.business.service.BssVatInvoiceService;
|
||||
import com.cwhelp.modules.system.domain.Upload;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Example;
|
||||
|
|
@ -20,7 +25,13 @@ import org.springframework.stereotype.Controller;
|
|||
import org.springframework.ui.Model;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -143,4 +154,91 @@ public class BssVatInvoiceController {
|
|||
return ResultVoUtil.error(statusEnum.getMessage() + "失败,请重新操作");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 上传发票图片
|
||||
*/
|
||||
@PostMapping("/upload/image")
|
||||
@ResponseBody
|
||||
public ResultVo uploadImage(@RequestParam("image") MultipartFile multipartFile) {
|
||||
|
||||
// 创建Upload实体对象
|
||||
Upload upload = FileUpload.getFile(multipartFile, "/images");
|
||||
try {
|
||||
FileUpload.transferTo(multipartFile, upload);
|
||||
File destFile = FileUpload.getDestFile(upload);
|
||||
VatInvoiceResult vatInvoiceResult = BaiduAipOCR.queryBaiduVatInvoiceApi(destFile);
|
||||
WordsResult wordsResult = vatInvoiceResult.getWords_result();
|
||||
//销售方
|
||||
BssTaxinfo sellerTaxInfo = new BssTaxinfo();
|
||||
sellerTaxInfo.setName(wordsResult.getSellerName());
|
||||
sellerTaxInfo.setTaxNo(wordsResult.getSellerRegisterNum());
|
||||
sellerTaxInfo.setAccount(wordsResult.getSellerBank());
|
||||
sellerTaxInfo.setAddressPhone(wordsResult.getSellerAddress());
|
||||
//购买方
|
||||
BssTaxinfo purchaserTaxInfo = new BssTaxinfo();
|
||||
purchaserTaxInfo.setName(wordsResult.getPurchaserName());
|
||||
purchaserTaxInfo.setTaxNo(wordsResult.getPurchaserRegisterNum());
|
||||
purchaserTaxInfo.setAccount(wordsResult.getPurchaserBank());
|
||||
purchaserTaxInfo.setAddressPhone(wordsResult.getPurchaserAddress());
|
||||
//商品
|
||||
List<BssGoods> goods = new ArrayList<>();
|
||||
List<CommodityName> commodityNames = wordsResult.getCommodityName();
|
||||
List<CommodityType> commodityTypes = wordsResult.getCommodityType();
|
||||
List<CommodityUnit> commodityUnits = wordsResult.getCommodityUnit();
|
||||
List<CommodityNum> commodityNums = wordsResult.getCommodityNum();
|
||||
List<CommodityPrice> commodityPrices = wordsResult.getCommodityPrice();
|
||||
List<CommodityAmount> commodityAmounts = wordsResult.getCommodityAmount();
|
||||
List<CommodityTaxRate> commodityTaxRates = wordsResult.getCommodityTaxRate();
|
||||
List<CommodityTax> commodityTaxs = wordsResult.getCommodityTax();
|
||||
|
||||
for (int i = 0; i < commodityNames.size(); i++) {
|
||||
BssGoods good = new BssGoods();
|
||||
good.setName(commodityNames.get(i).getWord());
|
||||
if (ToolUtil.checkListSize(commodityTypes) && !StringUtil.isBlank(commodityTypes.get(i).getWord())) {
|
||||
good.setSpecification(commodityTypes.get(i).getWord());
|
||||
}
|
||||
if (ToolUtil.checkListSize(commodityUnits) && !StringUtil.isBlank(commodityUnits.get(i).getWord())) {
|
||||
good.setUnit(commodityUnits.get(i).getWord());
|
||||
}
|
||||
if (ToolUtil.checkListSize(commodityNums) && !StringUtil.isBlank(commodityNums.get(i).getWord())) {
|
||||
good.setNum(Integer.valueOf(commodityNums.get(i).getWord()));
|
||||
}
|
||||
if (ToolUtil.checkListSize(commodityPrices) && !StringUtil.isBlank(commodityPrices.get(i).getWord())) {
|
||||
good.setUnitPrice(commodityPrices.get(i).getWord());
|
||||
}
|
||||
if (ToolUtil.checkListSize(commodityAmounts) && !StringUtil.isBlank(commodityAmounts.get(i).getWord())) {
|
||||
good.setDetailAmount(new BigDecimal(commodityAmounts.get(i).getWord()));
|
||||
}
|
||||
if (ToolUtil.checkListSize(commodityTaxRates) && !StringUtil.isBlank(commodityTaxRates.get(i).getWord())) {
|
||||
good.setTaxRate(commodityTaxRates.get(i).getWord());
|
||||
}
|
||||
if (ToolUtil.checkListSize(commodityTaxs) && !StringUtil.isBlank(commodityTaxs.get(i).getWord())) {
|
||||
good.setTaxAmount(new BigDecimal(commodityTaxs.get(i).getWord()));
|
||||
}
|
||||
goods.add(good);
|
||||
}
|
||||
|
||||
BssVatInvoice vatInvoice = new BssVatInvoice();
|
||||
vatInvoice.setInvoiceCode(wordsResult.getInvoiceCode());
|
||||
vatInvoice.setInvoiceNo(wordsResult.getInvoiceNum());
|
||||
vatInvoice.setInvoiceDate(wordsResult.getInvoiceDate());
|
||||
vatInvoice.setCheckCode(wordsResult.getCheckCode());
|
||||
vatInvoice.setInvoiceMoney(new BigDecimal(wordsResult.getTotalAmount()));
|
||||
vatInvoice.setTaxAmount(new BigDecimal(wordsResult.getTotalTax()));
|
||||
vatInvoice.setTotalAmount(new BigDecimal(wordsResult.getAmountInFiguers()));
|
||||
vatInvoice.setTotalAmountCn(wordsResult.getAmountInWords());
|
||||
vatInvoice.setRemark(wordsResult.getRemarks());
|
||||
vatInvoice.setBuyTaxInfo(purchaserTaxInfo);
|
||||
vatInvoice.setSalerTaxInfo(sellerTaxInfo);
|
||||
vatInvoice.setBssGoods(goods);
|
||||
vatInvoice.setInvoiceImg(upload.getPath());
|
||||
vatInvoice.setInvoiceType(VatInvoiceTypeEnum.getVatInvoiceCode(wordsResult.getInvoiceType()));
|
||||
|
||||
return ResultVoUtil.success(vatInvoice);
|
||||
} catch (Exception e) {
|
||||
return ResultVoUtil.error("上传图片失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -22,7 +22,7 @@ spring:
|
|||
devtools:
|
||||
restart:
|
||||
enabled: true
|
||||
## jpa配置
|
||||
## 11jpa配置
|
||||
jpa:
|
||||
show-sql: true
|
||||
hibernate:
|
||||
|
|
|
|||
|
|
@ -332,8 +332,8 @@ layui.use(['element', 'form', 'layer', 'upload'], function () {
|
|||
,exts: 'jpg|jpeg|png|gif' //支持的图片格式
|
||||
,multiple: true //开启多文件选择
|
||||
,choose: function (obj) {
|
||||
var upload = $('.upload-image');
|
||||
obj.preview(function (index, file, result) {
|
||||
var upload = $('.upload-image');
|
||||
var name = upload.attr('name');
|
||||
var show = upload.parents('.layui-form-item').children('.upload-show');
|
||||
show.append("<div class='upload-item'><img src='"+ result +"'/>" +
|
||||
|
|
@ -349,6 +349,7 @@ layui.use(['element', 'form', 'layer', 'upload'], function () {
|
|||
if(hide.length > 0){
|
||||
var item = hide.parent('.upload-item');
|
||||
if (res.code === 200) {
|
||||
alert(res.data[field]);
|
||||
hide.val(res.data[field]);
|
||||
item.addClass('succeed');
|
||||
}else {
|
||||
|
|
@ -361,6 +362,63 @@ layui.use(['element', 'form', 'layer', 'upload'], function () {
|
|||
}
|
||||
});
|
||||
|
||||
/** 上传图片(增值税发票)操作 */
|
||||
upload.render({
|
||||
elem: '#vatInvoiceImg' //绑定元素
|
||||
,url: $('#vatInvoiceImg').attr('up-url') //上传接口
|
||||
,field: 'image' //文件域的字段名
|
||||
,acceptMime: 'image/*' //选择文件类型
|
||||
,exts: 'jpg|jpeg|png|gif' //支持的图片格式
|
||||
,multiple: false
|
||||
,choose: function (obj) {
|
||||
var upload = $('#vatInvoiceImg');
|
||||
var show = upload.parents('.layui-form-item').children('.upload-show');
|
||||
if ($(show).children("div").length == 1) {
|
||||
alert("只允许上传一张照片!");
|
||||
return ;
|
||||
}
|
||||
obj.preview(function (index, file, result) {
|
||||
var name = upload.attr('name');
|
||||
var show = upload.parents('.layui-form-item').children('.upload-show');
|
||||
show.append("<div class='upload-item'><img src='"+ result +"'/>" +
|
||||
"<input id='"+ index +"' type='hidden' name='"+name+"'/>" +
|
||||
"<i class='upload-item-close layui-icon layui-icon-close'></i></div>");
|
||||
});
|
||||
}
|
||||
,done: function(res, index, upload){
|
||||
// 解决节点渲染和异步上传不同步问题
|
||||
var interval = window.setInterval(function(){
|
||||
var hide = $("#"+index);
|
||||
if(hide.length > 0){
|
||||
var item = hide.parent('.upload-item');
|
||||
if (res.code === 200) {
|
||||
$('#invoiceType').find("option[value='" + res.data['invoiceType'] + "']").attr("selected",true);
|
||||
$('#invoiceCode').val(res.data['invoiceCode']);
|
||||
$('#invoiceNo').val(res.data['invoiceNo']);
|
||||
$('#checkCode').val(res.data['checkCode']);
|
||||
var invoiceDate = res.data['invoiceDate'];
|
||||
invoiceDate = invoiceDate.replace('年','-')
|
||||
invoiceDate = invoiceDate.replace('月','-')
|
||||
invoiceDate = invoiceDate.replace('日','')
|
||||
$('#laydate').val(invoiceDate);
|
||||
$('#remark').val(res.data['remark']);
|
||||
$('#invoiceMoney').val(res.data['invoiceMoney']);
|
||||
$('#taxAmount').val(res.data['taxAmount']);
|
||||
$('#totalAmount').val(res.data['totalAmount']);
|
||||
form.render("select");
|
||||
hide.val(res.data['invoiceImg']);
|
||||
item.addClass('succeed');
|
||||
|
||||
}else {
|
||||
hide.remove();
|
||||
item.addClass('error');
|
||||
}
|
||||
clearInterval(interval);
|
||||
}
|
||||
}, 100);
|
||||
}
|
||||
});
|
||||
|
||||
// 删除上传图片展示项
|
||||
$(document).on("click", ".upload-item-close", function () {
|
||||
$(this).parent('.upload-item').remove();
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
<div class="layui-tab layui-tab-card">
|
||||
<ul class="layui-tab-title">
|
||||
<li class="layui-this">手工录入</li>
|
||||
<li>查验录入</li>
|
||||
<!-- <li>查验录入</li>-->
|
||||
</ul>
|
||||
<div class="layui-tab-content" style="height: 100%;">
|
||||
<div class="layui-tab-item layui-show">
|
||||
|
|
@ -18,79 +18,76 @@
|
|||
<div class="layui-field-box">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">项目路径</label>
|
||||
<label class="layui-form-label required">发票类型</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="projectPath" autocomplete="off" class="layui-input">
|
||||
<select id="invoiceType" name="invoiceType" lay-filter="invoiceType">
|
||||
<option value="0">增值税普通发票</option>
|
||||
<option value="1">增值税专用发票</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">项目包名</label>
|
||||
<label class="layui-form-label required">发票代码</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="packagePath" autocomplete="off" class="layui-input">
|
||||
<input type="text" id="invoiceCode" name="invoiceCode" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">作者名称</label>
|
||||
<label class="layui-form-label required">发票号码</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="author" autocomplete="off" class="layui-input">
|
||||
<input type="text" id="invoiceNo" name="invoiceNo" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">父级菜单</label>
|
||||
<label class="layui-form-label required">校验码</label>
|
||||
<div class="layui-input-inline">
|
||||
<input class="layui-input select-tree" type="text" name="genPMenu" value="顶级菜单" data-value="0" placeholder="请选择父级菜单">
|
||||
<input type="text" id="checkCode" name="checkCode" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">模块名称</label>
|
||||
<label class="layui-form-label required">发票日期</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="genModule" autocomplete="off" class="layui-input">
|
||||
<input type="text" name="invoiceDate" class="layui-input" id="laydate" placeholder="yyyy-MM-dd" lay-key="1">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">业务名称</label>
|
||||
<label class="layui-form-label">备注</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="genTitle" autocomplete="off" class="layui-input">
|
||||
<input type="text" id="remark" name="remark" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">表前缀</label>
|
||||
<label class="layui-form-label required">不含税金额</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="tablePrefix" autocomplete="off" class="layui-input">
|
||||
<input type="text" id="invoiceMoney" name="invoiceMoney" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">表名称</label>
|
||||
<label class="layui-form-label required">税额</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="tableName" autocomplete="off" class="layui-input">
|
||||
<input type="text" id="taxAmount" name="taxAmount" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">实体类</label>
|
||||
<label class="layui-form-label required">价税合计</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="tableEntity" autocomplete="off" class="layui-input tableEntity">
|
||||
<input type="text" id="totalAmount" name="totalAmount" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">访问地址</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="requestMapping" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">模块结构</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="radio" name="moduleType" value="1" title="独立模块" checked="">
|
||||
<input type="radio" name="moduleType" value="2" title="后台模块">
|
||||
</div>
|
||||
<label class="layui-form-label">发票图片</label>
|
||||
<div class="layui-input-inline">
|
||||
<button type="button" class="layui-btn" id="vatInvoiceImg" name="invoiceImg" up-field="path" up-url="/bss/vatInvoice/upload/image">
|
||||
<i class="layui-icon"></i>上传图片
|
||||
</button>
|
||||
</div>
|
||||
<div class="upload-show"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -113,31 +110,27 @@
|
|||
<thead>
|
||||
<tr>
|
||||
<th width="20">#</th>
|
||||
<th width="100">字段名称</th>
|
||||
<th width="100">字段标题</th>
|
||||
<th width="100">数据类型</th>
|
||||
<th width="100">查询(可选)</th>
|
||||
<th width="100">列表显示</th>
|
||||
<th>字段验证(可选)</th>
|
||||
<th width="100">货物名称</th>
|
||||
<th width="100">规格型号</th>
|
||||
<th width="100">单位</th>
|
||||
<th width="100">数量</th>
|
||||
<th width="100">单价</th>
|
||||
<th width="100">金额</th>
|
||||
<th width="100">税率</th>
|
||||
<th width="100">税额</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="entity">
|
||||
<tr>
|
||||
<td class="entity-number" th:text="1"></td>
|
||||
<td class="entity-name"><input type="text" name="name"/></td>
|
||||
<td class="entity-title"><input type="text" name="title"/></td>
|
||||
<td class="layui-form entity-type">
|
||||
<input type="text" name="title"/>
|
||||
</td>
|
||||
<td class="layui-form entity-query">
|
||||
<input type="text" name="title"/>
|
||||
</td>
|
||||
<td class="layui-form entity-show">
|
||||
<input type="text" name="title"/>
|
||||
</td>
|
||||
<td class="entity-verify">
|
||||
<input type="text" name="title"/>
|
||||
</td>
|
||||
<td class="entity-specification"><input type="text" name="specification"/></td>
|
||||
<td class="entity-unit"><input type="text" name="unit"/></td>
|
||||
<td class="entity-num"><input type="text" name="num"/></td>
|
||||
<td class="entity-unitPrice"><input type="text" name="unitPrice"/></td>
|
||||
<td class="entity-detailAmount"><input type="text" name="detailAmount"/></td>
|
||||
<td class="entity-taxRate"><input type="text" name="taxRate"/></td>
|
||||
<td class="entity-taxAmount"><input type="text" name="taxAmount"/></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
@ -149,7 +142,7 @@
|
|||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="layui-tab-item">
|
||||
<!--<div class="layui-tab-item">
|
||||
<form th:action="@{/bss/vatInvoice/check}">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label required">发票代码</label>
|
||||
|
|
@ -186,7 +179,7 @@
|
|||
<button class="layui-btn btn-secondary close-popup"><i class="fa fa-times-circle"></i> 关闭</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -209,5 +202,6 @@
|
|||
});
|
||||
</script>
|
||||
<script type="text/javascript" th:src="@{/js/generate.code.js}"></script>
|
||||
<script type="text/javascript" th:src="@{/js/build.js}"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -59,7 +59,7 @@
|
|||
</style>
|
||||
</head>
|
||||
<body class="timo-layout-page">
|
||||
<div class="layui-row layui-col-space15">
|
||||
<!--<div class="layui-row layui-col-space15">
|
||||
<div class="layui-col-md3 layui-col-sm6 layui-col-xs12">
|
||||
<div class="widget-small widget-user">
|
||||
<i class="icon fa fa-users fa-3x"></i>
|
||||
|
|
@ -96,7 +96,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>-->
|
||||
<div class="layui-row layui-col-space15">
|
||||
<div class="layui-col-md8">
|
||||
<div class="layui-card">
|
||||
|
|
|
|||
|
|
@ -21,6 +21,10 @@
|
|||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="Maven: com.baidu.aip:java-sdk:4.12.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.json:json:20160810" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.26" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-simple:1.7.26" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.1.4.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.1.4.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.1.4.RELEASE" level="project" />
|
||||
|
|
@ -103,11 +107,11 @@
|
|||
<orderEntry type="library" scope="RUNTIME" name="Maven: mysql:mysql-connector-java:5.1.46" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.projectlombok:lombok:1.18.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.sf.ehcache:ehcache:2.10.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.26" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.jsoup:jsoup:1.11.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.56" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.coobird:thumbnailator:0.4.8" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
|
|
@ -14,4 +14,12 @@
|
|||
<version>2.0.1</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.baidu.aip</groupId>
|
||||
<artifactId>java-sdk</artifactId>
|
||||
<version>4.12.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
package com.cwhelp.common.api.baidu;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baidu.aip.ocr.AipOcr;
|
||||
import com.cwhelp.common.api.baidu.entity.vatinvoice.VatInvoiceResult;
|
||||
import com.cwhelp.common.api.baidu.entity.vatinvoice.WordsResult;
|
||||
import org.json.JSONObject;
|
||||
import sun.misc.BASE64Encoder;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* @author: yan.y
|
||||
* @Description:
|
||||
* @Date: Created in 21:16 2019/10/5
|
||||
*/
|
||||
public class BaiduAipOCR {
|
||||
|
||||
private static final String APP_ID = "16956531";
|
||||
private static final String API_KEY = "hLXMPm45eMxUDl3BVELvZAjV";
|
||||
private static final String SECRET_KEY = "UeNdsyE23QFHLUx1Ge9D3kfrNwH6Eixl";
|
||||
|
||||
private static AipOcr client = null;
|
||||
|
||||
static {
|
||||
initAipOcr();
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化
|
||||
*/
|
||||
private static void initAipOcr(){
|
||||
if (null == client) {
|
||||
client = new AipOcr(APP_ID, API_KEY, SECRET_KEY);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 百度OCR接口 增值税发票
|
||||
* @param file
|
||||
* @return
|
||||
*/
|
||||
public static VatInvoiceResult queryBaiduVatInvoiceApi(File file){
|
||||
byte[] data = null;
|
||||
// 读取图片字节数组
|
||||
try {
|
||||
InputStream in = new FileInputStream(file);
|
||||
data = new byte[in.available()];
|
||||
in.read(data);
|
||||
in.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
JSONObject result = client.vatInvoice(data, null);
|
||||
VatInvoiceResult vatInvoiceResult = JSON.parseObject(result.toString(), VatInvoiceResult.class);
|
||||
return vatInvoiceResult;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package com.cwhelp.common.api.baidu.entity.vatinvoice;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author: yan.y
|
||||
* @Description:
|
||||
* @Date: Created in 23:32 2019/10/5
|
||||
*/
|
||||
@Data
|
||||
public class CommodityAmount implements Serializable {
|
||||
private String row;
|
||||
|
||||
private String word;
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package com.cwhelp.common.api.baidu.entity.vatinvoice;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author: yan.y
|
||||
* @Description:
|
||||
* @Date: Created in 23:32 2019/10/5
|
||||
*/
|
||||
@Data
|
||||
public class CommodityName implements Serializable {
|
||||
private String row;
|
||||
|
||||
private String word;
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package com.cwhelp.common.api.baidu.entity.vatinvoice;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author: yan.y
|
||||
* @Description:
|
||||
* @Date: Created in 23:32 2019/10/5
|
||||
*/
|
||||
@Data
|
||||
public class CommodityNum implements Serializable {
|
||||
private String row;
|
||||
|
||||
private String word;
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.cwhelp.common.api.baidu.entity.vatinvoice;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author: yan.y
|
||||
* @Description:
|
||||
* @Date: Created in 23:32 2019/10/5
|
||||
*/
|
||||
@Data
|
||||
public class CommodityPrice implements Serializable {
|
||||
|
||||
private String row;
|
||||
|
||||
private String word;
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package com.cwhelp.common.api.baidu.entity.vatinvoice;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author: yan.y
|
||||
* @Description:
|
||||
* @Date: Created in 23:32 2019/10/5
|
||||
*/
|
||||
@Data
|
||||
public class CommodityTax implements Serializable {
|
||||
private String row;
|
||||
|
||||
private String word;
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package com.cwhelp.common.api.baidu.entity.vatinvoice;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author: yan.y
|
||||
* @Description:
|
||||
* @Date: Created in 23:32 2019/10/5
|
||||
*/
|
||||
@Data
|
||||
public class CommodityTaxRate implements Serializable {
|
||||
private String row;
|
||||
|
||||
private String word;
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package com.cwhelp.common.api.baidu.entity.vatinvoice;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author: yan.y
|
||||
* @Description:
|
||||
* @Date: Created in 23:32 2019/10/5
|
||||
*/
|
||||
@Data
|
||||
public class CommodityType implements Serializable {
|
||||
private String row;
|
||||
|
||||
private String word;
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package com.cwhelp.common.api.baidu.entity.vatinvoice;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author: yan.y
|
||||
* @Description:
|
||||
* @Date: Created in 23:32 2019/10/5
|
||||
*/
|
||||
@Data
|
||||
public class CommodityUnit implements Serializable {
|
||||
private String row;
|
||||
|
||||
private String word;
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
package com.cwhelp.common.api.baidu.entity.vatinvoice;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author: yan.y
|
||||
* @Description:
|
||||
* @Date: Created in 23:49 2019/10/5
|
||||
*/
|
||||
@Data
|
||||
public class VatInvoiceResult {
|
||||
|
||||
private String log_id;
|
||||
|
||||
private WordsResult words_result;
|
||||
|
||||
private String words_result_num;
|
||||
|
||||
private String direction;
|
||||
}
|
||||
|
|
@ -0,0 +1,102 @@
|
|||
package com.cwhelp.common.api.baidu.entity.vatinvoice;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author: yan.y
|
||||
* @Description:
|
||||
* @Date: Created in 23:24 2019/10/5
|
||||
*/
|
||||
@Data
|
||||
public class WordsResult implements Serializable {
|
||||
|
||||
//销售方
|
||||
private String SellerAddress;
|
||||
|
||||
private String SellerRegisterNum;
|
||||
|
||||
private String SellerName;
|
||||
|
||||
private String SellerBank;
|
||||
|
||||
// 发票信息
|
||||
private String Remarks;
|
||||
|
||||
private String CheckCode;
|
||||
|
||||
private String InvoiceNum;
|
||||
|
||||
private String InvoiceCode;
|
||||
|
||||
private String InvoiceDate;
|
||||
|
||||
private String InvoiceType;
|
||||
|
||||
private String AmountInFiguers;
|
||||
|
||||
private String AmountInWords;
|
||||
|
||||
//购买方
|
||||
private String PurchaserRegisterNum;
|
||||
|
||||
private String PurchaserName;
|
||||
|
||||
private String PurchaserAddress;
|
||||
|
||||
private String PurchaserBank;
|
||||
|
||||
//商品
|
||||
private List<CommodityName> CommodityName;
|
||||
|
||||
private List<CommodityType> CommodityType;
|
||||
|
||||
private List<CommodityUnit> CommodityUnit;
|
||||
|
||||
private List<CommodityNum> CommodityNum;
|
||||
|
||||
private List<CommodityPrice> CommodityPrice;
|
||||
|
||||
private List<CommodityAmount> CommodityAmount;
|
||||
|
||||
private List<CommodityTaxRate> CommodityTaxRate;
|
||||
|
||||
private List<CommodityTax> CommodityTax;
|
||||
|
||||
private String TotalAmount;
|
||||
|
||||
private String TotalTax;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "WordsResult{" +
|
||||
"SellerAddress='" + SellerAddress + '\'' +
|
||||
", SellerRegisterNum='" + SellerRegisterNum + '\'' +
|
||||
", SellerName='" + SellerName + '\'' +
|
||||
", SellerBank='" + SellerBank + '\'' +
|
||||
", Remarks='" + Remarks + '\'' +
|
||||
", CheckCode='" + CheckCode + '\'' +
|
||||
", InvoiceNum='" + InvoiceNum + '\'' +
|
||||
", InvoiceCode='" + InvoiceCode + '\'' +
|
||||
", InvoiceDate='" + InvoiceDate + '\'' +
|
||||
", AmountInFiguers='" + AmountInFiguers + '\'' +
|
||||
", AmountInWords='" + AmountInWords + '\'' +
|
||||
", PurchaserRegisterNum='" + PurchaserRegisterNum + '\'' +
|
||||
", PurchaserName='" + PurchaserName + '\'' +
|
||||
", PurchaserAddress='" + PurchaserAddress + '\'' +
|
||||
", PurchaserBank='" + PurchaserBank + '\'' +
|
||||
", CommodityName=" + CommodityName +
|
||||
", CommodityType=" + CommodityType +
|
||||
", CommodityUnit=" + CommodityUnit +
|
||||
", CommodityNum=" + CommodityNum +
|
||||
", CommodityPrice=" + CommodityPrice +
|
||||
", CommodityAmount=" + CommodityAmount +
|
||||
", CommodityTaxRate=" + CommodityTaxRate +
|
||||
", CommodityTax=" + CommodityTax +
|
||||
", TotalAmount='" + TotalAmount + '\'' +
|
||||
", TotalTax='" + TotalTax + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package com.cwhelp.common.api.baidu.entity.vatinvoice.enums;
|
||||
|
||||
/**
|
||||
* @author: yan.y
|
||||
* @Description:
|
||||
* @Date: Created in 0:46 2019/10/6
|
||||
*/
|
||||
public enum VatInvoiceTypeEnum {
|
||||
|
||||
ORDINARY_VAT_INVOICE("普通发票",0),
|
||||
SPECIAL_VAT_INVOICE("专用发票",1);
|
||||
|
||||
public String invoiceType;
|
||||
|
||||
public int invoiceCode;
|
||||
|
||||
VatInvoiceTypeEnum(String invoiceType, int invoiceCode) {
|
||||
this.invoiceType = invoiceType;
|
||||
this.invoiceCode = invoiceCode;
|
||||
}
|
||||
|
||||
public static int getVatInvoiceCode(String invoiceType) {
|
||||
VatInvoiceTypeEnum[] values = VatInvoiceTypeEnum.values();
|
||||
for (VatInvoiceTypeEnum value : values) {
|
||||
if (value.invoiceType.equals(invoiceType)) {
|
||||
return value.invoiceCode;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -18,14 +18,14 @@ import java.net.URI;
|
|||
* @Modified by:
|
||||
*/
|
||||
public class HttpYoushangFapiaoUtil {
|
||||
private static final String url = "https://fapiao.youshang.com/GuoShuiAction.do";
|
||||
private static final String URL = "https://fapiao.youshang.com/GuoShuiAction.do";
|
||||
|
||||
public static final JSONObject getVatInfoiceInfo(JSONObject params){
|
||||
final String action = "findInvoiceResult";
|
||||
JSONObject result = new JSONObject();
|
||||
try {
|
||||
HttpClient httpClient = HttpClients.createDefault();
|
||||
URIBuilder uriBuilder = new URIBuilder(url);
|
||||
URIBuilder uriBuilder = new URIBuilder(URL);
|
||||
URI uri = uriBuilder.addParameter("action", action)
|
||||
.addParameter("fpdm", params.getString("fpdm"))
|
||||
.addParameter("fphm", params.getString("fphm"))
|
||||
|
|
@ -46,5 +46,4 @@ public class HttpYoushangFapiaoUtil {
|
|||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import java.io.UnsupportedEncodingException;
|
|||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.net.URLDecoder;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
import java.util.TreeMap;
|
||||
|
|
@ -147,4 +148,11 @@ public class ToolUtil {
|
|||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static boolean checkListSize(List list) {
|
||||
if (list.size() > 0)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -133,5 +133,9 @@
|
|||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.baidu.aip:java-sdk:4.12.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.json:json:20160810" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-simple:1.7.26" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.coobird:thumbnailator:0.4.8" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
|
|
@ -96,5 +96,9 @@
|
|||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.baidu.aip:java-sdk:4.12.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.json:json:20160810" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-simple:1.7.26" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.coobird:thumbnailator:0.4.8" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
|
|
@ -115,5 +115,9 @@
|
|||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.baidu.aip:java-sdk:4.12.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.json:json:20160810" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-simple:1.7.26" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.coobird:thumbnailator:0.4.8" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
|
|
@ -29,6 +29,7 @@
|
|||
<orderEntry type="library" name="Maven: org.apache.xmlbeans:xmlbeans:3.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-compress:1.18" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.virtuald:curvesapi:1.04" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.coobird:thumbnailator:0.4.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.1.4.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.1.4.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.1.4.RELEASE" level="project" />
|
||||
|
|
@ -117,5 +118,8 @@
|
|||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.baidu.aip:java-sdk:4.12.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.json:json:20160810" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-simple:1.7.26" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
|
|
@ -26,6 +26,11 @@
|
|||
<artifactId>system</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.coobird</groupId>
|
||||
<artifactId>thumbnailator</artifactId>
|
||||
<version>0.4.8</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import com.cwhelp.common.utils.ToolUtil;
|
|||
import com.cwhelp.component.fileUpload.config.properties.UploadProjectProperties;
|
||||
import com.cwhelp.component.fileUpload.enums.UploadResultEnum;
|
||||
import com.cwhelp.modules.system.domain.Upload;
|
||||
import net.coobird.thumbnailator.Thumbnails;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.File;
|
||||
|
|
@ -128,6 +129,7 @@ public class FileUpload {
|
|||
BigInteger SHA1Bi = new BigInteger(1, sha1.digest());
|
||||
upload.setMd5(MD5Bi.toString(16));
|
||||
upload.setSha1(SHA1Bi.toString(16));
|
||||
Thumbnails.of(getDestFile(upload)).scale(1).toFile(getDestFile(upload));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -150,5 +152,4 @@ public class FileUpload {
|
|||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -118,5 +118,9 @@
|
|||
<orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.56" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.baidu.aip:java-sdk:4.12.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.json:json:20160810" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-simple:1.7.26" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.coobird:thumbnailator:0.4.8" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
|
|
@ -132,5 +132,9 @@
|
|||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.baidu.aip:java-sdk:4.12.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.json:json:20160810" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-simple:1.7.26" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.coobird:thumbnailator:0.4.8" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
|
|
@ -123,5 +123,9 @@
|
|||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.baidu.aip:java-sdk:4.12.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.json:json:20160810" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-simple:1.7.26" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.coobird:thumbnailator:0.4.8" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
|
|
@ -96,5 +96,9 @@
|
|||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.baidu.aip:java-sdk:4.12.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.json:json:20160810" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-simple:1.7.26" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.coobird:thumbnailator:0.4.8" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
|
|
@ -147,5 +147,9 @@
|
|||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.baidu.aip:java-sdk:4.12.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.json:json:20160810" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-simple:1.7.26" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.coobird:thumbnailator:0.4.8" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
|
|
@ -94,4 +94,16 @@ public class StringUtil {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 字符串是否是空
|
||||
* @param str
|
||||
* @return
|
||||
*/
|
||||
public static boolean isBlank(String str) {
|
||||
if (null == str || "".equals(str) || "null".equals(str))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -142,7 +142,11 @@ layui.use(['element', 'form', 'layer', 'formSelects'], function () {
|
|||
// 删除字段
|
||||
$(".field-del").on("click", function () {
|
||||
if(field != null){
|
||||
if (entity.children("tr").length == 1) {
|
||||
return;
|
||||
}
|
||||
$(field).parent().remove();
|
||||
entity.children("tr:last-child").children(".entity-number").click();
|
||||
resetNumber();
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -96,5 +96,9 @@
|
|||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.baidu.aip:java-sdk:4.12.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.json:json:20160810" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-simple:1.7.26" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.coobird:thumbnailator:0.4.8" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
|
|
@ -31,8 +31,6 @@ public class BssGoods implements Serializable {
|
|||
@GeneratedValue(strategy=GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
private String name;
|
||||
// 货物代码
|
||||
private String code;
|
||||
// 数量
|
||||
private Integer num;
|
||||
// 细节金额
|
||||
|
|
|
|||
|
|
@ -43,9 +43,6 @@ public class BssVatInvoice implements Serializable {
|
|||
// 校验码
|
||||
@Column(name = "check_code")
|
||||
private String checkCode;
|
||||
// 机器编码
|
||||
@Column(name = "machine_no")
|
||||
private String machineNo;
|
||||
// 发票金额
|
||||
@Column(name = "invoice_money")
|
||||
private BigDecimal invoiceMoney;
|
||||
|
|
@ -58,11 +55,16 @@ public class BssVatInvoice implements Serializable {
|
|||
// 总金额(大写)
|
||||
@Column(name = "total_amount_cn")
|
||||
private String totalAmountCn;
|
||||
|
||||
//发票类型
|
||||
@Column(name = "invoice_type")
|
||||
private Integer invoiceType;
|
||||
|
||||
// 备注
|
||||
private String remark;
|
||||
|
||||
@Column(name = "invoice_img")
|
||||
private String invoiceImg;
|
||||
// 购买方纳税人信息
|
||||
@OneToOne(fetch=FetchType.LAZY)
|
||||
@NotFound(action= NotFoundAction.IGNORE)
|
||||
|
|
|
|||
|
|
@ -116,5 +116,9 @@
|
|||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.baidu.aip:java-sdk:4.12.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.json:json:20160810" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-simple:1.7.26" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.coobird:thumbnailator:0.4.8" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
14
pom.xml
14
pom.xml
|
|
@ -120,5 +120,19 @@
|
|||
<artifactId>httpclient</artifactId>
|
||||
<version>4.5.8</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 百度api -->
|
||||
<dependency>
|
||||
<groupId>com.baidu.aip</groupId>
|
||||
<artifactId>java-sdk</artifactId>
|
||||
<version>4.12.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 图片压缩 -->
|
||||
<dependency>
|
||||
<groupId>net.coobird</groupId>
|
||||
<artifactId>thumbnailator</artifactId>
|
||||
<version>0.4.8</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
|||
Loading…
Reference in New Issue