|
@@ -5,9 +5,9 @@ import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.TypeReference;
|
|
import com.alibaba.fastjson.TypeReference;
|
|
import com.aliyun.oss.ServiceException;
|
|
import com.aliyun.oss.ServiceException;
|
|
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
|
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
|
|
|
+import com.winsea.svc.base.base.service.ICommonCompanyService;
|
|
import com.yh.saas.plugin.yiliangyiyun.entity.*;
|
|
import com.yh.saas.plugin.yiliangyiyun.entity.*;
|
|
import com.yh.saas.plugin.yiliangyiyun.entity.view.DistinguishView;
|
|
import com.yh.saas.plugin.yiliangyiyun.entity.view.DistinguishView;
|
|
-import com.yh.saas.plugin.yiliangyiyun.entity.view.DriverInfo;
|
|
|
|
import com.yh.saas.plugin.yiliangyiyun.service.ICommonSysParameterService;
|
|
import com.yh.saas.plugin.yiliangyiyun.service.ICommonSysParameterService;
|
|
import com.yh.saas.plugin.yiliangyiyun.service.IDriverInfoService;
|
|
import com.yh.saas.plugin.yiliangyiyun.service.IDriverInfoService;
|
|
import com.yh.saas.plugin.yiliangyiyun.service.IHyCarCaptainInfoService;
|
|
import com.yh.saas.plugin.yiliangyiyun.service.IHyCarCaptainInfoService;
|
|
@@ -28,6 +28,8 @@ import org.apache.http.ssl.SSLContexts;
|
|
import org.apache.http.util.EntityUtils;
|
|
import org.apache.http.util.EntityUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
+import java.util.regex.Matcher;
|
|
|
|
+import java.util.regex.Pattern;
|
|
|
|
|
|
import javax.annotation.PostConstruct;
|
|
import javax.annotation.PostConstruct;
|
|
import javax.crypto.Mac;
|
|
import javax.crypto.Mac;
|
|
@@ -54,6 +56,8 @@ public class UplodeUtil {
|
|
private IDriverInfoService driverInfoService;
|
|
private IDriverInfoService driverInfoService;
|
|
@Autowired
|
|
@Autowired
|
|
private IHyCarCaptainInfoService carCaptainInfoService;
|
|
private IHyCarCaptainInfoService carCaptainInfoService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ICommonCompanyService commonCompanyService;
|
|
|
|
|
|
public static UplodeUtil uplodeUtil;
|
|
public static UplodeUtil uplodeUtil;
|
|
@PostConstruct
|
|
@PostConstruct
|
|
@@ -123,7 +127,7 @@ public class UplodeUtil {
|
|
driverUtil.setIdCardIssueOrganization("");
|
|
driverUtil.setIdCardIssueOrganization("");
|
|
driverUtil.setQualificationNumber(hyDriverInfo.getQualificationCertificateNumber());
|
|
driverUtil.setQualificationNumber(hyDriverInfo.getQualificationCertificateNumber());
|
|
driverUtil.setIdCardFrontFilename(UplodeUtil.postFile(new ByteArrayInputStream(hyDriverInfo.getCardAddressUrl().getBytes()), "身份证正面照.jpeg"));
|
|
driverUtil.setIdCardFrontFilename(UplodeUtil.postFile(new ByteArrayInputStream(hyDriverInfo.getCardAddressUrl().getBytes()), "身份证正面照.jpeg"));
|
|
- driverUtil.setIdCardBackFilename(UplodeUtil.postFile(new ByteArrayInputStream(hyDriverInfo.getCardBackAddressUrl().getBytes()), "身份证正面照.jpeg"));
|
|
|
|
|
|
+ driverUtil.setIdCardBackFilename(UplodeUtil.postFile(new ByteArrayInputStream(hyDriverInfo.getCardBackAddressUrl().getBytes()), "身份证背面照.jpeg"));
|
|
driverUtil.setLicenseFilename(UplodeUtil.postFile(new ByteArrayInputStream(hyDriverInfo.getDriverLicenseHomePage().getBytes()), "驾驶证主页.jpeg"));
|
|
driverUtil.setLicenseFilename(UplodeUtil.postFile(new ByteArrayInputStream(hyDriverInfo.getDriverLicenseHomePage().getBytes()), "驾驶证主页.jpeg"));
|
|
driverUtil.setQualificationLicenceMainFilename(UplodeUtil.postFile(new ByteArrayInputStream(hyDriverInfo.getQualificationCertificate().getBytes()), "从业资格证主页.jpeg"));
|
|
driverUtil.setQualificationLicenceMainFilename(UplodeUtil.postFile(new ByteArrayInputStream(hyDriverInfo.getQualificationCertificate().getBytes()), "从业资格证主页.jpeg"));
|
|
driverUtil.setQualificationLicenceSideFilename("");
|
|
driverUtil.setQualificationLicenceSideFilename("");
|
|
@@ -135,6 +139,7 @@ public class UplodeUtil {
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 车辆信息上报
|
|
* 车辆信息上报
|
|
* @param hyDriverCarInfo
|
|
* @param hyDriverCarInfo
|
|
@@ -198,6 +203,68 @@ public class UplodeUtil {
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 客户信息上报
|
|
|
|
+ * @param hyCompanyInfo
|
|
|
|
+ * @throws Exception
|
|
|
|
+ */
|
|
|
|
+ public static String uploadCustomer(HyCompanyInfo hyCompanyInfo) throws Exception {
|
|
|
|
+ CustomerUtil customerUtil = new CustomerUtil();
|
|
|
|
+ customerUtil.setType((byte) 1);
|
|
|
|
+ String result="";
|
|
|
|
+ List<String> list = new ArrayList<String>();
|
|
|
|
+ String name=hyCompanyInfo.getCompanyName();
|
|
|
|
+ list.add(name);
|
|
|
|
+ customerUtil.setNameList(list);
|
|
|
|
+ List<String> list1 = new ArrayList<String>();
|
|
|
|
+ String creditCode=hyCompanyInfo.getUnifiedSocialCreditCode();
|
|
|
|
+ list1.add(creditCode);
|
|
|
|
+ customerUtil.setCreditCodeList(list1);
|
|
|
|
+ String customerJson = JSON.toJSONString(customerUtil);
|
|
|
|
+ result = postJson("customer/search", customerJson);
|
|
|
|
+ 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){
|
|
|
|
+ customerUtil.setName(hyCompanyInfo.getCompanyName());
|
|
|
|
+ customerUtil.setCreditCode(hyCompanyInfo.getUnifiedSocialCreditCode());
|
|
|
|
+ customerUtil.setLegalName(hyCompanyInfo.getLegalPersonName());
|
|
|
|
+ customerUtil.setPhone(hyCompanyInfo.getPhone());
|
|
|
|
+ customerUtil.setIdCard(hyCompanyInfo.getCardNumber());
|
|
|
|
+ customerUtil.setIdCardFrontFilename(UplodeUtil.postFile(new ByteArrayInputStream(hyCompanyInfo.getCardAddressUrl().getBytes()), "身份证正面.jpeg"));
|
|
|
|
+ customerUtil.setIdCardBackFilename(UplodeUtil.postFile(new ByteArrayInputStream(hyCompanyInfo.getCardBackAddressUrl().getBytes()), "身份证反面.jpeg"));
|
|
|
|
+ customerUtil.setBusinessLicenseFilename(UplodeUtil.postFile(new ByteArrayInputStream(hyCompanyInfo.getBusinessLicenseAddressUrl().getBytes()), "营业执照.jpeg"));
|
|
|
|
+ List<Map<String,String>> table=UplodeUtil.addressResolution(hyCompanyInfo.getMailingAddress());
|
|
|
|
+ customerUtil.setProvinceName(table.get(0).get("province"));
|
|
|
|
+ customerUtil.setCityName(table.get(0).get("city"));
|
|
|
|
+ customerUtil.setDistrictName(table.get(0).get("county"));
|
|
|
|
+ HyCommonSysParameter hyCommonSysParameter = uplodeUtil.commonSysParameterService.selectOne(new EntityWrapper<HyCommonSysParameter>()
|
|
|
|
+ .eq("const_id", "REGION1").eq("const_value", table.get(0).get("province")));
|
|
|
|
+ if (hyCommonSysParameter!=null) {
|
|
|
|
+ customerUtil.setProvince(hyCommonSysParameter.getConstKey());
|
|
|
|
+ }
|
|
|
|
+ HyCommonSysParameter hyCommonSysParameter2 = uplodeUtil.commonSysParameterService.selectOne(new EntityWrapper<HyCommonSysParameter>()
|
|
|
|
+ .eq("const_id", "REGION1").eq("const_value", table.get(0).get("city")));
|
|
|
|
+ if (hyCommonSysParameter2!=null) {
|
|
|
|
+ customerUtil.setCity(hyCommonSysParameter2.getConstKey());
|
|
|
|
+ }
|
|
|
|
+ HyCommonSysParameter hyCommonSysParameter3 = uplodeUtil.commonSysParameterService.selectOne(new EntityWrapper<HyCommonSysParameter>()
|
|
|
|
+ .eq("const_id", "REGION1").eq("const_value", table.get(0).get("county")));
|
|
|
|
+ if (hyCommonSysParameter3!=null) {
|
|
|
|
+ customerUtil.setDistrict(hyCommonSysParameter3.getConstKey());
|
|
|
|
+ }
|
|
|
|
+ customerUtil.setLocation(hyCompanyInfo.getMailingAddress());
|
|
|
|
+ customerUtil.setRemark("备注");
|
|
|
|
+ customerUtil.setServiceCostRate(0);
|
|
|
|
+ customerJson = JSON.toJSONString(customerUtil);
|
|
|
|
+
|
|
|
|
+ result = postJson("customer/create", customerJson);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ System.out.println(result);
|
|
|
|
+ return result;
|
|
|
|
+ }
|
|
/**
|
|
/**
|
|
* 流水单上报
|
|
* 流水单上报
|
|
* @param hyFreightSettlementInfo
|
|
* @param hyFreightSettlementInfo
|
|
@@ -205,17 +272,31 @@ public class UplodeUtil {
|
|
*/
|
|
*/
|
|
public static String uploadSettlement(HyFreightSettlementInfo hyFreightSettlementInfo) throws Exception {
|
|
public static String uploadSettlement(HyFreightSettlementInfo hyFreightSettlementInfo) throws Exception {
|
|
SettlementUtil settlementUtil = new SettlementUtil();
|
|
SettlementUtil settlementUtil = new SettlementUtil();
|
|
- settlementUtil.setName(hyFreightSettlementInfo.getPayeeName());
|
|
|
|
- settlementUtil.setPhone("");
|
|
|
|
- settlementUtil.setIdCard(hyFreightSettlementInfo.getPayeeIdCard());
|
|
|
|
- //默认为1-银行账户
|
|
|
|
- settlementUtil.setType(1);
|
|
|
|
- settlementUtil.setBankCardNumber(hyFreightSettlementInfo.getBankCard());
|
|
|
|
- settlementUtil.setBankDeposit(hyFreightSettlementInfo.getBankDeposit());
|
|
|
|
|
|
+ List<String> list = new ArrayList<String>();
|
|
|
|
+ String bankCardNumber=hyFreightSettlementInfo.getBankCard();
|
|
|
|
+ list.add(bankCardNumber);
|
|
|
|
+ settlementUtil.setBankCardNumberList(list);
|
|
|
|
+ List<String> list1 = new ArrayList<String>();
|
|
|
|
+ String idCard=hyFreightSettlementInfo.getPayeeIdCard();
|
|
|
|
+ list1.add(idCard);
|
|
|
|
+ settlementUtil.setIdCardList(list1);
|
|
String settlementJson = JSON.toJSONString(settlementUtil);
|
|
String settlementJson = JSON.toJSONString(settlementUtil);
|
|
|
|
|
|
- String result = postJson("payee/create", settlementJson);
|
|
|
|
|
|
+ String result = postJson("payee/search", settlementJson);
|
|
|
|
+ net.sf.json.JSONObject jsonObject = net.sf.json.JSONObject.fromObject(result);
|
|
|
|
+
|
|
|
|
+ if(jsonObject.get("data").toString().length()==0) {
|
|
|
|
+ settlementUtil.setName(hyFreightSettlementInfo.getPayeeName());
|
|
|
|
+ settlementUtil.setPhone("");
|
|
|
|
+ settlementUtil.setIdCard(hyFreightSettlementInfo.getPayeeIdCard());
|
|
|
|
+ //默认为1-银行账户
|
|
|
|
+ settlementUtil.setType(1);
|
|
|
|
+ settlementUtil.setBankCardNumber(hyFreightSettlementInfo.getBankCard());
|
|
|
|
+ settlementUtil.setBankDeposit(hyFreightSettlementInfo.getBankDeposit());
|
|
|
|
+ settlementJson = JSON.toJSONString(settlementUtil);
|
|
|
|
|
|
|
|
+ result = postJson("payee/create", settlementJson);
|
|
|
|
+ }
|
|
System.out.println(result);
|
|
System.out.println(result);
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
@@ -262,35 +343,46 @@ public class UplodeUtil {
|
|
SimpleDateFormat formatter2 = new SimpleDateFormat( "yyyy.MM.dd");
|
|
SimpleDateFormat formatter2 = new SimpleDateFormat( "yyyy.MM.dd");
|
|
SimpleDateFormat formatter1 = new SimpleDateFormat( "yyyy年MM月dd日");
|
|
SimpleDateFormat formatter1 = new SimpleDateFormat( "yyyy年MM月dd日");
|
|
CarrierUtil carrierUtil = new CarrierUtil();
|
|
CarrierUtil carrierUtil = new CarrierUtil();
|
|
|
|
+ String result="";
|
|
//承运人取车队长信息
|
|
//承运人取车队长信息
|
|
if (orderInfo.getCarCaptainCommonId()!=null){
|
|
if (orderInfo.getCarCaptainCommonId()!=null){
|
|
HyCarCaptainInfo carCaptainInfo=uplodeUtil.carCaptainInfoService.selectOne(new EntityWrapper<HyCarCaptainInfo>()
|
|
HyCarCaptainInfo carCaptainInfo=uplodeUtil.carCaptainInfoService.selectOne(new EntityWrapper<HyCarCaptainInfo>()
|
|
.eq("common_id",orderInfo.getCarCaptainCommonId()));
|
|
.eq("common_id",orderInfo.getCarCaptainCommonId()));
|
|
if (carCaptainInfo!=null){
|
|
if (carCaptainInfo!=null){
|
|
- carrierUtil.setName(carCaptainInfo.getName());
|
|
|
|
carrierUtil.setIdCard(carCaptainInfo.getIdCard());
|
|
carrierUtil.setIdCard(carCaptainInfo.getIdCard());
|
|
- carrierUtil.setPhone(orderInfo.getContactPersonPhone());
|
|
|
|
- carrierUtil.setIdCardFrontFilename(UplodeUtil.postFile(new ByteArrayInputStream(carCaptainInfo.getCardAddressUrl().getBytes()), "身份证正面照.jpeg"));
|
|
|
|
- carrierUtil.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);
|
|
|
|
- carrierUtil.setIdCardBeginTime(formatter1.parse(startDate).getTime());
|
|
|
|
- carrierUtil.setIdCardEndTime(formatter1.parse(endDate).getTime());
|
|
|
|
- DistinguishView distinguishView=UplodeUtil.personShibie(carCaptainInfo.getCardAddressUrl(),"1");
|
|
|
|
- carrierUtil.setAddress(distinguishView.getRecPersonAddr());
|
|
|
|
- carrierUtil.setType(20);
|
|
|
|
- carrierUtil.setBusinessLicenseFilename("");
|
|
|
|
- carrierUtil.setBankDeposit(orderInfo.getBankDeposit());
|
|
|
|
- carrierUtil.setBankCardNumber(orderInfo.getBankCard());
|
|
|
|
- carrierUtil.setBranch(orderInfo.getBankDepositBranch());
|
|
|
|
- carrierUtil.setLegalName("");
|
|
|
|
- carrierUtil.setTransportBusinessLicenseFilename(UplodeUtil.postFile(new ByteArrayInputStream(carCaptainInfo.getRoadTransportOperationLicense().getBytes()), "道路运输许可证.jpeg"));
|
|
|
|
- carrierUtil.setTransportBusinessLicenseOtherFilename("");
|
|
|
|
- carrierUtil.setTransportBusinessLicense(carCaptainInfo.getRoadTransportOperationLicenseNo());
|
|
|
|
- carrierUtil.setBusinessHouseholdsName("");
|
|
|
|
|
|
+ carrierUtil.setCarrierName(carCaptainInfo.getName());
|
|
|
|
+
|
|
|
|
+ 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) {
|
|
|
|
+ carrierUtil.setName(carCaptainInfo.getName());
|
|
|
|
+ carrierUtil.setPhone(orderInfo.getContactPersonPhone());
|
|
|
|
+ carrierUtil.setIdCardFrontFilename(UplodeUtil.postFile(new ByteArrayInputStream(carCaptainInfo.getCardAddressUrl().getBytes()), "身份证正面照.jpeg"));
|
|
|
|
+ carrierUtil.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);
|
|
|
|
+ carrierUtil.setIdCardBeginTime(formatter1.parse(startDate).getTime());
|
|
|
|
+ carrierUtil.setIdCardEndTime(formatter1.parse(endDate).getTime());
|
|
|
|
+ DistinguishView distinguishView = UplodeUtil.personShibie(carCaptainInfo.getCardAddressUrl(), "1");
|
|
|
|
+ carrierUtil.setAddress(distinguishView.getRecPersonAddr());
|
|
|
|
+ carrierUtil.setType(20);
|
|
|
|
+ carrierUtil.setBusinessLicenseFilename("");
|
|
|
|
+ carrierUtil.setBankDeposit(orderInfo.getBankDeposit());
|
|
|
|
+ carrierUtil.setBankCardNumber(orderInfo.getBankCard());
|
|
|
|
+ carrierUtil.setBranch(orderInfo.getBankDepositBranch());
|
|
|
|
+ carrierUtil.setLegalName("");
|
|
|
|
+ carrierUtil.setTransportBusinessLicenseFilename(UplodeUtil.postFile(new ByteArrayInputStream(carCaptainInfo.getRoadTransportOperationLicense().getBytes()), "道路运输许可证.jpeg"));
|
|
|
|
+ carrierUtil.setTransportBusinessLicenseOtherFilename("");
|
|
|
|
+ carrierUtil.setTransportBusinessLicense(carCaptainInfo.getRoadTransportOperationLicenseNo());
|
|
|
|
+ carrierUtil.setBusinessHouseholdsName("");
|
|
|
|
+ carrierJson = JSON.toJSONString(carrierUtil);
|
|
|
|
+
|
|
|
|
+ result = postJson("open_middleman/create", carrierJson);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//承运人取司机信息
|
|
//承运人取司机信息
|
|
@@ -298,37 +390,44 @@ public class UplodeUtil {
|
|
HyDriverInfo hyDriverInfo=uplodeUtil.driverInfoService.selectOne(new EntityWrapper<HyDriverInfo>()
|
|
HyDriverInfo hyDriverInfo=uplodeUtil.driverInfoService.selectOne(new EntityWrapper<HyDriverInfo>()
|
|
.eq("common_id",orderInfo.getCommonId()));
|
|
.eq("common_id",orderInfo.getCommonId()));
|
|
if (hyDriverInfo!=null){
|
|
if (hyDriverInfo!=null){
|
|
- carrierUtil.setName(hyDriverInfo.getDriverName());
|
|
|
|
carrierUtil.setIdCard(hyDriverInfo.getNumberCard());
|
|
carrierUtil.setIdCard(hyDriverInfo.getNumberCard());
|
|
- carrierUtil.setPhone(orderInfo.getDriverPhone());
|
|
|
|
- carrierUtil.setIdCardFrontFilename(UplodeUtil.postFile(new ByteArrayInputStream(hyDriverInfo.getCardAddressUrl().getBytes()), "身份证正面照.jpeg"));
|
|
|
|
- carrierUtil.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);
|
|
|
|
- carrierUtil.setIdCardBeginTime(formatter1.parse(startDate).getTime());
|
|
|
|
- carrierUtil.setIdCardEndTime(formatter1.parse(endDate).getTime());
|
|
|
|
- carrierUtil.setAddress(hyDriverInfo.getCardAddress());
|
|
|
|
- carrierUtil.setType(20);
|
|
|
|
- carrierUtil.setBusinessLicenseFilename("");
|
|
|
|
- carrierUtil.setBankDeposit(orderInfo.getBankDeposit());
|
|
|
|
- carrierUtil.setBankCardNumber(orderInfo.getBankCard());
|
|
|
|
- carrierUtil.setBranch(orderInfo.getBankDepositBranch());
|
|
|
|
- carrierUtil.setLegalName("");
|
|
|
|
- carrierUtil.setTransportBusinessLicenseFilename("");
|
|
|
|
- carrierUtil.setTransportBusinessLicenseOtherFilename("");
|
|
|
|
- carrierUtil.setTransportBusinessLicense(hyDriverInfo.getActualCarrierBusinessLicense());
|
|
|
|
- carrierUtil.setBusinessHouseholdsName("");
|
|
|
|
|
|
+ carrierUtil.setCarrierName(hyDriverInfo.getDriverName());
|
|
|
|
+ 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) {
|
|
|
|
+ carrierUtil.setName(hyDriverInfo.getDriverName());
|
|
|
|
+ carrierUtil.setPhone(orderInfo.getDriverPhone());
|
|
|
|
+ carrierUtil.setIdCardFrontFilename(UplodeUtil.postFile(new ByteArrayInputStream(hyDriverInfo.getCardAddressUrl().getBytes()), "身份证正面照.jpeg"));
|
|
|
|
+ carrierUtil.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);
|
|
|
|
+ carrierUtil.setIdCardBeginTime(formatter1.parse(startDate).getTime());
|
|
|
|
+ carrierUtil.setIdCardEndTime(formatter1.parse(endDate).getTime());
|
|
|
|
+ carrierUtil.setAddress(hyDriverInfo.getCardAddress());
|
|
|
|
+ carrierUtil.setType(20);
|
|
|
|
+ carrierUtil.setBusinessLicenseFilename("");
|
|
|
|
+ carrierUtil.setBankDeposit(orderInfo.getBankDeposit());
|
|
|
|
+ carrierUtil.setBankCardNumber(orderInfo.getBankCard());
|
|
|
|
+ carrierUtil.setBranch(orderInfo.getBankDepositBranch());
|
|
|
|
+ carrierUtil.setLegalName("");
|
|
|
|
+ carrierUtil.setTransportBusinessLicenseFilename("");
|
|
|
|
+ carrierUtil.setTransportBusinessLicenseOtherFilename("");
|
|
|
|
+ carrierUtil.setTransportBusinessLicense(hyDriverInfo.getActualCarrierBusinessLicense());
|
|
|
|
+ carrierUtil.setBusinessHouseholdsName("");
|
|
|
|
+ carrierJson = JSON.toJSONString(carrierUtil);
|
|
|
|
+
|
|
|
|
+ result = postJson("open_middleman/create", carrierJson);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- String carrierJson = JSON.toJSONString(carrierUtil);
|
|
|
|
|
|
|
|
- String result = postJson("open_middleman/create", carrierJson);
|
|
|
|
|
|
|
|
System.out.println(result);
|
|
System.out.println(result);
|
|
return result;
|
|
return result;
|
|
@@ -373,7 +472,7 @@ public class UplodeUtil {
|
|
JSONObject shipperInfoDTO = new JSONObject();
|
|
JSONObject shipperInfoDTO = new JSONObject();
|
|
shipperInfoDTO.put("payType", 0);
|
|
shipperInfoDTO.put("payType", 0);
|
|
shipperInfoDTO.put("shipperName", orderInfo.getConsignorName());
|
|
shipperInfoDTO.put("shipperName", orderInfo.getConsignorName());
|
|
- shipperInfoDTO.put("shipperPhone", orderInfo.getDriverPhone());
|
|
|
|
|
|
+ shipperInfoDTO.put("shipperPhone", orderInfo.getConsignorPhone());
|
|
shipperInfoDTO.put("shipperIdCard", orderInfo.getConsignorID());
|
|
shipperInfoDTO.put("shipperIdCard", orderInfo.getConsignorID());
|
|
shipperInfoDTO.put("shipperTransportCost", orderInfo.getFreight());
|
|
shipperInfoDTO.put("shipperTransportCost", orderInfo.getFreight());
|
|
orderUtil.setShipperInfoDTO(shipperInfoDTO);
|
|
orderUtil.setShipperInfoDTO(shipperInfoDTO);
|
|
@@ -582,7 +681,24 @@ public class UplodeUtil {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ public static List<Map<String,String>> addressResolution(String address){
|
|
|
|
+ String regex="(?<province>[^省]+自治区|.*?省|.*?行政区|.*?市)(?<city>[^市]+自治州|.*?地区|.*?行政单位|.+盟|市辖区|.*?市|.*?县)(?<county>[^县]+县|.+区|.+市|.+旗|.+海域|.+岛)?(?<town>[^区]+区|.+镇)?(?<village>.*)";
|
|
|
|
+ Matcher m=Pattern.compile(regex).matcher(address);
|
|
|
|
+ String province=null,city=null,county=null;
|
|
|
|
+ List<Map<String,String>> table=new ArrayList<Map<String,String>>();
|
|
|
|
+ Map<String,String> row=null;
|
|
|
|
+ row=new LinkedHashMap<String,String>();
|
|
|
|
+ while( m.find() ){
|
|
|
|
+ province=m.group("province");
|
|
|
|
+ row.put("province", province==null?"":province.trim());
|
|
|
|
+ city=m.group("city");
|
|
|
|
+ row.put("city", city==null?"":city.trim());
|
|
|
|
+ county=m.group("county");
|
|
|
|
+ row.put("county", county==null?"":county.trim());
|
|
|
|
+ }
|
|
|
|
+ table.add(row);
|
|
|
|
+ return table;
|
|
|
|
+ }
|
|
public static DistinguishView personShibie(String personImg,String flag) throws ServiceException {
|
|
public static DistinguishView personShibie(String personImg,String flag) throws ServiceException {
|
|
String appcode = "2d59bfa794994f5f94d1d98b7b5bd102";
|
|
String appcode = "2d59bfa794994f5f94d1d98b7b5bd102";
|
|
//API产品路径
|
|
//API产品路径
|