|
@@ -15,6 +15,7 @@ import org.slf4j.LoggerFactory;
|
|
|
import org.json.JSONArray;
|
|
import org.json.JSONArray;
|
|
|
import org.json.JSONObject;
|
|
import org.json.JSONObject;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.http.MediaType;
|
|
import org.springframework.http.MediaType;
|
|
|
import org.springframework.scheduling.annotation.Async;
|
|
import org.springframework.scheduling.annotation.Async;
|
|
|
import org.springframework.util.LinkedMultiValueMap;
|
|
import org.springframework.util.LinkedMultiValueMap;
|
|
@@ -54,6 +55,13 @@ public class YiDaController {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private dingConst dingConst;
|
|
private dingConst dingConst;
|
|
|
|
|
|
|
|
|
|
+ @Value("${hxapi.bookkeeping}")
|
|
|
|
|
+ private String HXAPI_BOOKKEEPING;
|
|
|
|
|
+ @Value("${hxapi.commoncheckinvoice}")
|
|
|
|
|
+ private String HXAPI_COMMONCHECKINVOICE;
|
|
|
|
|
+ @Value("${hxapi.imgocr}")
|
|
|
|
|
+ private String HXAPI_IMGOCR;
|
|
|
|
|
+
|
|
|
@ApiOperation("测试")
|
|
@ApiOperation("测试")
|
|
|
@GetMapping("testdemo")
|
|
@GetMapping("testdemo")
|
|
|
public String demo(String id) {
|
|
public String demo(String id) {
|
|
@@ -1498,7 +1506,7 @@ public class YiDaController {
|
|
|
System.out.println(bookkeepingJArray);
|
|
System.out.println(bookkeepingJArray);
|
|
|
logger.info("{}", bookkeepingJArray);
|
|
logger.info("{}", bookkeepingJArray);
|
|
|
|
|
|
|
|
- String post = HttpUtil.post("http://106.15.251.153:8091/stms/openapi/income/bookkeeping", null, bookkeepingJArray.toString(), null);
|
|
|
|
|
|
|
+ String post = HttpUtil.post(HXAPI_BOOKKEEPING, null, bookkeepingJArray.toString(), null);
|
|
|
if (!"".equals(post)) {
|
|
if (!"".equals(post)) {
|
|
|
System.out.println(CusutUtil.unicodeDecode(post));
|
|
System.out.println(CusutUtil.unicodeDecode(post));
|
|
|
logger.info("发票勾选实现 post:" + CusutUtil.unicodeDecode(post));
|
|
logger.info("发票勾选实现 post:" + CusutUtil.unicodeDecode(post));
|
|
@@ -1638,7 +1646,7 @@ public class YiDaController {
|
|
|
|
|
|
|
|
System.out.println(bookkeepingJArray);
|
|
System.out.println(bookkeepingJArray);
|
|
|
|
|
|
|
|
- String post = HttpUtil.post("http://106.15.251.153:8091/stms/openapi/income/bookkeeping", null, bookkeepingJArray.toString(), null);
|
|
|
|
|
|
|
+ String post = HttpUtil.post(HXAPI_BOOKKEEPING, null, bookkeepingJArray.toString(), null);
|
|
|
if (!"".equals(post)) {
|
|
if (!"".equals(post)) {
|
|
|
System.out.println(CusutUtil.unicodeDecode(post));
|
|
System.out.println(CusutUtil.unicodeDecode(post));
|
|
|
logger.info("post:" + CusutUtil.unicodeDecode(post));
|
|
logger.info("post:" + CusutUtil.unicodeDecode(post));
|
|
@@ -1809,7 +1817,7 @@ public class YiDaController {
|
|
|
try {
|
|
try {
|
|
|
MultiValueMap<String, Object> param = new LinkedMultiValueMap<>();
|
|
MultiValueMap<String, Object> param = new LinkedMultiValueMap<>();
|
|
|
param.add("account", "admin");
|
|
param.add("account", "admin");
|
|
|
- value = HttpUtil.doPostFile2(dingConst.getHanxingUrl() + "imgocr", param, file);
|
|
|
|
|
|
|
+ value = HttpUtil.doPostFile2(HXAPI_IMGOCR, param, file);
|
|
|
|
|
|
|
|
} catch (Exception ex) {
|
|
} catch (Exception ex) {
|
|
|
err_file++;
|
|
err_file++;
|
|
@@ -1973,7 +1981,6 @@ public class YiDaController {
|
|
|
|
|
|
|
|
JSONArray tableField_l6ujr47b = new JSONArray();
|
|
JSONArray tableField_l6ujr47b = new JSONArray();
|
|
|
|
|
|
|
|
-
|
|
|
|
|
//验真参数
|
|
//验真参数
|
|
|
try {
|
|
try {
|
|
|
JSONObject yanzObj = new JSONObject();
|
|
JSONObject yanzObj = new JSONObject();
|
|
@@ -2029,8 +2036,8 @@ public class YiDaController {
|
|
|
}
|
|
}
|
|
|
if (type.equals("01") || type.equals("02") || type.equals("03") || type.equals("04")
|
|
if (type.equals("01") || type.equals("02") || type.equals("03") || type.equals("04")
|
|
|
|| type.equals("15") || type.equals("14") || type.equals("11") || type.equals("10")
|
|
|| type.equals("15") || type.equals("14") || type.equals("11") || type.equals("10")
|
|
|
- || type.equals("08") || type.equals("16") || type.equals("21") || type.equals("22") || type.equals("08xdp") || type.equals("08xdpp")) {
|
|
|
|
|
- String post = HttpUtil.post("http://106.15.251.153:8095/stms_xocr/pxocr/commoncheckinvoice", null, yanzObj.toString(), null);
|
|
|
|
|
|
|
+ || type.equals("08") || type.equals("16") || type.equals("21") || type.equals("22") || type.equals("08xdp") || type.equals("08xdpp") || type.equals("61")) {
|
|
|
|
|
+ String post = HttpUtil.post(HXAPI_COMMONCHECKINVOICE, null, yanzObj.toString(), null);
|
|
|
if (!post.equals("")) {
|
|
if (!post.equals("")) {
|
|
|
// System.out.println(post);
|
|
// System.out.println(post);
|
|
|
JSONObject yanz = new JSONObject(post);
|
|
JSONObject yanz = new JSONObject(post);
|
|
@@ -2048,13 +2055,23 @@ public class YiDaController {
|
|
|
for (int k = 0; k < items.length(); k++) {
|
|
for (int k = 0; k < items.length(); k++) {
|
|
|
JSONObject itemObject = new JSONObject();
|
|
JSONObject itemObject = new JSONObject();
|
|
|
JSONObject item = items.getJSONObject(k);
|
|
JSONObject item = items.getJSONObject(k);
|
|
|
- itemObject.put("textField_l6ujr47c", has(item, "goodsName").toString());//名称
|
|
|
|
|
- itemObject.put("numberField_l6ujr47e", has(item, "num").toString());//数量
|
|
|
|
|
- itemObject.put("textField_lam8efux", has(item, "unit").toString());//单位
|
|
|
|
|
- itemObject.put("numberField_l6ujr47g", has(item, "taxUnitPrice").toString());//单价
|
|
|
|
|
- itemObject.put("textField_l6vvuq3e", has(item, "taxRate").toString());//税率
|
|
|
|
|
- itemObject.put("numberField_l6vu65fp", has(item, "taxAmount").toString());//税额
|
|
|
|
|
- itemObject.put("numberField_l6ujr47f", has(item, "detailAmount").toString());//金额
|
|
|
|
|
|
|
+ if(type.equals("61")){
|
|
|
|
|
+ itemObject.put("numberField_l6ujr47g", has(item, "fare").toString());//单价
|
|
|
|
|
+ itemObject.put("numberField_mifoh2ng", has(item, "fuel_surcharge").toString());//燃油附加费
|
|
|
|
|
+ itemObject.put("textField_l6vvuq3e", has(item, "tax_rate").toString());//税率
|
|
|
|
|
+ itemObject.put("numberField_l6vu65fp", has(item, "in_tax").toString());//税额
|
|
|
|
|
+ itemObject.put("numberField_l6ujr47f", has(item, "total").toString());//金额
|
|
|
|
|
+ itemObject.put("numberField_mifoh2ng", has(item, "other_taxes").toString());//其他税费
|
|
|
|
|
+ itemObject.put("numberField_mifoh2ni", has(item, "caac_development_fund").toString());//民航发展基金
|
|
|
|
|
+ }else{
|
|
|
|
|
+ itemObject.put("textField_l6ujr47c", has(item, "goodsName").toString());//名称
|
|
|
|
|
+ itemObject.put("numberField_l6ujr47e", has(item, "num").toString());//数量
|
|
|
|
|
+ itemObject.put("textField_lam8efux", has(item, "unit").toString());//单位
|
|
|
|
|
+ itemObject.put("numberField_l6ujr47g", has(item, "taxUnitPrice").toString());//单价
|
|
|
|
|
+ itemObject.put("textField_l6vvuq3e", has(item, "taxRate").toString());//税率
|
|
|
|
|
+ itemObject.put("numberField_l6vu65fp", has(item, "taxAmount").toString());//税额
|
|
|
|
|
+ itemObject.put("numberField_l6ujr47f", has(item, "detailAmount").toString());//金额
|
|
|
|
|
+ }
|
|
|
tableField_l6ujr47b.put(itemObject);
|
|
tableField_l6ujr47b.put(itemObject);
|
|
|
if (k == 0) {
|
|
if (k == 0) {
|
|
|
if ("".equals(createJson.getString("textField_l6vvuq3f"))) {
|
|
if ("".equals(createJson.getString("textField_l6vvuq3f"))) {
|
|
@@ -2082,7 +2099,7 @@ public class YiDaController {
|
|
|
//开发参数
|
|
//开发参数
|
|
|
createJson.put("textField_l7efm5ay", "否");
|
|
createJson.put("textField_l7efm5ay", "否");
|
|
|
//过路费发票 ??
|
|
//过路费发票 ??
|
|
|
- if (type.equals("10505") || type.equals("10203") || type.equals("10506") || type.equals("10507") || type.equals("10503") || type.equals("10500") || type.equals("10200") || type.equals("10400") || has(invoicesJSONObject, "block_chain").equals("1")) {
|
|
|
|
|
|
|
+ if (type.equals("14") || type.equals("10505") || type.equals("10203") || type.equals("10506") || type.equals("10507") || type.equals("10503") || type.equals("10500") || type.equals("10200") || type.equals("10400") || has(invoicesJSONObject, "block_chain").equals("1")) {
|
|
|
// if (!createJson.has("textField_l6u55vdt")) {
|
|
// if (!createJson.has("textField_l6u55vdt")) {
|
|
|
createJson.put("textField_l6u55vdt", "查验成功发票一致");
|
|
createJson.put("textField_l6u55vdt", "查验成功发票一致");
|
|
|
createJson.put("textField_l6u55vds", "0001");
|
|
createJson.put("textField_l6u55vds", "0001");
|
|
@@ -2217,7 +2234,7 @@ public class YiDaController {
|
|
|
|
|
|
|
|
// System.out.println(yanzObj);
|
|
// System.out.println(yanzObj);
|
|
|
// String post = "";
|
|
// String post = "";
|
|
|
- String post = HttpUtil.post("http://106.15.251.153:8095/stms_xocr/pxocr/commoncheckinvoice", null, yanzObj.toString(), null);
|
|
|
|
|
|
|
+ String post = HttpUtil.post(HXAPI_COMMONCHECKINVOICE, null, yanzObj.toString(), null);
|
|
|
if (!post.equals("")) {
|
|
if (!post.equals("")) {
|
|
|
// System.out.println(post);
|
|
// System.out.println(post);
|
|
|
JSONObject yanz = new JSONObject(post);
|
|
JSONObject yanz = new JSONObject(post);
|
|
@@ -2357,6 +2374,8 @@ public class YiDaController {
|
|
|
return "全电普票";
|
|
return "全电普票";
|
|
|
case "51":
|
|
case "51":
|
|
|
return "电子火车票";
|
|
return "电子火车票";
|
|
|
|
|
+ case "61":
|
|
|
|
|
+ return "电子发票(航空运输电子行程单)";
|
|
|
default:
|
|
default:
|
|
|
return "联系管理员增加类型," + type;
|
|
return "联系管理员增加类型," + type;
|
|
|
}
|
|
}
|