|
@@ -15,6 +15,7 @@ import com.jkcredit.invoice.model.entity.manager.Param;
|
|
|
import com.jkcredit.invoice.model.entity.waybill.NoCarWayBill;
|
|
|
import com.jkcredit.invoice.service.customer.CustomerRecService;
|
|
|
import com.jkcredit.invoice.service.lowerservice.NoCarService;
|
|
|
+import com.jkcredit.invoice.service.lowerservice.vo.HCInvoiceQueryVo;
|
|
|
import com.jkcredit.invoice.service.manager.ParamService;
|
|
|
import com.jkcredit.invoice.service.nocar.NoCarBillWayImportService;
|
|
|
import com.jkcredit.invoice.util.DateUtil;
|
|
@@ -823,6 +824,84 @@ public class NoCarInterServiceImpl implements NoCarInterService {
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 无车 红冲发票查询接口
|
|
|
+ * @param appKey
|
|
|
+ * @param api
|
|
|
+ * @param data
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public DataResult redInkInvoiceQuery(String appKey, String api, String data,String requestid) {
|
|
|
+ long costtimestart = System.currentTimeMillis();
|
|
|
+
|
|
|
+ DataResult result = new DataResult();
|
|
|
+
|
|
|
+ result.setData(3);
|
|
|
+ result.setCode(200);
|
|
|
+ result.setRequestid(requestid);
|
|
|
+ result.setMsg("无法认证");
|
|
|
+
|
|
|
+ try {
|
|
|
+ log.info("[-NoCarInterServiceImpl.redInkInvoiceQuery-] request appKey=" + appKey + " ,api=" + api + " ,data=" +data+ " ,requestid=" +requestid);
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(data);
|
|
|
+ String companyNum = jsonObject.getString("companyNum");//企业编号 必输
|
|
|
+ String month = jsonObject.getString("month");//开票月份 样例:yyyy-MM 必输
|
|
|
+ if(StringUtils.isEmpty(data)|| null == jsonObject){
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ if( StringUtils.isEmpty(companyNum) || StringUtils.isEmpty(month)
|
|
|
+ ){
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if ( null == DateUtil.parseDate(month)){
|
|
|
+ result.setMsg("日期格式不正确!");
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ CustomerRec customerRec2 = new CustomerRec();
|
|
|
+ customerRec2.setCustomerName(appKey);
|
|
|
+ customerRec2.setCompanyNum(companyNum);
|
|
|
+ CustomerRec customerRec1 = customerRecMapper.selectByCustomerNameAndCompanyNum(customerRec2);
|
|
|
+ if (null == customerRec1 || customerRec1.getRecStatus() != 1){
|
|
|
+ result.setMsg("企业还未备案成功!");
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ HCInvoiceQueryVo hcInvoiceQueryVo = new HCInvoiceQueryVo();
|
|
|
+ hcInvoiceQueryVo.setCustomerName(appKey);
|
|
|
+ hcInvoiceQueryVo.setCompanyNum(companyNum);
|
|
|
+ hcInvoiceQueryVo.setCompanyName(customerRec1.getCompanyName());
|
|
|
+ hcInvoiceQueryVo.setMonth(month);
|
|
|
+ RespR rs = noCarService.hCInvoiceQuery(hcInvoiceQueryVo);
|
|
|
+
|
|
|
+ long costtimeend = System.currentTimeMillis();
|
|
|
+ log.info("[-NoCarInterServiceImpl.redInkInvoiceQuery-] result is "
|
|
|
+ + rs.toString() + ", request is " + data + " ,costtime="
|
|
|
+ + (costtimeend - costtimestart));
|
|
|
+ if(null != rs && rs.getCode() == 0){
|
|
|
+ result.setData(1);
|
|
|
+ result.setCode(200);
|
|
|
+ result.setMsg(rs.getData().toString());
|
|
|
+ return result;
|
|
|
+ } else {
|
|
|
+ result.setData(3);
|
|
|
+ result.setCode(200);
|
|
|
+ result.setMsg(rs.getMsg());
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("[-NoCarInterServiceImpl.redInkInvoiceQuery-] get httpclient exception is "
|
|
|
+ + e + ", request is " + data);
|
|
|
+ }
|
|
|
+
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
public static void main(String[] args) {
|
|
|
List<String> list1 = new ArrayList<String>();
|
|
|
list1.add("1");
|