From 1d42efe4cbd6b1028a28ff7f3ef2b3d721051c2f Mon Sep 17 00:00:00 2001 From: kongdeqiang <123456> Date: 星期四, 26 九月 2024 13:58:24 +0800 Subject: [PATCH] fix : 新增修改车数日志 --- src/main/java/com/boying/controller/phone/EticketController.java | 61 ++++++++++++++++++------------ 1 files changed, 37 insertions(+), 24 deletions(-) diff --git a/src/main/java/com/boying/controller/phone/EticketController.java b/src/main/java/com/boying/controller/phone/EticketController.java index 07451d6..e003aa0 100644 --- a/src/main/java/com/boying/controller/phone/EticketController.java +++ b/src/main/java/com/boying/controller/phone/EticketController.java @@ -13,6 +13,7 @@ import com.boying.util.ObjectToMapUtil; import com.google.gson.Gson; import lombok.RequiredArgsConstructor; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; import org.springframework.web.client.RestTemplate; import org.springframework.web.multipart.MultipartFile; @@ -22,6 +23,7 @@ @RequiredArgsConstructor public class EticketController { + @Autowired private final SystemConfigProperties systemConfigProperties; /** @@ -29,13 +31,13 @@ */ - public static void main(String[] args) { + public static void main9(String[] args) { //鐩存帴寮�绁� SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat sdf2 = new SimpleDateFormat("hh:mm:ss"); String format = sdf.format(new Date()); String format2 = sdf2.format(new Date()); - String idStr = 111111+""; + String idStr = 25238+""; String dateStr = DateUtil.currentSeconds()+""; String l = idStr + dateStr; @@ -43,7 +45,7 @@ //寮�绁ㄧ敵璇� DirectTicket.info info = new DirectTicket.info(); info.setOrdernum(1); - info.setAmt(3.0); + info.setAmt(3); info.setAmount(1); info.setIncitemcode("072101"); info.setIncitemname("鍋滆溅娉婁綅鍙婂叕鍏卞仠杞﹀満绛夋湁鍋夸娇鐢ㄦ敹鍏�"); @@ -57,12 +59,13 @@ directTicket.setIssuedate(format); directTicket.setIssuetime(format2); directTicket.setPayerpartytype("1"); - directTicket.setPayer("鍐�A0C5MA"); - directTicket.setAmt(3.0); + directTicket.setPayer("鍐�DM118N"); + directTicket.setAmt(3); directTicket.setUsername("寮犲▏"); directTicket.setChecker("涔斿畞"); directTicket.setPayinfo(json); directTicket.setState(1); + directTicket.setBilltypeid("1252"); String jsonStr = JSON.toJSONString(directTicket, SerializerFeature.WriteDateUseDateFormat); Map<String, Object> map = JSON.parseObject(jsonStr, new TypeReference<Map<String, Object>>() {}); @@ -73,7 +76,7 @@ txt += map+",\n"; if(entity.getBody().getCode() ==1 ){ //鐢宠鎴愬姛锛屽幓鑾峰彇寮�绁ㄦ枃浠� - //System.out.println(entity.getBody()); + System.out.println(entity.getBody()); Object o = entity.getBody().getData().get(0); String s = JSON.toJSONString(o); Map<String,Object> mapTypes = (Map)JSON.parse(s); @@ -84,24 +87,43 @@ System.out.println("einvoiceid:"+(String) mapTypes.get("einvoiceid")); System.out.println("einvoicefilename:"+(String) mapTypes.get("einvoicefilename")); }else { - + System.out.println(entity.getBody()); } + + /** + * ReturnData(code=1, msg=鑾峰彇鎴愬姛, total=0, data=[{randomnumber=859719, einvoicefilename=130113230001813560, einvoiceid=0653181000-32311031, einvoicenumber=0001813560, eticketnum=252381686303715, state=1, einvoicecode=13011323}], singleData=null) + * bizcode:252381686303715 + * einvoicecode:13011323 + * einvoicenumber:0001813560 + * randomnumber:859719 + * einvoiceid:0653181000-32311031 + * einvoicefilename:130113230001813560 + */ } - public static void main9(String[] args) { + public static void main(String[] args) { Map<String,Object> map1 = new HashMap<>(); - map1.put("einvoicecode", ""); - map1.put("einvoicenumber",""); - map1.put("bizcode", ""); - map1.put("randomnumber",""); + map1.put("bizcode","252381686303715"); + RestTemplate restTemplate = new RestTemplate(); + ResponseEntity<ReturnData> entity = restTemplate.postForEntity("http://10.255.200.204:7991/search/meinvoicestatus", HTTPEntityUtil.setEntity(map1), ReturnData.class); + System.out.println(entity.getBody()); + //ReturnData(code=1, msg=鏌ヨ鎴愬姛, total=0, data=[{filldate=2022-12-22, payeeaccount=13001645408050002448, bankaffirm=13061890816FPJZDGVS, eticketnum=13040622000000640564, amt=1.0, bankstation=130618908, payway=2, admdivcode=130406, payinfo=[{"incitemname":"鍋滆溅娉婁綅鍙婂叕鍏卞仠杞﹀満绛夋湁鍋夸娇鐢ㄦ敹鍏�","amount":1,"incitemcode":"072101","amt":1,"ordernum":1}], payer=宄板嘲鏅烘収鍋滆溅, paybankdt=2022-12-22 15:14:59, payeebank=寤鸿閭兏甯傚嘲宄版敮琛�, payee=宄板嘲鐭垮尯闈炵◣鏀跺叆鏈嶅姟涓績, payerbank=, payeraccount=, invoicingpartyname=閭兏甯傚嘲宄扮熆鍖虹患鍚堣鏀挎墽娉曞眬, invoicingpartycode=506002}], singleData=null) + // payinfo=[{"incitemname":"鍋滆溅娉婁綅鍙婂叕鍏卞仠杞﹀満绛夋湁鍋夸娇鐢ㄦ敹鍏�","amount":1,"incitemcode":"072101","amt":1,"ordernum":1}] + } + + + public static void main91(String[] args) { + Map<String,Object> map1 = new HashMap<>(); + map1.put("einvoicecode", "13011323"); + map1.put("einvoicenumber","0001813560"); + map1.put("bizcode", "252381686303715"); + map1.put("randomnumber","859719"); map1.put("billfiletype",1); SimpleDateFormat sdf3 = new SimpleDateFormat("yyyy-MM-dd_HH_mm_ss"); - String txt = sdf3.format(new Date())+"鐢宠绁ㄦ嵁鏂囦欢锛�"+map1+",\n"; RestTemplate restTemplate = new RestTemplate(); ResponseEntity<ReturnData> entity = restTemplate.postForEntity("http://10.255.200.204:7991/geteinvoicebybizcode", HTTPEntityUtil.setEntity(map1), ReturnData.class); + System.out.println(entity.getBody()); if(entity.getBody().getCode() == 1){ - System.out.println(entity.getBody()); - txt += entity.getBody()+",\n"; Object o1 = entity.getBody().getData().get(0); String s1 = JSON.toJSONString(o1); EticketFile eticketFile = JSONObject.parseObject(s1, EticketFile.class); @@ -255,15 +277,6 @@ //ReturnData(code=1, msg=鏌ヨ鎴愬姛, total=0, data=[{randomnumber=264640, einvoicefilename=130112220011112124, einvoiceid=4212111100-22211031, einvoicenumber=0011112124, eticketnum=13040622000000640564, state=1, einvoicecode=13011222, info=寮�绁ㄦ垚鍔焳], singleData=null) } - public static void main5(String[] args) { - Map<String,Object> map1 = new HashMap<>(); - map1.put("eticketnum","13040622000000640564"); - RestTemplate restTemplate = new RestTemplate(); - ResponseEntity<ReturnData> entity = restTemplate.postForEntity("http://10.255.200.204:7991/search/eticket", HTTPEntityUtil.setEntity(map1), ReturnData.class); - System.out.println(entity.getBody()); - //ReturnData(code=1, msg=鏌ヨ鎴愬姛, total=0, data=[{filldate=2022-12-22, payeeaccount=13001645408050002448, bankaffirm=13061890816FPJZDGVS, eticketnum=13040622000000640564, amt=1.0, bankstation=130618908, payway=2, admdivcode=130406, payinfo=[{"incitemname":"鍋滆溅娉婁綅鍙婂叕鍏卞仠杞﹀満绛夋湁鍋夸娇鐢ㄦ敹鍏�","amount":1,"incitemcode":"072101","amt":1,"ordernum":1}], payer=宄板嘲鏅烘収鍋滆溅, paybankdt=2022-12-22 15:14:59, payeebank=寤鸿閭兏甯傚嘲宄版敮琛�, payee=宄板嘲鐭垮尯闈炵◣鏀跺叆鏈嶅姟涓績, payerbank=, payeraccount=, invoicingpartyname=閭兏甯傚嘲宄扮熆鍖虹患鍚堣鏀挎墽娉曞眬, invoicingpartycode=506002}], singleData=null) - // payinfo=[{"incitemname":"鍋滆溅娉婁綅鍙婂叕鍏卞仠杞﹀満绛夋湁鍋夸娇鐢ㄦ敹鍏�","amount":1,"incitemcode":"072101","amt":1,"ordernum":1}] - } //鑾峰彇缂存涔� public void getAPPLYETCKETNUM(ApplyTicket applyTicket) throws IllegalAccessException { -- Gitblit v1.9.1