ariesy 增加税码字段

release
yefei 2 years ago
parent 84d6d35c59
commit 44874a4314
  1. 1
      dxhy-core/src/main/java/com/dxhy/core/job/entity/TDxRecordInvoiceDetail.java
  2. 5
      dxhy-core/src/main/java/com/dxhy/core/model/CheckRecordInvoiceDetailVO.java
  3. 112
      dxhy-core/src/main/java/com/dxhy/core/service/invoicedetail/InvoiceDetailServiceImpl.java
  4. 4
      dxhy-erp/src/main/java/com/dxhy/erp/config/ErpWebConfiguration.java
  5. 4
      dxhy-erp/src/main/java/com/dxhy/erp/controller/SDNYMainProcessController.java
  6. 5
      dxhy-erp/src/main/java/com/dxhy/erp/entity/TDxRecordInvoiceDetail.java
  7. 5
      dxhy-erp/src/main/java/com/dxhy/erp/entity/sdny/SNInvoiceDetail.java
  8. 66
      dxhy-erp/src/main/java/com/dxhy/erp/service/SNPushCheckRecordService.java
  9. 54
      dxhy-erp/src/main/java/com/dxhy/erp/service/impl/SignSaveInvoiceInfoServiceImpl.java

@ -91,4 +91,5 @@ public class TDxRecordInvoiceDetail implements Serializable {
* 商品编码 * 商品编码
*/ */
private String goodsNum; private String goodsNum;
} }

@ -50,6 +50,11 @@ public class CheckRecordInvoiceDetailVO {
*/ */
private String taxRate; private String taxRate;
/**
* 税码
*/
private String taxCode;
/** /**
* 税额 * 税额
*/ */

@ -95,7 +95,7 @@ public class InvoiceDetailServiceImpl extends MpBaseServiceImpl<TDxRecordInvoice
JSONObject checkInfo = null; JSONObject checkInfo = null;
String invoiceCode = pramsMap.get("invoiceCode"); String invoiceCode = pramsMap.get("invoiceCode");
String invoiceNo = pramsMap.get("invoiceNo"); String invoiceNo = pramsMap.get("invoiceNo");
String uuid = (StringUtils.isEmpty(invoiceCode)?"":invoiceCode) + invoiceNo; String uuid = (StringUtils.isEmpty(invoiceCode) ? "" : invoiceCode) + invoiceNo;
DynamicContextHolder.push(pramsMap.get("dbName") + DbConstant.BUSINESS_READ); DynamicContextHolder.push(pramsMap.get("dbName") + DbConstant.BUSINESS_READ);
QueryWrapper<TDxRecordInvoice> queryWrapper = new QueryWrapper<>(); QueryWrapper<TDxRecordInvoice> queryWrapper = new QueryWrapper<>();
@ -144,22 +144,17 @@ public class InvoiceDetailServiceImpl extends MpBaseServiceImpl<TDxRecordInvoice
/** /**
* 根据数据拼接需要返回的报文 * 根据数据拼接需要返回的报文
* *
* @param invoiceRecord * @param invoiceRecord 底账表信息
* 底账表信息 * @param vehicleSaleInfo 机动车表信息
* @param vehicleSaleInfo * @param invoiceDetailList 底账明细表信息
* 机动车表信息 * @param img 图片信息
* @param invoiceDetailList
* 底账明细表信息
* @param img
* 图片信息
* @return 返回 * @return 返回
*
*/ */
private JSONObject createCheckInfo(TDxRecordInvoice invoiceRecord, TDxVehicleSaleInvoice vehicleSaleInfo, private JSONObject createCheckInfo(TDxRecordInvoice invoiceRecord, TDxVehicleSaleInvoice vehicleSaleInfo,
List<TDxRecordInvoiceDetail> invoiceDetailList, TDxInvoiceImg img) { List<TDxRecordInvoiceDetail> invoiceDetailList, TDxInvoiceImg img) {
JSONObject checkInfo = new JSONObject(); JSONObject checkInfo = new JSONObject();
InvoiceSubjectVO checkRecordVo = this.convertToCheckRecordVo(invoiceRecord, img,invoiceDetailList); InvoiceSubjectVO checkRecordVo = this.convertToCheckRecordVo(invoiceRecord, img, invoiceDetailList);
// 取发票上的价税合计 // 取发票上的价税合计
String totalAmount = checkRecordVo.getTotalAmount(); String totalAmount = checkRecordVo.getTotalAmount();
@ -194,10 +189,10 @@ public class InvoiceDetailServiceImpl extends MpBaseServiceImpl<TDxRecordInvoice
} }
} }
checkInfo.put("invoiceDetails", detail); checkInfo.put("invoiceDetails", detail);
if("11".equals(invoiceRecord.getInvoiceType())){ if ("11".equals(invoiceRecord.getInvoiceType())) {
checkInfo.put("detailAmountSum", totalAmount); checkInfo.put("detailAmountSum", totalAmount);
checkInfo.put("taxAmountSum", checkRecordVo.getTaxAmount()); checkInfo.put("taxAmountSum", checkRecordVo.getTaxAmount());
}else { } else {
checkInfo.put("detailAmountSum", MathUtil.round(invoiceRecord.getInvoiceAmount().toPlainString())); checkInfo.put("detailAmountSum", MathUtil.round(invoiceRecord.getInvoiceAmount().toPlainString()));
if (StringUtils.isNotBlank(se) && invoiceRecord.getTaxAmount().compareTo(new BigDecimal(0)) == 0) { if (StringUtils.isNotBlank(se) && invoiceRecord.getTaxAmount().compareTo(new BigDecimal(0)) == 0) {
checkInfo.put("taxAmountSum", se); checkInfo.put("taxAmountSum", se);
@ -215,7 +210,7 @@ public class InvoiceDetailServiceImpl extends MpBaseServiceImpl<TDxRecordInvoice
return checkInfo; return checkInfo;
} }
private InvoiceSubjectVO convertToCheckRecordVo(TDxRecordInvoice invoiceRecord, TDxInvoiceImg img,List<TDxRecordInvoiceDetail> invoiceDetailList) { private InvoiceSubjectVO convertToCheckRecordVo(TDxRecordInvoice invoiceRecord, TDxInvoiceImg img, List<TDxRecordInvoiceDetail> invoiceDetailList) {
InvoiceSubjectVO checkRecordVo = new InvoiceSubjectVO(); InvoiceSubjectVO checkRecordVo = new InvoiceSubjectVO();
// 字典值转换 // 字典值转换
String fpzt = dictdetaServcice.queryDictName(DictConstant.INVOICE_STATUS, invoiceRecord.getInvoiceStatus()); String fpzt = dictdetaServcice.queryDictName(DictConstant.INVOICE_STATUS, invoiceRecord.getInvoiceStatus());
@ -270,17 +265,17 @@ public class InvoiceDetailServiceImpl extends MpBaseServiceImpl<TDxRecordInvoice
: MathUtil.round(invoiceRecord.getInvoiceAmount().toPlainString())); : MathUtil.round(invoiceRecord.getInvoiceAmount().toPlainString()));
checkRecordVo.setTaxAmount( checkRecordVo.setTaxAmount(
invoiceRecord.getTaxAmount() == null ? "" : MathUtil.round(invoiceRecord.getTaxAmount().toPlainString())); invoiceRecord.getTaxAmount() == null ? "" : MathUtil.round(invoiceRecord.getTaxAmount().toPlainString()));
if("11".equals(invoiceRecord.getInvoiceType())){ if ("11".equals(invoiceRecord.getInvoiceType())) {
BigDecimal detailAmount = new BigDecimal(0); BigDecimal detailAmount = new BigDecimal(0);
if(CollectionUtils.isNotEmpty(invoiceDetailList)){ if (CollectionUtils.isNotEmpty(invoiceDetailList)) {
for (TDxRecordInvoiceDetail tdxRecordInvoiceDetail:invoiceDetailList){ for (TDxRecordInvoiceDetail tdxRecordInvoiceDetail : invoiceDetailList) {
if(tdxRecordInvoiceDetail.getDetailAmount()!=null){ if (tdxRecordInvoiceDetail.getDetailAmount() != null) {
detailAmount = detailAmount.add(new BigDecimal(tdxRecordInvoiceDetail.getDetailAmount())); detailAmount = detailAmount.add(new BigDecimal(tdxRecordInvoiceDetail.getDetailAmount()));
} }
} }
} }
checkRecordVo.setTotalAmount(MathUtil.round(detailAmount.toPlainString())); checkRecordVo.setTotalAmount(MathUtil.round(detailAmount.toPlainString()));
}else { } else {
if (invoiceRecord.getTotalAmount() == null) { if (invoiceRecord.getTotalAmount() == null) {
BigDecimal add = invoiceRecord.getInvoiceAmount().add(invoiceRecord.getTaxAmount()); BigDecimal add = invoiceRecord.getInvoiceAmount().add(invoiceRecord.getTaxAmount());
checkRecordVo.setTotalAmount(MathUtil.round(add.toPlainString())); checkRecordVo.setTotalAmount(MathUtil.round(add.toPlainString()));
@ -345,10 +340,8 @@ public class InvoiceDetailServiceImpl extends MpBaseServiceImpl<TDxRecordInvoice
/** /**
* 转义认证类型 * 转义认证类型
* *
* @param rzlx * @param rzlx 认证类型
* 认证类型
* @return 返回 * @return 返回
*
*/ */
private String getRzlx(String rzlx) { private String getRzlx(String rzlx) {
String rzlxmc = ""; String rzlxmc = "";
@ -365,10 +358,8 @@ public class InvoiceDetailServiceImpl extends MpBaseServiceImpl<TDxRecordInvoice
/** /**
* 转义签收方式 * 转义签收方式
* *
* @param qsType * @param qsType 前首富昂视
* 前首富昂视
* @return 类型 * @return 类型
*
*/ */
private String getQsType(String qsType) { private String getQsType(String qsType) {
String qsfs = ""; String qsfs = "";
@ -391,10 +382,8 @@ public class InvoiceDetailServiceImpl extends MpBaseServiceImpl<TDxRecordInvoice
/** /**
* 转义签收状态 * 转义签收状态
* *
* @param qsStatus * @param qsStatus 签收状态
* 签收状态
* @return 返回 * @return 返回
*
*/ */
private String getQsStatus(String qsStatus) { private String getQsStatus(String qsStatus) {
String qszt = ""; String qszt = "";
@ -409,10 +398,8 @@ public class InvoiceDetailServiceImpl extends MpBaseServiceImpl<TDxRecordInvoice
/** /**
* 转义认证方式 * 转义认证方式
* *
* @param rzhType * @param rzhType 认证方式
* 认证方式
* @return 返回 * @return 返回
*
*/ */
private String getRztype(String rzhType) { private String getRztype(String rzhType) {
String rzType = ""; String rzType = "";
@ -538,15 +525,19 @@ public class InvoiceDetailServiceImpl extends MpBaseServiceImpl<TDxRecordInvoice
CheckRecordInvoiceDetailVO checkRecordDetailVo = new CheckRecordInvoiceDetailVO(); CheckRecordInvoiceDetailVO checkRecordDetailVo = new CheckRecordInvoiceDetailVO();
if (StringHelper.trimEnter(tDxRecordInvoiceDetail.getTaxRate()).matches("[0-9]+")) { if (StringHelper.trimEnter(tDxRecordInvoiceDetail.getTaxRate()).matches("[0-9]+")) {
checkRecordDetailVo.setTaxRate(StringHelper.trimEnter(tDxRecordInvoiceDetail.getTaxRate()) + "%"); checkRecordDetailVo.setTaxRate(StringHelper.trimEnter(tDxRecordInvoiceDetail.getTaxRate()) + "%");
} else if(tDxRecordInvoiceDetail.getTaxRate().contains(".")){ } else if (tDxRecordInvoiceDetail.getTaxRate().contains(".")) {
String taxRate = StringHelper.trimEnter(tDxRecordInvoiceDetail.getTaxRate()); String taxRate = StringHelper.trimEnter(tDxRecordInvoiceDetail.getTaxRate());
if(taxRate.contains(".")){ if (taxRate.contains(".")) {
taxRate = taxRate.replace(".", "").replace("0", ""); taxRate = taxRate.replace(".", "").replace("0", "");
} }
checkRecordDetailVo.setTaxRate(taxRate + "%"); checkRecordDetailVo.setTaxRate(taxRate + "%");
}else { } else {
checkRecordDetailVo.setTaxRate(StringHelper.trimEnter(tDxRecordInvoiceDetail.getTaxRate())); checkRecordDetailVo.setTaxRate(StringHelper.trimEnter(tDxRecordInvoiceDetail.getTaxRate()));
} }
if (checkRecordDetailVo.getTaxRate() != null)
checkRecordDetailVo.setTaxCode(getZSM(checkRecordDetailVo.getTaxRate()));
checkRecordDetailVo.setCph(StringHelper.trimEnter(tDxRecordInvoiceDetail.getCph())); checkRecordDetailVo.setCph(StringHelper.trimEnter(tDxRecordInvoiceDetail.getCph()));
checkRecordDetailVo.setDetailAmount(StringHelper.trimEnter(tDxRecordInvoiceDetail.getDetailAmount())); checkRecordDetailVo.setDetailAmount(StringHelper.trimEnter(tDxRecordInvoiceDetail.getDetailAmount()));
checkRecordDetailVo.setDetailNo(StringHelper.trimEnter(tDxRecordInvoiceDetail.getDetailNo())); checkRecordDetailVo.setDetailNo(StringHelper.trimEnter(tDxRecordInvoiceDetail.getDetailNo()));
@ -569,7 +560,7 @@ public class InvoiceDetailServiceImpl extends MpBaseServiceImpl<TDxRecordInvoice
JSONObject checkInfo = null; JSONObject checkInfo = null;
String invoiceCode = pramsMap.get("invoiceCode"); String invoiceCode = pramsMap.get("invoiceCode");
String invoiceNo = pramsMap.get("invoiceNo"); String invoiceNo = pramsMap.get("invoiceNo");
String uuid = (StringUtils.isEmpty(invoiceCode)?"":invoiceCode) + invoiceNo; String uuid = (StringUtils.isEmpty(invoiceCode) ? "" : invoiceCode) + invoiceNo;
DynamicContextHolder.push(pramsMap.get("dbName") + DbConstant.BUSINESS_READ); DynamicContextHolder.push(pramsMap.get("dbName") + DbConstant.BUSINESS_READ);
@ -606,4 +597,55 @@ public class InvoiceDetailServiceImpl extends MpBaseServiceImpl<TDxRecordInvoice
} }
return this.createCheckInfo(invoiceRecord, vehicleSaleInfo, invoiceDetailList, img); return this.createCheckInfo(invoiceRecord, vehicleSaleInfo, invoiceDetailList, img);
} }
private String getZSM(String taxRate) {
String sm = "";
switch (taxRate) {
// 发票采集
case "0.00":
sm = "J0";
break;
case "免税":
sm = "J0";
break;
case "16%":
sm = "J1";
break;
case "13%":
sm = "J2";
break;
case "10%":
sm = "J3";
break;
case "9%":
sm = "J4";
break;
case "6%":
sm = "J5";
break;
case "5%":
sm = "J6";
break;
case "3%":
sm = "J7";
break;
case "2%":
sm = "J8";
break;
case "1%":
sm = "J9";
break;
case "17%":
sm = "JC";
break;
default:
sm = "";
break;
}
return sm;
}
} }

@ -59,9 +59,7 @@ public class ErpWebConfiguration implements WebMvcConfigurer {
*/ */
private ArrayList<String> getIncludePathPatterns() { private ArrayList<String> getIncludePathPatterns() {
ArrayList<String> list = new ArrayList<>(); ArrayList<String> list = new ArrayList<>();
String[] urls = {"/order/**" String[] urls = {"/order/**"};
};
Collections.addAll(list, urls); Collections.addAll(list, urls);
return list; return list;
} }

@ -249,9 +249,7 @@ public class SDNYMainProcessController extends AbstractController {
for (SNInvoice invoice : invoiceInfoList) { for (SNInvoice invoice : invoiceInfoList) {
String fplxdm = ""; String fplxdm = "";
String snFplx = ""; String snFplx = "";
String invoiceCode = invoice.getInvoiceCode(); result = snPushCheckRecordService.updateInvoicePoll(company, taxNo, reimburse, invoice, fplxdm,imageId,compCode);
String invoiceNo = invoice.getInvoiceNumber();
result = snPushCheckRecordService.updateInvoicePoll(snRequestObject, company, taxNo, reimburse, invoice, fplxdm, invoiceCode, invoiceNo);
//价税分离判断 //价税分离判断
if (!"ok".equals(result) && !"0000".equals(result)) { if (!"ok".equals(result) && !"0000".equals(result)) {

@ -109,4 +109,9 @@ public class TDxRecordInvoiceDetail implements Serializable {
*/ */
private String goodsNum; private String goodsNum;
/**
* 税码
*/
private String taxCode;
} }

@ -75,4 +75,9 @@ public class SNInvoiceDetail {
*/ */
private String type = ""; private String type = "";
/**
* 类型
*/
private String taxCode = "";
} }

@ -109,7 +109,7 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
return post; return post;
} }
public String pushInvoiceToRecordInvoice(SNRequestObject snRequestObject, String taxNo, String company) throws Exception { public String pushInvoiceToRecordInvoice(SNInvoice snInvoice, String taxNo, String company) throws Exception {
QueryWrapper<BaseTDxTaxCurrent> currentWrapper = new QueryWrapper<>(); QueryWrapper<BaseTDxTaxCurrent> currentWrapper = new QueryWrapper<>();
currentWrapper.eq("taxno", taxNo); currentWrapper.eq("taxno", taxNo);
@ -117,12 +117,6 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
BaseTDxTaxCurrent current = baseTDxTaxCurrentDao.selectOne(currentWrapper); BaseTDxTaxCurrent current = baseTDxTaxCurrentDao.selectOne(currentWrapper);
List<SNInvoice> invoiceInfoList = snRequestObject.getInvoiceInfoList();
if (invoiceInfoList != null && invoiceInfoList.size() > 0) {
for (SNInvoice snInvoice : invoiceInfoList) {
String fpdm = snInvoice.getInvoiceCode(); String fpdm = snInvoice.getInvoiceCode();
String fphm = snInvoice.getInvoiceNumber(); String fphm = snInvoice.getInvoiceNumber();
@ -149,15 +143,18 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
BaseTDxRecordInvoice recordInvoice = new BaseTDxRecordInvoice(); BaseTDxRecordInvoice recordInvoice = new BaseTDxRecordInvoice();
recordInvoice.setUuid(fpdm + fphm); recordInvoice.setUuid(fpdm + fphm);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
if(kprq != null) { if (kprq != null) {
recordInvoice.setInvoiceDate(sdf.parse(kprq)); recordInvoice.setInvoiceDate(sdf.parse(kprq));
}else{ } else {
recordInvoice.setInvoiceDate(new Date()); recordInvoice.setInvoiceDate(new Date());
log.error("开票日期为空.请检查发票"); log.error("开票日期为空.请检查发票");
} }
recordInvoice.setInvoiceCode(fpdm); recordInvoice.setInvoiceCode(fpdm);
recordInvoice.setInvoiceNo(fphm); recordInvoice.setInvoiceNo(fphm);
if (je != null) {
recordInvoice.setInvoiceAmount(new BigDecimal(je)); recordInvoice.setInvoiceAmount(new BigDecimal(je));
}
if (se != null) { if (se != null) {
recordInvoice.setTaxAmount(new BigDecimal(se)); recordInvoice.setTaxAmount(new BigDecimal(se));
} }
@ -180,40 +177,39 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
} else { } else {
baseTDxRecordInvoiceDao.insert(recordInvoice); baseTDxRecordInvoiceDao.insert(recordInvoice);
} }
}
}
return ""; return "";
} }
public Integer pushInvoiceToRecordInvoice2(SNRequestObject snRequestObject) { public Integer pushInvoiceToRecordInvoice2(SNInvoice snInvoice,String imageId,String compCode) {
DynamicContextHolder.push("business" + DbConstant.BUSINESS_WRITE); DynamicContextHolder.push("business" + DbConstant.BUSINESS_WRITE);
int update = 0; int update = 0;
List<SNInvoice> invoiceInfoList = snRequestObject.getInvoiceInfoList();
if (invoiceInfoList != null && invoiceInfoList.size() > 0) {
for (SNInvoice snInvoice : invoiceInfoList) {
String fpdm = snInvoice.getInvoiceCode(); String fpdm = snInvoice.getInvoiceCode();
String fphm = snInvoice.getInvoiceNumber(); String fphm = snInvoice.getInvoiceNumber();
QueryWrapper<BaseTDxRecordInvoice> recordWrapper = new QueryWrapper<>(); QueryWrapper<BaseTDxRecordInvoice> recordWrapper = new QueryWrapper<>();
recordWrapper.eq("uuid", fpdm + fphm); recordWrapper.eq("uuid", fpdm + fphm);
BaseTDxRecordInvoice recordInvoice = new BaseTDxRecordInvoice(); BaseTDxRecordInvoice recordInvoice = new BaseTDxRecordInvoice();
recordInvoice.setImageId(snRequestObject.getImageId()); recordInvoice.setImageId(imageId);
recordInvoice.setCompCode(snRequestObject.getCompCode()); recordInvoice.setCompCode(compCode);
update = baseTDxRecordInvoiceDao.update(recordInvoice, recordWrapper); update = baseTDxRecordInvoiceDao.update(recordInvoice, recordWrapper);
}
} else {
String imageId = snRequestObject.getImageId();
QueryWrapper<BaseTDxRecordInvoice> recordWrapper = new QueryWrapper<>();
recordWrapper.eq("image_id", imageId);
BaseTDxRecordInvoice recordInvoice = new BaseTDxRecordInvoice();
recordInvoice.setImageId("");
recordInvoice.setCompCode("");
update = baseTDxRecordInvoiceDao.update(recordInvoice, recordWrapper); // if (invoiceInfoList != null && invoiceInfoList.size() > 0) {
} // for (SNInvoice snInvoice : invoiceInfoList) {
//
// }
// } else {
// String imageId = snRequestObject.getImageId();
// QueryWrapper<BaseTDxRecordInvoice> recordWrapper = new QueryWrapper<>();
// recordWrapper.eq("image_id", imageId);
// BaseTDxRecordInvoice recordInvoice = new BaseTDxRecordInvoice();
// recordInvoice.setImageId("");
// recordInvoice.setCompCode("");
//
// update = baseTDxRecordInvoiceDao.update(recordInvoice, recordWrapper);
// }
return update; return update;
} }
@ -512,7 +508,7 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
if (num > 9) { if (num > 9) {
taxRateDetail = "0." + taxRateDetail; taxRateDetail = "0." + taxRateDetail;
} else { } else {
if(!taxRateDetail.startsWith("0")){ if (!taxRateDetail.startsWith("0")) {
taxRateDetail = "0.0" + taxRateDetail; taxRateDetail = "0.0" + taxRateDetail;
} }
} }
@ -555,7 +551,7 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
return jsonObject; return jsonObject;
} }
public String updateInvoicePoll(@RequestBody SNRequestObject snRequestObject, String company, String taxNo, TDxInvoiceReimburse reimburse, SNInvoice invoice, String fplxdm, String invoiceCode, String invoiceNo) throws Exception { public String updateInvoicePoll(String company, String taxNo, TDxInvoiceReimburse reimburse, SNInvoice invoice, String fplxdm,String imageId,String compCode) throws Exception {
String result = "0000"; String result = "0000";
//判断发票类型 //判断发票类型
@ -573,16 +569,16 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
if (data != null) { if (data != null) {
invoice.setIsDeductible(data.getIsDeductible()); invoice.setIsDeductible(data.getIsDeductible());
invoice.setTaxRate(data.getTaxRate()); invoice.setTaxRate(data.getTaxRate());
if(data.getInvoiceAmount() != null) { if (data.getInvoiceAmount() != null) {
invoice.setTotalAmount(data.getInvoiceAmount().toString()); invoice.setTotalAmount(data.getInvoiceAmount().toString());
} }
if(data.getTaxAmount() != null) { if (data.getTaxAmount() != null) {
invoice.setTotalTax(data.getTaxAmount().toString()); invoice.setTotalTax(data.getTaxAmount().toString());
} }
} }
if (!"ok".equals(invoiceResult.getMsg()) && !"0000".equals(invoiceResult.getMsg())) { if (!"ok".equals(invoiceResult.getMsg()) && !"0000".equals(invoiceResult.getMsg())) {
log.info("价税分离失败:{}",invoiceResult.getMsg()); log.info("价税分离失败:{}", invoiceResult.getMsg());
return invoiceResult.getMsg(); return invoiceResult.getMsg();
} }
@ -608,11 +604,11 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
|| "08".equals(fplxdm) || "10".equals(fplxdm) || "11".equals(fplxdm) || "14".equals(fplxdm) || "08".equals(fplxdm) || "10".equals(fplxdm) || "11".equals(fplxdm) || "14".equals(fplxdm)
|| "15".equals(fplxdm) || "31".equals(fplxdm) || "32".equals(fplxdm)) { || "15".equals(fplxdm) || "31".equals(fplxdm) || "32".equals(fplxdm)) {
//可查验发票,已入库,更新票池 //可查验发票,已入库,更新票池
Integer integer = this.pushInvoiceToRecordInvoice2(snRequestObject); Integer integer = this.pushInvoiceToRecordInvoice2(invoice,imageId,compCode);
log.info("可查验发票,更新底账库完成"); log.info("可查验发票,更新底账库完成");
} else { } else {
//不可查验发票,未入库,插入票池 //不可查验发票,未入库,插入票池
this.pushInvoiceToRecordInvoice(snRequestObject, taxNo, company); this.pushInvoiceToRecordInvoice(invoice, taxNo, company);
log.info("不可查验发票,插入底账库成功"); log.info("不可查验发票,插入底账库成功");
} }
@ -621,7 +617,7 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
} }
private TDxInvoiceReimburse convertToReimburse(SNInvoice invoice, TDxInvoiceReimburse reimburse, String fplxdm, String company) { private TDxInvoiceReimburse convertToReimburse(SNInvoice invoice, TDxInvoiceReimburse reimburse, String fplxdm, String company) {
reimburse.setId(IdUtils.nextId());
reimburse.setInvoiceType(fplxdm); reimburse.setInvoiceType(fplxdm);
reimburse.setInvoiceCode(invoice.getInvoiceCode()); reimburse.setInvoiceCode(invoice.getInvoiceCode());
reimburse.setInvoiceNo(invoice.getInvoiceNumber()); reimburse.setInvoiceNo(invoice.getInvoiceNumber());

@ -307,6 +307,10 @@ public class SignSaveInvoiceInfoServiceImpl extends MpBaseServiceImpl<SignRecord
invoiceDetail.setUnitPrice(invoiceDetailQuery.getString("unitPrice")); invoiceDetail.setUnitPrice(invoiceDetailQuery.getString("unitPrice"));
invoiceDetail.setDetailAmount(invoiceDetailQuery.getString("detailAmount")); invoiceDetail.setDetailAmount(invoiceDetailQuery.getString("detailAmount"));
invoiceDetail.setTaxRate(invoiceDetailQuery.getString("taxRate")); invoiceDetail.setTaxRate(invoiceDetailQuery.getString("taxRate"));
if(invoiceDetailQuery.getString("taxRate") != null){
invoiceDetail.setTaxCode(getZSM(invoiceDetailQuery.getString("taxRate")));
}
invoiceDetail.setTaxAmount(invoiceDetailQuery.getString("taxAmount")); invoiceDetail.setTaxAmount(invoiceDetailQuery.getString("taxAmount"));
if (FplxEnum.TXF.getFplxDm().equals(invoiceType)) { if (FplxEnum.TXF.getFplxDm().equals(invoiceType)) {
// 通行费发票 // 通行费发票
@ -326,6 +330,56 @@ public class SignSaveInvoiceInfoServiceImpl extends MpBaseServiceImpl<SignRecord
} }
} }
private String getZSM(String taxRate) {
String sm = "";
switch (taxRate) {
// 发票采集
case "0.00":
sm = "J0";
break;
case "免税":
sm = "J0";
break;
case "0.16":
sm = "J1";
break;
case "0.13":
sm = "J2";
break;
case "0.10":
sm = "J3";
break;
case "0.09":
sm = "J4";
break;
case "0.06":
sm = "J5";
break;
case "0.05":
sm = "J6";
break;
case "0.03":
sm = "J7";
break;
case "0.02":
sm = "J8";
break;
case "0.01":
sm = "J9";
break;
case "0.17":
sm = "JC";
break;
default:
sm = "";
break;
}
return sm;
}
@Override @Override
public TDxVehicleSaleInvoice getVehicleSaleInvoice(JSONObject queryInvoiceResult) { public TDxVehicleSaleInvoice getVehicleSaleInvoice(JSONObject queryInvoiceResult) {
String invoiceType = queryInvoiceResult.getString("invoiceType"); String invoiceType = queryInvoiceResult.getString("invoiceType");

Loading…
Cancel
Save