| | |
| | | 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; |
| | |
| | | |
| | | @RequiredArgsConstructor |
| | | public class EticketController { |
| | | @Autowired |
| | | private final SystemConfigProperties systemConfigProperties; |
| | | |
| | | /** |
| | |
| | | */ |
| | | |
| | | |
| | | 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; |
| | | |
| | |
| | | //开票申请 |
| | | DirectTicket.info info = new DirectTicket.info(); |
| | | info.setOrdernum(1); |
| | | info.setAmt(3.0); |
| | | info.setAmt(3); |
| | | info.setAmount(1); |
| | | info.setIncitemcode("072101"); |
| | | info.setIncitemname("停车泊位及公共停车场等有偿使用收入"); |
| | |
| | | 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>>() {}); |
| | |
| | | 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); |
| | |
| | | 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); |
| | |
| | | //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 { |