|
@@ -225,7 +225,7 @@ public class UplodeUtil {
|
|
|
net.sf.json.JSONObject jsonObject = net.sf.json.JSONObject.fromObject(result);
|
|
|
// net.sf.json.JSONArray dataNJson = jsonObject.getJSONArray("date");
|
|
|
|
|
|
- if(jsonObject.get("data").toString().length()==0){
|
|
|
+ if((jsonObject.getJSONArray("data")).size()==0) {
|
|
|
customerUtil.setName(hyCompanyInfo.getCompanyName());
|
|
|
customerUtil.setCreditCode(hyCompanyInfo.getUnifiedSocialCreditCode());
|
|
|
customerUtil.setLegalName(hyCompanyInfo.getLegalPersonName());
|
|
@@ -285,7 +285,7 @@ public class UplodeUtil {
|
|
|
String result = postJson("payee/search", settlementJson);
|
|
|
net.sf.json.JSONObject jsonObject = net.sf.json.JSONObject.fromObject(result);
|
|
|
|
|
|
- if(jsonObject.get("data").toString().length()==0) {
|
|
|
+ if((jsonObject.getJSONArray("data")).size()==0) {
|
|
|
settlementUtil.setName(hyFreightSettlementInfo.getPayeeName());
|
|
|
settlementUtil.setPhone("");
|
|
|
settlementUtil.setIdCard(hyFreightSettlementInfo.getPayeeIdCard());
|
|
@@ -355,7 +355,7 @@ public class UplodeUtil {
|
|
|
String carrierJson = JSON.toJSONString(carrierUtil);
|
|
|
result = postJson("open_middleman/search", carrierJson);
|
|
|
net.sf.json.JSONObject jsonObject = net.sf.json.JSONObject.fromObject(result);
|
|
|
- if(jsonObject.get("data").toString().length()==0) {
|
|
|
+ if((jsonObject.getJSONArray("data")).size()==0) {
|
|
|
carrierUtil.setName(carCaptainInfo.getName());
|
|
|
carrierUtil.setPhone(orderInfo.getContactPersonPhone());
|
|
|
carrierUtil.setIdCardFrontFilename(UplodeUtil.postFile(new ByteArrayInputStream(carCaptainInfo.getCardAddressUrl().getBytes()), "身份证正面照.jpeg"));
|
|
@@ -395,7 +395,7 @@ public class UplodeUtil {
|
|
|
String carrierJson = JSON.toJSONString(carrierUtil);
|
|
|
result = postJson("open_middleman/search", carrierJson);
|
|
|
net.sf.json.JSONObject jsonObject = net.sf.json.JSONObject.fromObject(result);
|
|
|
- if(jsonObject.get("data").toString().length()==0) {
|
|
|
+ if((jsonObject.getJSONArray("data")).size()==0) {
|
|
|
carrierUtil.setName(hyDriverInfo.getDriverName());
|
|
|
carrierUtil.setPhone(orderInfo.getDriverPhone());
|
|
|
carrierUtil.setIdCardFrontFilename(UplodeUtil.postFile(new ByteArrayInputStream(hyDriverInfo.getCardAddressUrl().getBytes()), "身份证正面照.jpeg"));
|
|
@@ -429,6 +429,98 @@ public class UplodeUtil {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ System.out.println(result);
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 实名认证
|
|
|
+ * @param orderInfo
|
|
|
+ * @throws Exception
|
|
|
+ */
|
|
|
+ public static String uploadRealName(OrderInfo orderInfo) throws Exception {
|
|
|
+ SimpleDateFormat formatter = new SimpleDateFormat( "yyyy-MM-dd");
|
|
|
+ SimpleDateFormat formatter2 = new SimpleDateFormat( "yyyy.MM.dd");
|
|
|
+ SimpleDateFormat formatter1 = new SimpleDateFormat( "yyyy年MM月dd日");
|
|
|
+ RealUtil realUtil = new RealUtil();
|
|
|
+ String result="";
|
|
|
+ //承运人取车队长信息
|
|
|
+ if (orderInfo.getCarCaptainCommonId()!=null){
|
|
|
+ HyCarCaptainInfo carCaptainInfo=uplodeUtil.carCaptainInfoService.selectOne(new EntityWrapper<HyCarCaptainInfo>()
|
|
|
+ .eq("common_id",orderInfo.getCarCaptainCommonId()));
|
|
|
+ if (carCaptainInfo!=null){
|
|
|
+ List<String> list = new ArrayList<String>();
|
|
|
+ String idCard=carCaptainInfo.getIdCard();
|
|
|
+ list.add(idCard);
|
|
|
+ realUtil.setIdCards(list);
|
|
|
+ String realJson = JSON.toJSONString(realUtil);
|
|
|
+ result = postJson("realName/queryByIdCard", realJson);
|
|
|
+ net.sf.json.JSONObject jsonObject = net.sf.json.JSONObject.fromObject(result);
|
|
|
+ if((jsonObject.getJSONArray("data")).size()==0) {
|
|
|
+ realUtil.setRealName(carCaptainInfo.getName());
|
|
|
+ realUtil.setIdCard(carCaptainInfo.getIdCard());
|
|
|
+ realUtil.setIdCardFrontFilename(UplodeUtil.postFile(new ByteArrayInputStream(carCaptainInfo.getCardAddressUrl().getBytes()), "身份证正面照.jpeg"));
|
|
|
+ realUtil.setIdCardBackFilename(UplodeUtil.postFile(new ByteArrayInputStream(carCaptainInfo.getCardBackAddressUrl().getBytes()), "身份证背面照.jpeg"));
|
|
|
+ //身份证起始日期
|
|
|
+ String startDate = formatter1.format(carCaptainInfo.getCardValidityStartDate());
|
|
|
+ //身份证截止日期
|
|
|
+ Date date = formatter.parse(carCaptainInfo.getCardValidityEndDate());
|
|
|
+ String endDate = formatter1.format(date);
|
|
|
+ realUtil.setIdCardStartDate(formatter1.parse(startDate).getTime());
|
|
|
+ realUtil.setIdCardEndDate(formatter1.parse(endDate).getTime());
|
|
|
+ DistinguishView distinguishView = UplodeUtil.personShibie(carCaptainInfo.getCardAddressUrl(), "1");
|
|
|
+// realUtil.setNation("");
|
|
|
+ realUtil.setAddress(distinguishView.getRecPersonAddr());
|
|
|
+// realUtil.setGender();
|
|
|
+// realUtil.setBirthday("");
|
|
|
+// realUtil.setIdCardIssueOrganization(orderInfo.getBankDeposit());
|
|
|
+ realUtil.setSelfImageFilename(UplodeUtil.postFile(new ByteArrayInputStream(carCaptainInfo.getSelfPhoto().getBytes()), "自拍照片.jpeg"));
|
|
|
+ realJson = JSON.toJSONString(realUtil);
|
|
|
+
|
|
|
+ result = postJson("realName/submit", realJson);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //承运人取司机信息
|
|
|
+ else{
|
|
|
+ HyDriverInfo hyDriverInfo=uplodeUtil.driverInfoService.selectOne(new EntityWrapper<HyDriverInfo>()
|
|
|
+ .eq("common_id",orderInfo.getCommonId()));
|
|
|
+ if (hyDriverInfo!=null){
|
|
|
+ List<String> list = new ArrayList<String>();
|
|
|
+ String idCard=hyDriverInfo.getNumberCard();
|
|
|
+ list.add(idCard);
|
|
|
+ realUtil.setIdCards(list);
|
|
|
+ String realJson = JSON.toJSONString(realUtil);
|
|
|
+ result = postJson("realName/queryByIdCard", realJson);
|
|
|
+ net.sf.json.JSONObject jsonObject = net.sf.json.JSONObject.fromObject(result);
|
|
|
+ if((jsonObject.getJSONArray("data")).size()==0) {
|
|
|
+ realUtil.setRealName(hyDriverInfo.getDriverName());
|
|
|
+ realUtil.setIdCard(hyDriverInfo.getNumberCard());
|
|
|
+ realUtil.setIdCardFrontFilename(UplodeUtil.postFile(new ByteArrayInputStream(hyDriverInfo.getCardAddressUrl().getBytes()), "身份证正面照.jpeg"));
|
|
|
+ realUtil.setIdCardBackFilename(UplodeUtil.postFile(new ByteArrayInputStream(hyDriverInfo.getCardBackAddressUrl().getBytes()), "身份证背面照.jpeg"));
|
|
|
+ DistinguishView distinguishView = UplodeUtil.personShibie(hyDriverInfo.getCardBackAddressUrl(), "2");
|
|
|
+ String time = distinguishView.getIdCardValidity().substring(0, distinguishView.getIdCardValidity().indexOf('-'));
|
|
|
+ Date date1 = formatter2.parse(time);
|
|
|
+ //身份证起始日期
|
|
|
+ String startDate = formatter1.format(date1);
|
|
|
+ //身份证截止日期
|
|
|
+ Date date = formatter.parse(hyDriverInfo.getCardValidityDate());
|
|
|
+ String endDate = formatter1.format(date);
|
|
|
+ realUtil.setIdCardStartDate(formatter1.parse(startDate).getTime());
|
|
|
+ realUtil.setIdCardEndDate(formatter1.parse(endDate).getTime());
|
|
|
+// realUtil.setNation("");
|
|
|
+ realUtil.setAddress(hyDriverInfo.getCardAddress());
|
|
|
+// realUtil.setGender();
|
|
|
+// realUtil.setBirthday("");
|
|
|
+// realUtil.setIdCardIssueOrganization(orderInfo.getBankDeposit());
|
|
|
+ realUtil.setSelfImageFilename(UplodeUtil.postFile(new ByteArrayInputStream(hyDriverInfo.getSelfPhoto().getBytes()), "自拍照片.jpeg"));
|
|
|
+ realJson = JSON.toJSONString(realUtil);
|
|
|
+
|
|
|
+ result = postJson("realName/submit", realJson);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
System.out.println(result);
|
|
|
return result;
|
|
|
}
|
|
@@ -760,6 +852,7 @@ public class UplodeUtil {
|
|
|
if ("1".equals(flag)) {
|
|
|
//身份证正面
|
|
|
distinguishView.setRecPersonAddr(jsonObject.getJSONObject("身份证识别实体信息").getJSONObject("身份证人像面实体信息").getString("住址"));
|
|
|
+ distinguishView.setRecPersonBrithday(jsonObject.getJSONObject("身份证识别实体信息").getJSONObject("身份证人像面实体信息").getString("出生日期"));
|
|
|
} else if ("2".equals(flag)) {
|
|
|
//身份证反面
|
|
|
distinguishView.setIdCardValidity(jsonObject.getJSONObject("身份证识别实体信息").getJSONObject("身份证国徽面实体信息").getString("有效期限"));
|