Merge branches '0630-增加权限筛选' and 'test' of http://192.168.12.182/invoice/pt into test

 Conflicts:
	dxhy-erp/src/main/java/com/dxhy/erp/controller/SDNYMainProcessController.java
	dxhy-erp/src/main/java/com/dxhy/erp/service/SNPushCheckRecordService.java
release
yefei 2 years ago
commit 2bc77d6e57
  1. 134
      dxhy-erp/src/main/java/com/dxhy/erp/controller/SDNYMainProcessController.java
  2. 63
      dxhy-erp/src/main/java/com/dxhy/erp/service/SNPushCheckRecordService.java

@ -33,7 +33,6 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
@ -107,7 +106,6 @@ public class SDNYMainProcessController extends AbstractController {
@Resource @Resource
private GatherService gatherService; private GatherService gatherService;
/** /**
* 查验发票 * 查验发票
*/ */
@ -203,10 +201,10 @@ public class SDNYMainProcessController extends AbstractController {
List<BaseTDxRecordInvoiceDetail> baseTDxRecordInvoiceDetail = baseTDxRecordInvoiceDetailDao.selectList(detailWrapper); List<BaseTDxRecordInvoiceDetail> baseTDxRecordInvoiceDetail = baseTDxRecordInvoiceDetailDao.selectList(detailWrapper);
DynamicContextHolder.push("business" + DbConstant.BUSINESS_READ); DynamicContextHolder.push("business" + DbConstant.BUSINESS_READ);
if (baseTDxRecordInvoiceDetail != null && baseTDxRecordInvoiceDetail.size() == 0) { if(baseTDxRecordInvoiceDetail != null && baseTDxRecordInvoiceDetail.size() == 0){
//先删除原有主数据,再查验更新主数据和明细数据 //先删除原有主数据,再查验更新主数据和明细数据
int delete = baseTDxRecordInvoiceDao.delete(recordWrapper); int delete = baseTDxRecordInvoiceDao.delete(recordWrapper);
if (delete > 0) { if(delete > 0) {
checkInvoiceResult = snPushCheckRecordService.singleCheckInvoice(pramsMap); checkInvoiceResult = snPushCheckRecordService.singleCheckInvoice(pramsMap);
if (!checkInvoiceResult.containsKey("code")) { if (!checkInvoiceResult.containsKey("code")) {
@ -261,13 +259,14 @@ public class SDNYMainProcessController extends AbstractController {
} }
try { try {
checkInvoiceResult = snPushCheckRecordService.singleCheckInvoice(pramsMap); checkInvoiceResult = snPushCheckRecordService.singleCheckInvoice(pramsMap);
log.info("查验结果为:{}", checkInvoiceResult); log.info("查验结果为:{}", checkInvoiceResult);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
log.error("查验失败,errormsg:{}", e.getMessage()); log.error("查验失败,errormsg:{}",e.getMessage());
return ResponseEntity.ok(JSONObject.toJSONString(R.error("查验失败," + e.getMessage()))); return ResponseEntity.ok(JSONObject.toJSONString(R.error("查验失败,"+e.getMessage())));
} }
if (!checkInvoiceResult.containsKey("code")) { if (!checkInvoiceResult.containsKey("code")) {
if (checkInvoiceResult.containsKey("cyjg") && !"0001".equals(checkInvoiceResult.getString("cyjg"))) { if (checkInvoiceResult.containsKey("cyjg") && !"0001".equals(checkInvoiceResult.getString("cyjg"))) {
@ -290,7 +289,6 @@ public class SDNYMainProcessController extends AbstractController {
return ResponseEntity.ok(JSONObject.toJSONString(data)); return ResponseEntity.ok(JSONObject.toJSONString(data));
} }
} else { } else {
//其他类发票,直接入库 //其他类发票,直接入库
log.info("其他类发票,不做查验,直接入库"); log.info("其他类发票,不做查验,直接入库");
@ -456,7 +454,7 @@ public class SDNYMainProcessController extends AbstractController {
for (int i = 0; i < detailList.size(); i++) { for (int i = 0; i < detailList.size(); i++) {
String taxRateDetail = ""; String taxRateDetail = "";
JSONObject detail = (JSONObject) detailList.get(i); JSONObject detail = (JSONObject) detailList.get(i);
if (StringUtils.isNotEmpty(detail.getString("goodsName")) && detail.getString("goodsName").contains("详见销货清单")) { if(StringUtils.isNotEmpty(detail.getString("goodsName")) && detail.getString("goodsName").contains("详见销货清单")){
continue; continue;
} }
Map<String, String> snDetailMap = new HashMap<String, String>(); Map<String, String> snDetailMap = new HashMap<String, String>();
@ -506,33 +504,24 @@ public class SDNYMainProcessController extends AbstractController {
int index = taxRateDetail.indexOf("%"); int index = taxRateDetail.indexOf("%");
if (index > 0) { if (index > 0) {
taxRateDetail = taxRateDetail.substring(0, taxRateDetail.length() - 1); taxRateDetail = taxRateDetail.substring(0, taxRateDetail.length() - 1);
Float num = Float.parseFloat(taxRateDetail); // Float num = Float.parseFloat(taxRateDetail);
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;
} // }
} // }
} else {
Float num = Float.parseFloat(taxRateDetail);
if (num > 9) {
taxRateDetail = "0." + taxRateDetail;
} else {
if (!taxRateDetail.startsWith("0")) {
taxRateDetail = "0.0" + taxRateDetail;
}
}
} }
} }
} }
} catch (Exception e) { }catch (Exception e){
log.error("报错的原因为:{}", e); log.error("报错的原因为:{}",e);
taxRateDetail = "0.00"; taxRateDetail = "0";
} }
if ("11".equals(invoiceType)) { if ("11".equals(invoiceType)) {
taxRateDetail = "0.000"; taxRateDetail = "0";
} }
log.info("明细-发票税率为:{}", taxRateDetail); log.info("明细-发票税率为:{}", taxRateDetail);
snDetailMap.put("taxRate", taxRateDetail); snDetailMap.put("taxRate", taxRateDetail);
@ -687,11 +676,11 @@ public class SDNYMainProcessController extends AbstractController {
log.error("同步SAP失败,报错信息为:{}", exception); log.error("同步SAP失败,报错信息为:{}", exception);
exception.printStackTrace(); exception.printStackTrace();
return ResponseEntity.ok(JSONObject.toJSONString(R.error(CommonConstants.CONNECT_TIMEOUT))); return ResponseEntity.ok(JSONObject.toJSONString(R.error(CommonConstants.CONNECT_TIMEOUT)));
} catch (NullPointerException exception) { } catch(NullPointerException exception){
log.error("同步SAP失败,报错信息为:{}", exception); log.error("同步SAP失败,报错信息为:{}", exception);
exception.printStackTrace(); exception.printStackTrace();
return ResponseEntity.ok(JSONObject.toJSONString(R.error(CommonConstants.NULL_POINTER_TIMEOUT))); return ResponseEntity.ok(JSONObject.toJSONString(R.error(CommonConstants.NULL_POINTER_TIMEOUT)));
} catch (Exception exception) { } catch(Exception exception){
log.error("同步SAP失败,报错信息为:{}", exception); log.error("同步SAP失败,报错信息为:{}", exception);
exception.printStackTrace(); exception.printStackTrace();
return ResponseEntity.ok(JSONObject.toJSONString(R.error(CommonConstants.MSG_ERR_DEFAULT))); return ResponseEntity.ok(JSONObject.toJSONString(R.error(CommonConstants.MSG_ERR_DEFAULT)));
@ -798,7 +787,6 @@ public class SDNYMainProcessController extends AbstractController {
info.setZGFZH(snInvoice.getPurchaserBank()); info.setZGFZH(snInvoice.getPurchaserBank());
info.setZBZ(snInvoice.getRemarks()); info.setZBZ(snInvoice.getRemarks());
List<SNInvoiceDetail> invoiceLineList = snInvoice.getInvoiceLineList(); List<SNInvoiceDetail> invoiceLineList = snInvoice.getInvoiceLineList();
List<SAPInvoiceDetail> sapInvoiceDetailList = new ArrayList<>(); List<SAPInvoiceDetail> sapInvoiceDetailList = new ArrayList<>();
//查询明细 //查询明细
@ -830,36 +818,26 @@ public class SDNYMainProcessController extends AbstractController {
sapInvoiceDetail.setZJK(snInvoiceDetail.getAmount()); sapInvoiceDetail.setZJK(snInvoiceDetail.getAmount());
sapInvoiceDetail.setZHH(snInvoiceDetail.getRowNo()); sapInvoiceDetail.setZHH(snInvoiceDetail.getRowNo());
//将类似于0.03数据格式转化为3.00 //将类似于0.03数据格式转化为3.00
if (snInvoiceDetail.getTaxRate() != null && !"".equals(snInvoiceDetail.getTaxRate())) { if (snInvoiceDetail.getTaxRate() != null && snInvoiceDetail.getTaxRate() != "") {
sapInvoiceDetail.setZTAX(snInvoiceDetail.getTaxRate()); sapInvoiceDetail.setZTAX(snInvoiceDetail.getTaxRate());
if ("0".equals(snInvoiceDetail.getTaxRate())) { if ("0".equals(snInvoiceDetail.getTaxRate())) {
sapInvoiceDetail.setZTAX("0.00"); sapInvoiceDetail.setZTAX("0.00");
sapInvoiceDetail.setZSM(sapInvoiceDetail.getZTAX()); // sapInvoiceDetail.setZSM(sapInvoiceDetail.getZTAX());
} }
if (snInvoiceDetail.getTaxRate().contains(".")) { if (snInvoiceDetail.getTaxRate().contains(".")) {
String getTaxRate = snInvoiceDetail.getTaxRate(); String getTaxRate = snInvoiceDetail.getTaxRate();
// if (snInvoiceDetail.getTaxRate().length() > 4) { if (snInvoiceDetail.getTaxRate().length() > 4) {
// getTaxRate = getTaxRate.substring(0, 4); getTaxRate = getTaxRate.substring(0, 4);
// } }
BigDecimal tax = new BigDecimal(getTaxRate); BigDecimal tax = new BigDecimal(getTaxRate);
sapInvoiceDetail.setZSM(getZSM(tax.toString())); sapInvoiceDetail.setZSM(getZSM(tax.toString()));
BigDecimal tax1 = tax.multiply(new BigDecimal("100")); BigDecimal tax1 = tax.multiply(new BigDecimal("100"));
sapInvoiceDetail.setZTAX(tax1.toString()); sapInvoiceDetail.setZTAX(tax1.toString());
if (tax1.compareTo(new BigDecimal("100")) > 0) {
sapInvoiceDetail.setZTAX(snInvoiceDetail.getTaxRate());
} else if (tax1.scale() > 2) {
BigDecimal substring = tax1.setScale(2, RoundingMode.FLOOR);
sapInvoiceDetail.setZTAX(substring.toPlainString());
}
} }
if (snInvoiceDetail.getTaxRate().contains("%") && !snInvoiceDetail.getTaxRate().contains(".")) { if (snInvoiceDetail.getTaxRate().contains("%") && !snInvoiceDetail.getTaxRate().contains(".")) {
String replace = snInvoiceDetail.getTaxRate().replace("%", ".00"); String replace = snInvoiceDetail.getTaxRate().replace("%", ".00");
String replaceZsm = snInvoiceDetail.getTaxRate().replace("%", "");
sapInvoiceDetail.setZSM(getZSM(replaceZsm));
sapInvoiceDetail.setZTAX(replace); sapInvoiceDetail.setZTAX(replace);
} }
} }
// if (invoiceLineList.size() == 1 && snInvoice.getTaxRate() == null) { // if (invoiceLineList.size() == 1 && snInvoice.getTaxRate() == null) {
// info.setZTAX(sapInvoiceDetail.getZTAX()); // info.setZTAX(sapInvoiceDetail.getZTAX());
@ -885,16 +863,15 @@ public class SDNYMainProcessController extends AbstractController {
} }
} }
sapInvoiceDetail.setZSL(snInvoiceDetail.getQuantity()); sapInvoiceDetail.setZSL(snInvoiceDetail.getQuantity());
String zsmTax = snInvoiceDetail.getTaxRate();
// String zsmTax = snInvoiceDetail.getTaxRate(); if (zsmTax != null && zsmTax != "" && zsmTax.length() > 4) {
// if (zsmTax != null && zsmTax != "" && zsmTax.length() > 4) { zsmTax = zsmTax.substring(0, 4);
// zsmTax = zsmTax.substring(0, 4); }
// } if (zsmTax != null && zsmTax.contains("%") && !zsmTax.contains(".")) {
// if (zsmTax != null && zsmTax.contains("%") && !zsmTax.contains(".")) { zsmTax = (new BigDecimal(zsmTax.replace("%", ""))).divide(new BigDecimal("100")).toString();
// zsmTax = (new BigDecimal(zsmTax.replace("%", ""))).divide(new BigDecimal("100")).toString(); }
// } // sapInvoiceDetail.setZSM(getZSM(snInvoiceDetail.getTaxRate()));
//// sapInvoiceDetail.setZSM(getZSM(snInvoiceDetail.getTaxRate())); sapInvoiceDetail.setZSM(getZSM(zsmTax));
// sapInvoiceDetail.setZSM(getZSM(zsmTax));
sapInvoiceDetail.setZGGXH(snInvoiceDetail.getSpecificationModel()); sapInvoiceDetail.setZGGXH(snInvoiceDetail.getSpecificationModel());
if (snInvoice.getInvoiceCode() != null) { if (snInvoice.getInvoiceCode() != null) {
sapInvoiceDetail.setZTID(snInvoice.getInvoiceCode() + snInvoice.getInvoiceNumber() + snFplx); sapInvoiceDetail.setZTID(snInvoice.getInvoiceCode() + snInvoice.getInvoiceNumber() + snFplx);
@ -912,7 +889,7 @@ public class SDNYMainProcessController extends AbstractController {
if (taxRate != null && !taxRate.contains("%")) { if (taxRate != null && !taxRate.contains("%")) {
BigDecimal bigDecimal = new BigDecimal(taxRate); BigDecimal bigDecimal = new BigDecimal(taxRate);
BigDecimal multiply = bigDecimal.multiply(new BigDecimal("100")); BigDecimal multiply = bigDecimal.multiply(new BigDecimal("100"));
info.setZTAX(multiply.toPlainString()); info.setZTAX(multiply.toString());
info.setZSM(getZSM(taxRate)); info.setZSM(getZSM(taxRate));
} }
if (taxRate != null && taxRate.contains("%")) { if (taxRate != null && taxRate.contains("%")) {
@ -925,19 +902,20 @@ public class SDNYMainProcessController extends AbstractController {
info.setZSM(getZSM(divide.toString())); info.setZSM(getZSM(divide.toString()));
} }
if (taxRate != null && taxRate.contains(".") && !taxRate.contains("%")) { if (taxRate != null && taxRate.contains(".") && !taxRate.contains("%")) {
if (taxRate.length() > 4) {
BigDecimal tax = new BigDecimal(taxRate); taxRate = taxRate.substring(0, 4);
info.setZSM(getZSM(tax.toPlainString())); BigDecimal tax = new BigDecimal(taxRate);
BigDecimal tax1 = tax.multiply(new BigDecimal("100")); info.setZSM(getZSM(tax.toString()));
info.setZTAX(tax1.setScale(2, RoundingMode.FLOOR).toPlainString()); BigDecimal tax1 = tax.multiply(new BigDecimal("100"));
info.setZTAX(tax1.toString());
}
} }
if (taxRate != null && "0".equals(taxRate)) { if (taxRate != null && "0".equals(taxRate)) {
info.setZTAX("0.00"); info.setZTAX("0.00");
info.setZSM(getZSM(info.getZTAX())); info.setZSM(getZSM(info.getZTAX()));
} }
if (invoiceLineList == null || invoiceLineList.size() == 0) { if (invoiceLineList == null || invoiceLineList.size() == 0) {
if (info.getZTAX() == null || "".equals(info.getZTAX())) { if (info.getZTAX() == null || info.getZTAX() == "") {
info.setZTAX("0.00"); info.setZTAX("0.00");
info.setZSM(getZSM(info.getZTAX())); info.setZSM(getZSM(info.getZTAX()));
} }
@ -1024,12 +1002,12 @@ public class SDNYMainProcessController extends AbstractController {
|| "08".equals(snInvoice.getInvoiceType()) || "10".equals(snInvoice.getInvoiceType()) || "11".equals(snInvoice.getInvoiceType()) || "14".equals(snInvoice.getInvoiceType()) || "08".equals(snInvoice.getInvoiceType()) || "10".equals(snInvoice.getInvoiceType()) || "11".equals(snInvoice.getInvoiceType()) || "14".equals(snInvoice.getInvoiceType())
|| "15".equals(snInvoice.getInvoiceType()) || "31".equals(snInvoice.getInvoiceType()) || "32".equals(snInvoice.getInvoiceType())) { || "15".equals(snInvoice.getInvoiceType()) || "31".equals(snInvoice.getInvoiceType()) || "32".equals(snInvoice.getInvoiceType())) {
//可查验发票, //可查验发票,
log.info("发票类型为:{}", snInvoice.getInvoiceType()); log.info("发票类型为:{}",snInvoice.getInvoiceType());
//0608 区块链发票 并且 checkStatus = 3 的时候 提交sap状态为3(刘振和谈楚才提出需求) //0608 区块链发票 并且 checkStatus = 3 的时候 提交sap状态为3(刘振和谈楚才提出需求)
if ("10".equals(snInvoice.getInvoiceType()) && "3".equals(snInvoice.getCheckStatus())) { if("10".equals(snInvoice.getInvoiceType()) && "3".equals(snInvoice.getCheckStatus())){
log.info("区块链发票 传输状态checkStatus = 3"); log.info("区块链发票 传输状态checkStatus = 3");
info.setZCYZT("3"); info.setZCYZT("3");
} else { }else {
info.setZCYZT("1"); info.setZCYZT("1");
} }
} else { } else {
@ -1200,9 +1178,6 @@ public class SDNYMainProcessController extends AbstractController {
case "1.5": case "1.5":
sm = "JA"; sm = "JA";
break; break;
case "0.015":
sm = "JA";
break;
case "1": case "1":
sm = "J9"; sm = "J9";
break; break;
@ -1276,17 +1251,4 @@ public class SDNYMainProcessController extends AbstractController {
} }
return ZCYJG; return ZCYJG;
} }
/**
* 查验发票
*/
@PostMapping("/refresh")
@ResponseBody
@SysLog("发票查验")
public String refreshDetailData(@RequestBody Map<String, Object> pramsMap) throws Exception {
log.info("接口请求的参数为:{}", pramsMap);
String result = snPushCheckRecordService.getRecords(pramsMap);
return result;
}
} }

@ -4,9 +4,7 @@ import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.dxhy.common.constant.DbConstant; import com.dxhy.common.constant.DbConstant;
import com.dxhy.common.datasource.config.DynamicContextHolder; import com.dxhy.common.datasource.config.DynamicContextHolder;
import com.dxhy.common.enums.FplxEnum; import com.dxhy.common.enums.FplxEnum;
@ -42,7 +40,6 @@ import java.math.BigDecimal;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
* 与山东能源交互数据主类 * 与山东能源交互数据主类
@ -91,18 +88,12 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
@Resource @Resource
private TDxInvoiceReimburseDao invoiceReimburseDao; private TDxInvoiceReimburseDao invoiceReimburseDao;
@Resource
private TdxRecordInvoiceDao tdxRecordInvoiceDao;
@Resource @Resource
private BaseTDxRecordInvoiceDao baseTDxRecordInvoiceDao; private BaseTDxRecordInvoiceDao baseTDxRecordInvoiceDao;
@Resource @Resource
private TDxInvoiceReimburseService tDxInvoiceReimburseService; private TDxInvoiceReimburseService tDxInvoiceReimburseService;
@Resource
private BaseTDxRecordInvoiceDetailDao baseTDxRecordInvoiceDetailDao;
@Resource @Resource
private SysDeptDao sysDeptDao; private SysDeptDao sysDeptDao;
@ -279,50 +270,6 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
return queryInvoiceResult; return queryInvoiceResult;
} }
public String getRecords(Map<String, Object> pramsMap) {
DynamicContextHolder.push("business" + DbConstant.BUSINESS_WRITE);
QueryWrapper<TdxRecordInvoice> recordWrapper = new QueryWrapper<>();
List<String> uuids = tdxRecordInvoiceDao.selectRecords(pramsMap);
log.info("获取的uuid为{}",uuids);
for (String uuid: uuids) {
boolean flag = false;
QueryWrapper<BaseTDxRecordInvoiceDetail> detailWrapper = new QueryWrapper<>();
detailWrapper.eq("uuid", uuid);
DynamicContextHolder.push("business" + DbConstant.DETAIL_READ);
List<BaseTDxRecordInvoiceDetail> details = baseTDxRecordInvoiceDetailDao.selectList(detailWrapper);
DynamicContextHolder.push("business" + DbConstant.BUSINESS_READ);
log.info("获取到的明细为:{}",details);
String taxRate = "";
for(BaseTDxRecordInvoiceDetail detail : details){
//获取明细信息 更新主表税率
if(StringUtils.isNotEmpty(detail.getTaxRate())){
if(flag){
if(!taxRate.contains(detail.getTaxRate())) {
taxRate = taxRate + "," + detail.getTaxRate();
}
}else{
if(!taxRate.contains(detail.getTaxRate())) {
taxRate = taxRate + detail.getTaxRate();
}
flag = true;
}
}
}
log.info("获取的数据明细taxRate为={}",taxRate);
if(StringUtils.isNotEmpty(taxRate)) {
Map<String, String> updateParam = new HashMap<>();
updateParam.put("taxRate", taxRate);
updateParam.put("uuid", uuid);
tdxRecordInvoiceDao.updateTaxRate(updateParam);
}
}
return "ok";
}
public JSONObject singleCheckInvoice(Map<String, String> pramsMap) throws Exception { public JSONObject singleCheckInvoice(Map<String, String> pramsMap) throws Exception {
//1.封装查验参数 //1.封装查验参数
@ -512,7 +459,7 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
jsonObject.put("tonnage", invoiceData.get("dw")); jsonObject.put("tonnage", invoiceData.get("dw"));
jsonObject.put("limitPeople", invoiceData.get("xcrs")); jsonObject.put("limitPeople", invoiceData.get("xcrs"));
String taxRate = ""; String taxRate = "";
if (StringUtils.isNotEmpty(invoiceData.get("sl").toString()) || "免税".equals(invoiceData.get("sl").toString()) || "不征税".equals(invoiceData.get("sl").toString()) || "***".equals(invoiceData.get("sl").toString())) { if (StringUtils.isBlank(invoiceData.get("sl").toString()) || "免税".equals(invoiceData.get("sl").toString()) || "不征税".equals(invoiceData.get("sl").toString()) || "***".equals(invoiceData.get("sl").toString())) {
taxRate = "0"; taxRate = "0";
jsonObject.put("taxRate", taxRate); jsonObject.put("taxRate", taxRate);
} else { } else {
@ -608,13 +555,13 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
taxRateDetail = "0"; taxRateDetail = "0";
snDetailMap.put("taxRate", taxRateDetail); snDetailMap.put("taxRate", taxRateDetail);
} else { } else {
if (detail.get("sl") != null && StringUtils.isNoneBlank(detail.get("sl").toString())) { if (StringUtils.isNoneBlank(detail.get("sl").toString())) {
taxRateDetail = detail.get("sl").toString(); taxRateDetail = detail.get("sl").toString();
if (!"0".equals(taxRateDetail)) { if (!"0".equals(taxRateDetail)) {
if (StringUtils.isNoneBlank(taxRateDetail)) { if (StringUtils.isNoneBlank(taxRateDetail)) {
int index = taxRateDetail.indexOf("%"); int index = taxRateDetail.indexOf("%");
if (index > 0) { // if (index > 0) {
taxRateDetail = taxRateDetail.substring(0, taxRateDetail.length() - 1); // taxRateDetail = taxRateDetail.substring(0, taxRateDetail.length() - 1);
// Float num = Float.parseFloat(taxRateDetail); // Float num = Float.parseFloat(taxRateDetail);
// if (num > 9) { // if (num > 9) {
// taxRateDetail = "0." + taxRateDetail; // taxRateDetail = "0." + taxRateDetail;
@ -623,7 +570,7 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
// taxRateDetail = "0.0" + taxRateDetail; // taxRateDetail = "0.0" + taxRateDetail;
// } // }
// } // }
} // }
} }
} }

Loading…
Cancel
Save